-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Column index not populated?
PostPosted: Tue Sep 29, 2009 3:04 am 
Regular
Regular

Joined: Wed Oct 15, 2003 4:40 pm
Posts: 67
I've been following the example in "2.4.6.2.3. Bidirectional association with indexed collections" but I still don't get any population of the index column, any suggestions would be appreciated:

Code:
@Entity
public class Parent {
   @Id
   @GeneratedValue
   private int parentId;

   @OneToMany(mappedBy = "parent", cascade = CascadeType.ALL)
   @Cascade(org.hibernate.annotations.CascadeType.DELETE_ORPHAN)
   @org.hibernate.annotations.IndexColumn(name = "childOrder")
   private List<Child> children = new ArrayList<Child>();
...
}


Code:
@Entity
public class Child {
   @Id
   @GeneratedValue
   private int id;

   private int childOrder;

   @ManyToOne
   @JoinColumn(name = "parentId", nullable = false)
   private Parent parent;
...
}


I can't see where I'm going wrong. The childOrder exists so mappedBy can be used on the parent side, right?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.