次の 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 クエリを試しましたが、理解できないようです。