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.  [ 7 posts ] 
Author Message
 Post subject: List element sets null values
PostPosted: Fri Feb 10, 2006 4:25 am 
Beginner
Beginner

Joined: Wed Jan 25, 2006 10:16 am
Posts: 44
Location: Bangalore
Hi,

Consider this. When I do getChildren fron a parent object as a List, index column as "sequence" I get the List with null elements. is there any way to prevent this.

Say,
I have 3 children with sequence values 2, 4 and 5.

I get a List as [null,null,Child@3e323,null,Child@3e333,Child@3gf3e3].

Can I prevent this while loading the List?

_________________
Please vote if my Postings helps. :-)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 10, 2006 5:20 am 
Beginner
Beginner

Joined: Wed Jan 25, 2006 10:16 am
Posts: 44
Location: Bangalore
When I use a bag, it works well.
But can I achieve the same using a List.
:-)

_________________
Please vote if my Postings helps. :-)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 10, 2006 7:54 am 
Beginner
Beginner

Joined: Thu Oct 27, 2005 11:53 am
Posts: 42
you probably have to set the index column of the list descriptor


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 10, 2006 7:56 am 
Beginner
Beginner

Joined: Wed Jan 25, 2006 10:16 am
Posts: 44
Location: Bangalore
Hey check my post again.
I indeed set my index column.
Still I don't know how to avoid the nulls. :-(

_________________
Please vote if my Postings helps. :-)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 10, 2006 10:50 am 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
if there are any entries in your database with any null value in a primary key field a null entry will be added to the list

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 10, 2006 6:28 am 
Beginner
Beginner

Joined: Wed Apr 05, 2006 3:19 pm
Posts: 43
^^bump

I'm having the same problem. Anyone with a solution?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 10, 2006 4:14 pm 
Beginner
Beginner

Joined: Wed Apr 05, 2006 3:19 pm
Posts: 43
kochcp wrote:
if there are any entries in your database with any null value in a primary key field a null entry will be added to the list


There are actually no entries with null values in the database. The sequence of the primary key is just not a sequence. It's like this:

Code:
1
3
4
5
12
13
14


The the list looks like this:
Code:
0 - null
1 - item
2 - null
3 - item
4 -.....


Is there a way to "not add" the null values?


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