-->
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: Mapping generic classes
PostPosted: Wed Mar 18, 2009 6:19 pm 
Beginner
Beginner

Joined: Tue Sep 14, 2004 1:03 pm
Posts: 33
Location: Calgary, Alberta Canada
How does one create a mapping file for a generic class in nhibernate. Say
Code:
I have a class Foo How would it look in the mapping document?
class name="mydll.Foo ???? , mydll" ...


I know if it was a Foo it would be:
Code:
class name="mydll.Foo`1[[mydll.Fee, mydll]], mydll"

Would it be something like:
Code:
class name="mydll.Foo`1[[mydll.Fee, mydll],[mydll.Fi, mydll]], mydll"

(I tried this, but it didn't work.)

a little explanation on the `1 and [[ would be helpful


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 23, 2009 10:52 am 
Beginner
Beginner

Joined: Tue Sep 14, 2004 1:03 pm
Posts: 33
Location: Calgary, Alberta Canada
The correct mapping would be
Code:
class name="mydll.Foo`2[[mydll.Fee, mydll],[mydll.Fi, mydll]], mydll"


The ` must denote a generic class (the <> brackets)
The 2 would notify of the number of generic parameters (in this case 2)
The [ are for wrapping of the class definitions as we need the fully qualified namespace and the dll


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.