-->
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: CompositeUserType for immutable w/o no arg constructor
PostPosted: Fri Oct 01, 2004 9:59 am 
Newbie

Joined: Fri Oct 01, 2004 9:45 am
Posts: 4
Hibernate version: 2.1.6

How can I implement CompositeUserType to allow me to map (two columns to a single instance) an existing class that must be instantiated with it's multiple argument constructor?

Thanks,
Michael


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 01, 2004 3:34 pm 
Expert
Expert

Joined: Thu Jan 29, 2004 2:31 am
Posts: 362
Location: Switzerland, Bern
Simply get the column values from the ResultSet in the nullSafeGet method and call your constructor with these values.

HTH
Ernst


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 01, 2004 4:32 pm 
Newbie

Joined: Fri Oct 01, 2004 9:45 am
Posts: 4
Great. This helps a great deal.


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.