次の Grails ドメイン オブジェクトがあります。
class ProductType {
String name
static hasMany = [attributes: Attribute]
}
class Attribute {
Boolean mandatory = false
Integer seq
static belongsTo = [productType: ProductType]
}
ProductType
すべての とその必須のを取得したいと思いAttribute
ます。Attribute
さらに、選択したs を積極的に読み込み、プロパティ別に並べ替えたいと思いseq
ます。あらゆる種類の HQL および Criteria クエリを試しましたが、理解できないようです。