-->
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: Whats the difference between <array> and <list>
PostPosted: Tue Jan 16, 2007 4:20 pm 
Senior
Senior

Joined: Sat Mar 25, 2006 9:16 am
Posts: 150
???


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 16, 2007 7:19 pm 
Expert
Expert

Joined: Fri May 13, 2005 5:56 pm
Posts: 308
Location: Santa Barbara, California, USA
With regard to .NET they are the same type of collection:

Quote:
An array has a primary key consisting of the key columns + index column
A list has a primary key consisting of the key columns + index column


An Array actually implements List which implements Collection which actually instantiates an ArrayList. Within the mapping files however there are considerable differences in mapping params. Check nhibernate-mapping-2.0.xsd for reference.

hth,

-devon


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 16, 2007 8:01 pm 
Expert
Expert

Joined: Fri May 13, 2005 5:56 pm
Posts: 308
Location: Santa Barbara, California, USA
Sorry, This relates to NH 1.0.2.0. I am pretty sure this is similar in NH 1.2.0 but I have not checked the source.

-devon


Last edited by devonl on Tue Jan 16, 2007 8:15 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 16, 2007 8:13 pm 
Senior
Senior

Joined: Sat Mar 25, 2006 9:16 am
Posts: 150
I can check the XSD but it would be nice if there was more documentation on the collections and their typical uses.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 16, 2007 8:15 pm 
Expert
Expert

Joined: Fri May 13, 2005 5:56 pm
Posts: 308
Location: Santa Barbara, California, USA
heh-heh. I agree and sorry if my post seemed to leave you wanting. I can tell you that the Hibernate in Action book has helped me understand when to use certain colleciton types. Additionally the Hibernate documentation sometimes offers insights. Do you have a specifci quesiton in mind? I might be able to give you my .02.

-devon


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 16, 2007 9:31 pm 
Senior
Senior

Joined: Sat Mar 25, 2006 9:16 am
Posts: 150
Hmm, well I checked the XSD and it looks like they are identical except that the list supports the standard set of collection attributes whereas the array has a smaller set of possible attributes. For example, "inverse" is not an attribute of array. Not sure what's up with that. I have never seen anyone using array and I'm not sure why anyone would.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 16, 2007 11:38 pm 
Expert
Expert

Joined: Fri May 13, 2005 5:56 pm
Posts: 308
Location: Santa Barbara, California, USA
I would agree with that. I don't use arrays myself and I suspect it is there to round out the support for all collection types. In fact, from the doco:

Quote:
Lists, maps, idbags and sets are the most efficient collections to update

and:

Quote:
Bags and lists are the most efficient inverse collections

I primarily use bags and lists myself.

-d


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.