我有以下的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查詢,但似乎無法弄清楚。