gorm grails code example

Example 1: gorm in grails

def results = Book.findAllByTitle("The Shining",
[max: 10, sort: "title", order: "desc", offset: 100])

Example 2: GORM in grails

def b = Book.findByTitle("The Shining")

    b = Book.findByTitleAndAuthor("The Sum of All Fears", "Tom Clancy")
    b = Book.findByReleaseDateBetween(firstDate, new Date())
    b = Book.findByReleaseDateGreaterThanEquals(firstDate)
    b = Book.findByReleaseDateLessThanEquals(firstDate)
    b = Book.findByTitleLike("%Hard work%")
    b = Book.findByTitleIlike("%Hard work%") // ignores case
    b = Book.findByTitleNotEqual("Harry Potter")
    b = Book.findByReleaseDateIsNull()
    b = Book.findByReleaseDateIsNotNull()
    b = Book.findPaperbackByAuthor("Douglas Adams")
    b = Book.findNotPaperbackByAuthor("Douglas Adams")
    b = Book.findByAuthorInList(["Douglas Adams", "Hunter S. Thompson"])