aspose file tools*
The moose likes Object Relational Mapping and the fly likes Hibernate Collections - have lots of null elements aswell as my objects Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate Collections - have lots of null elements aswell as my objects" Watch "Hibernate Collections - have lots of null elements aswell as my objects" New topic
Author

Hibernate Collections - have lots of null elements aswell as my objects

Ally Cavs
Ranch Hand

Joined: Aug 25, 2008
Posts: 89
Hi Here is my XML



What i get in return when I do a query is a collection of 300 elements. 298 of the elementds are null
While 2 of them are instances of my UploadedFile. These 2 instances are correct. But they are in the middle of all the nulls (elemets 248 and 249)

But due to how my system works id like to be able to not have all the null elements. Is there a way of eliminating these null elements?

I know Hibernate has its own implementation of collections but having all the null elements is terribly
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

What happens if you change your collection to "set" instead of "list "

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Ally Cavs
Ranch Hand

Joined: Aug 25, 2008
Posts: 89
My problem is bad data with the list_index column. the columns arent in sequential order
Thanks anyway Mark
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate Collections - have lots of null elements aswell as my objects