Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: 0.5.5-RC1
-
Fix Version/s: 1.0.2
-
Component/s: Persistence
-
Labels:None
-
Testcase included:yes
Description
Take this domain class:
class Knowledge {
static optionals = [ "parent" ]
String name
Knowledge parent
List children
static hasMany = [keywords:Keyword, children:Knowledge]
}
As you can see, the children are ordered. The problem are the root nodes (parent == null): The standard persistence code doesn't set the children_idx column when parent == null and therefore, the created objects cannot be loaded in the show method:
org.hibernate.HibernateException: null index column for collection: Knowledge.children
To recreate the problem, run the attached wep-app, open http://localhost:8080/GrailsSensei/knowledge/list and then click on "show" for both items. The first item (the root node) will fail, the second one will work.
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits