Grails 默认排序关联(双向一对多)
我正在尝试对关联进行默认排序,我的域类基本上如下
Class Section{
Integer displayOrder
static hasMany=[questionCategories:QuestionCategory]
static mapping={
questionCategories sort:'displayOrder'
}
}
Class QuestionCategory{
Integer displayOrder
static hasMany=[questions:Question]
static mapping={
questions sort:'displayOrder'
}
}
Class Question{
Integer displayOrder
}
我想获取按节类的displayOrder排序的节对象列表,按questionCatgory类的displayOrder排序的内部questionCategories以及按问题类的displayOrder排序的类似问题
I已经尝试过 SortedSet 方法并且工作正常,但不幸的是我们无法将它
与此配置一起使用我收到此错误
java.sql.SQLSyntaxErrorException: ORA-00904: "QUESTIONCA3_"."DISPLAY_ORDER": invalid identifier
I am trying to default sort an association, my domain classes are as follows
Class Section{
Integer displayOrder
static hasMany=[questionCategories:QuestionCategory]
static mapping={
questionCategories sort:'displayOrder'
}
}
Class QuestionCategory{
Integer displayOrder
static hasMany=[questions:Question]
static mapping={
questions sort:'displayOrder'
}
}
Class Question{
Integer displayOrder
}
basically i want to get a list of section objects which is sorted by section class's displayOrder, the inner questionCategories sorted by questionCatgory Class's displayOrder and similarly questions sorted by Question class's displayOrder
I have tried SortedSet approach and that works fine, but unfortunately we cannot use it
with this configuration i am getting this error
java.sql.SQLSyntaxErrorException: ORA-00904: "QUESTIONCA3_"."DISPLAY_ORDER": invalid identifier
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这看起来像是您的数据库设置不正确。您的基础表之一没有“DISPLAY_ORDER”列。从“QUESTIONCA3_”来看,我猜这是与 QuestionCategory 相关的表。
This looks like your database is not setup correctly. One of your underlying tables doesn't have a "DISPLAY_ORDER" column. Judging by the "QUESTIONCA3_" I'd guess it's the table related to QuestionCategory.