我有以下的Grails域对象GORM的Hibernate查询
class ProductType {
String name
static hasMany = [attributes: Attribute]
}
class Attribute {
Boolean mandatory = false
Integer seq
static belongsTo = [productType: ProductType]
}
我想获得的所有ProductType
S和他们的强制性Attribute
秒。此外,我希望所选的Attribute
s被热切加载并按seq
属性排序。我试过各种HQL和Criteria查询,但似乎无法弄清楚。