-->
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 Problem
PostPosted: Mon Oct 17, 2005 5:01 am 
Newbie

Joined: Mon Oct 17, 2005 4:48 am
Posts: 2
subject:Mapping

Hi!!

can someone please give me solution to this problem........

I have two tables;

1) User

2) Address with a one-to-many relation
(a User can have many addresses).


I declared a list in User mapping.
But when I call user.getAddressList(), the first element in the list
is always null.

For example, if I have 5 Address records, when I call
user.getAddressList(), I am getting a List of size=5. But the first
element in the list is null and the remaining 4 elements are valid
records.

thx & rgds,
sud


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 17, 2005 11:05 am 
Newbie

Joined: Mon Oct 17, 2005 10:59 am
Posts: 1
Hibernate version: 2.1.7

I got similar problem, except if there are 5 records, Hibernate returns 6, with first one is null, other 5 are valid records.

My hibernate mapping is like:
<list name="book" table="book_author" inverse="true">
<key column="author_id"/>
<index column="id"/>
<many-to-many class="Book" column="book_id"/>
</list>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 17, 2005 2:31 pm 
Regular
Regular

Joined: Mon Aug 29, 2005 9:46 am
Posts: 102
smarteck, can we see your mappings? Thanks.


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.