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
Caput Ind. 100 points

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

4 (3 Votes)
0
Are there any code examples left?
New code examples in category Groovy
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source