-->
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.  [ 1 post ] 
Author Message
 Post subject: Nested CompositeUserType as id?
PostPosted: Wed Feb 02, 2005 10:05 pm 
Newbie

Joined: Thu Jan 06, 2005 4:25 pm
Posts: 12
Location: Redwood City, CA
Hi,

I have a table where the primary key is three columns. In Java, the primary key object has two properties: a Long, and an object which in turn has another Long and an Integer as properties.

I'm confused as to how to map this in Hibernate. I tried creating a UserType for all three fields, but I wasn't able to create a valid mapping.

I think that what I need to do is create two CompositeUserTypes, one for the smaller object and another that includes the smaller object.

Is this possible in Hibernate? Can one of the fields of a CompositeUserType be another CompositeUserType? How do I represent this?

Assuming I can pull it off, can I use the whole thing as an id?

Is there a better way to handle this situation?

Obviously I could expose all the properties of the nested object as properties of the primary key object, but that seems inelegant.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.