-->
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.  [ 3 posts ] 
Author Message
 Post subject: List comes back with a size 100 even though only 1 exists
PostPosted: Wed Mar 23, 2005 3:12 pm 
Beginner
Beginner

Joined: Mon Jan 24, 2005 6:42 pm
Posts: 26
Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:2.1.7

Mapping documents:
<list name="products" lazy="true" inverse="true" cascade="all-delete-orphan" table="RELEASE_PRODUCT"
<key column="RELEASE_ID"/>
<index column="ORDERING_NUMBER"/>
<one-to-many class="ReleaseProduct"/>
</list>

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

I have a lazy loaded list that is loaded, size indicated 100 even though there is only 1 row in the returned list and SQL returns correctly 1 element when run independently.

Any comments, similar behavior would be helpful.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 23, 2005 4:04 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Remove the table="RELEASE_PRODUCT" attribute from your list element. It's not needed, and might be causing problems.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 23, 2005 5:20 pm 
Beginner
Beginner

Joined: Mon Jan 24, 2005 6:42 pm
Posts: 26
Thanks for your response Steve. I think I figured out the issue, i am using a list which by definition is an ordered collection. My object has an ORDERING_NUMBER used as an index which has a value of 99 in the database. Hibernate creates a List (defined as an ArrayList) with 100 elements with my object being element 99. Hence 100 element collection.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.