-->
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: IUserType as meta-type in <any> mapping?
PostPosted: Mon Apr 10, 2006 10:59 am 
Expert
Expert

Joined: Tue Aug 23, 2005 5:52 am
Posts: 335
I recently read in the NHibernate documentation...

Quote:
In this case, a polymorphic association to IPayment is mapped using <any>.

<any name="Payment"
meta-type="class"
id-type="Int64">
<column name="PAYMENT_CLASS"/>
<column name="PAYMENT_ID"/>
</any>
It would be better if we defined an IUserType as the meta-type, to handle the mapping from type discriminator strings to IPayment subclass.


...but I can't find any literature on HOW to define the IUserType. Can anyone explain this in a little more detail?

Symon.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 10, 2006 12:54 pm 
Beginner
Beginner

Joined: Wed Oct 05, 2005 5:35 am
Posts: 47
Location: France
Hi Symon,
Very often when I read your posts it seems you are working on similar things I work on. And it seems you are in France too - if you wish we could get together somehow to exchange experineces. You can drop me a line on alex_public2006 at yahoo.com.
Alex


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 16, 2006 6:42 pm 
Expert
Expert

Joined: Tue Aug 23, 2005 5:52 am
Posts: 335
Can anyone help? The issue at hand is that I'm running into the problem described in the following thread, but I *still* haven't figured it out and all the replies I've seen on the subject have worked out to be a little cryptic and assume I have some knowledge which I patently seem to be mising:

http://forum.hibernate.org/viewtopic.php?t=952982

Is there anyone out there who can enlighten me on IUserType and how it can be implemented to solve the problem of persisting only the Type name rather than the fully qualified type name for <any> mappings as suggested in the documentation? Without this I have to manually enter the values into my mapping files which is truly nasty.

I figure this can't be *that* difficult to do, but I'm completely in the dark here.

Symon.


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.