findby in grails

Solutions on MaxInterview for findby in grails by the best coders in the world

showing results for - "findby in grails"
Maelie
02 Jul 2020
1def b = Book.findByTitle("The Shining")
2
3    b = Book.findByTitleAndAuthor("The Sum of All Fears", "Tom Clancy")
4    b = Book.findByReleaseDateBetween(firstDate, new Date())
5    b = Book.findByReleaseDateGreaterThanEquals(firstDate)
6    b = Book.findByReleaseDateLessThanEquals(firstDate)
7    b = Book.findByTitleLike("%Hard work%")
8    b = Book.findByTitleIlike("%Hard work%") // ignores case
9    b = Book.findByTitleNotEqual("Harry Potter")
10    b = Book.findByReleaseDateIsNull()
11    b = Book.findByReleaseDateIsNotNull()
12    b = Book.findPaperbackByAuthor("Douglas Adams")
13    b = Book.findNotPaperbackByAuthor("Douglas Adams")
14    b = Book.findByAuthorInList(["Douglas Adams", "Hunter S. Thompson"])
similar questions
findbyname in jpa