-->
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.  [ 2 posts ] 
Author Message
 Post subject: NHibernate and Generics
PostPosted: Tue Feb 06, 2007 3:09 pm 
Newbie

Joined: Sun Jun 19, 2005 12:34 pm
Posts: 6
Hi!

I am starting off a new project based upon NHibernate 1.2.0 and Spring.
A couple of months ago I prototyped a solution using Ayendes NHibernate.Generics...since then NHibernate has evolved and now includes support for generics.

Does anyone know where I can find information (pros/cons) about Nhibernates "native" generic support and possibly with a few quick samples!?

Regards


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 07, 2007 12:21 am 
Senior
Senior

Joined: Mon Aug 21, 2006 9:18 am
Posts: 179
There isn't much difference really with the generic or non-generic collections. Last I checked unit tests weren't very elaborate for handling generics either.

A few pointers though:
    1) Remember that you use the mangled name in the mapping files...so something like this <class name="Thing`1[System.Int32]" .../> I think this is different than Spring with the kooky syntax in their xml files.
    2) You don't need to specify "generic=true" for collections in your mapping files.
    3) Understand that HQL has some issues in regard to generics perhaps requiring you to work with closed generic types as workarounds. Mostly it'll be rare cases you hit this one but I have a few times. Not a showstopper tho.
    4) Know this limitation too at http://forum.hibernate.org/viewtopic.php?t=970568

_________________
If this helped...please remember to rate it!


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