-->
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: What is the Hibernate dev team standpoint on nulls in lists,
PostPosted: Tue Nov 29, 2005 7:25 am 
Newbie

Joined: Wed Nov 16, 2005 10:15 am
Posts: 7
I have seen two threads about null elements in lists on Hibernate forum, so I will describe my problem as shortly as possible - in a one-to-many relationship I use a List because I want ordrering. When I delete any element other than the last, null is inserted instead of the element with the missing index (as opposed to other users who reported exactly the last removed object being substituted with null). Say there were entities with indices 1, 2 and 3, and then I delete the one with index "2" - I get element "1", null, "3" in the list, and the size() method returns 3. This is not what I have in the DB, so because of the inconsistency, I'm assuming an incorrect behaviour.

Since I only started using Hibernate from v 3.0.5, I really can't say if such behaviour was present in v2 or not, but there is a similar post on this forum -
http://forum.hibernate.org/viewtopic.php?t=942712
where a user claims there is no such behaviour in v2.1.8, and Gavin says that particular change in behaviour is a bug if that is really the case.

Now, I really don't wanna be one of those people screaming "Bug!" where there is none, but since Gavin "opened the door", I would respectfully like to ask if the Hibernate development team considers this a bug or not.

My point is, Gavin says it might be a bug, but I didn't find this in the changelogs for fixed bugs for neither of the versions 3.1 rc1, 3.1 rc2, 3.1 rc3. I admit not going through the whole of the JIRA to see if there is an open issue dealing with the described problem.

If this is considered a bug, any idea which HHH release might contain a fix?

Anyone from Hibernate team care to answer?

TIA

Alex


Top
 Profile  
 
 Post subject: Re: What is the Hibernate dev team standpoint on nulls in li
PostPosted: Tue Nov 29, 2005 7:50 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
ajovanic wrote:
entities with indices 1, 2 and 3, and then I delete the one with index "2" - I get element "1", null, "3" in the list, and the size() method returns 3.

This is what is expected from a java.util.List contract and from an indexed collection.
If you want an ordered collection, consider either order-by= or a comparator

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 29, 2005 7:58 am 
Newbie

Joined: Wed Nov 16, 2005 10:15 am
Posts: 7
Thanks, Emmanuel.


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.