-->
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: indexed collection
PostPosted: Sun Mar 19, 2006 5:55 am 
Newbie

Joined: Tue Mar 14, 2006 10:10 am
Posts: 3
I created a list and defined an index column (I read that it is mandatory to define an index for a list):

<list name="fields" lazy="false" fetch="subselect" cascade="all,delete-orphan">
<key column="LIST_ID"/>
<index column="INDEX" type="long"/>
<one-to-many class="Field"/>
</list>

In the Field class, I set values in the 'index' property. However, I can see that these values are overridden.
Is there a way to manage the index independently - that Hibernate will not override the property?


Top
 Profile  
 
 Post subject: Re: indexed collection
PostPosted: Sun Mar 19, 2006 12:56 pm 
Beginner
Beginner

Joined: Fri Mar 17, 2006 7:30 pm
Posts: 32
sivans wrote:
I created a list and defined an index column (I read that it is mandatory to define an index for a list):

<list name="fields" lazy="false" fetch="subselect" cascade="all,delete-orphan">
<key column="LIST_ID"/>
<index column="INDEX" type="long"/>
<one-to-many class="Field"/>
</list>

In the Field class, I set values in the 'index' property. However, I can see that these values are overridden.
Is there a way to manage the index independently - that Hibernate will not override the property?


In the definition of the Field object mapping, is the index type set to assigned?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 19, 2006 1:59 pm 
Newbie

Joined: Tue Mar 14, 2006 10:10 am
Posts: 3
It is set only as a property:

<property name="index" type="long" column="INDEX" insert="false" update="false"/>


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 19, 2006 6:16 pm 
Beginner
Beginner

Joined: Fri Mar 17, 2006 7:30 pm
Posts: 32
sivans wrote:
It is set only as a property:

<property name="index" type="long" column="INDEX" insert="false" update="false"/>


In the mapping for the Field object, do you have something like this?

<class name="Field" table="Field_table">
<id name="index" type="long" column="INDEX">
<generator class="assigned"/>
</id>
</class>

I ask because previously you had stated you were assigning a value to the index for the FIeld object.


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.