-->
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.  [ 4 posts ] 
Author Message
 Post subject: null index column for collection
PostPosted: Tue Sep 09, 2003 7:35 pm 
Newbie

Joined: Tue Sep 02, 2003 8:57 pm
Posts: 5
I keep getting this problem with my collections. Hibernate (2.0.3) saves them with the index value null, and then gets very upset when it tries to load them in the future. How could this happen? I'm not doing anything weird, I don't think. They are lists. Here is an example of the mapping:

Code:
       <list
            name="associations"
            lazy="true"
            inverse="false"
            cascade="all"
        >

              <key
                  column="key"
              />

              <index
                  column="idx"
              />

              <one-to-many
                  class="com.foo.Whatever"
              />
        </list>


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 09, 2003 9:59 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
If you set inverse="true", the collection does not propagate its own state to the database. So, if you have an index column that is not mapped anywhere else, it will not be updated.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 10, 2003 9:25 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
hold on: my answer is only correct if inverse="true".


Are you *sure* you don't have inverse="true"??


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 10, 2003 1:51 pm 
Newbie

Joined: Tue Sep 02, 2003 8:57 pm
Posts: 5
Yeah I think it did say "true", I had been switching it.


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

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.