class Book {
String title
Date releaseDate
String author
static constraints = {
releaseDate nullable: true
}
}
findWhere
目的
使用与域类属性名称相对应的命名参数来执行返回第一个匹配结果的查询。
示例
给出域类
您可以以下形式进行查询
def book = Book.findWhere(author: "Stephen King", title: "The Stand")
boolean isReleased = Book.findWhere(author: "Stephen King",
title: "The Stand",
releaseDate: null) != null
描述
参数
-
queryParams
- 用于此查询的键/值对的Map