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"])
4
3
def results = Book.findAllByTitle("The Shining",
[max: 10, sort: "title", order: "desc", offset: 100])
Thank you!
3
0
Are there any code examples left?
New code examples in category Groovy
-
Groovy 2022-03-07 19:40:14 loadonce in jqgrid
-
Groovy 2022-02-14 16:00:26 groovy add array to array
-
Groovy 2022-01-30 21:32:07 grails 2.5.1 datasource configuration
-
Groovy 2021-11-09 09:30:38 groovy wait time
-
Groovy 2021-11-07 09:51:12 groovy to int
-
Groovy 2021-11-04 17:49:04 criteria in grails
-
Groovy 2021-11-04 00:00:13 pagination in grails
-
Groovy 2021-11-03 23:25:13 groovy to string
-
Groovy 2021-10-24 23:08:06 groovy parse yaml ithputh snakeyml