-->
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: UserType and CompositeUserType as <id>
PostPosted: Thu Aug 19, 2004 6:14 am 
Beginner
Beginner

Joined: Thu Aug 19, 2004 5:36 am
Posts: 30
Location: Italy
Hibernate version: 2.1.6

I need to create a custom type to use in <id> tag.
This type, at the moment, should be only a wrapper of a String in UpperCase format. May be, in the future, it could be something different; for example (String, Integer) or (String, String), etc.

I think the right way to implement this is to create a custom type implementing UserType (or CompositeUserType).

Am I on the right way?


Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 20, 2004 10:54 am 
Expert
Expert

Joined: Thu Jan 29, 2004 2:31 am
Posts: 362
Location: Switzerland, Bern
Yes you are.

Note, that your have to use assigned id's. This means if you want to use cascading relations, that you have to implement an Interceptor.isUnsaved method. (see http://forum.hibernate.org/viewtopic.php?t=933521)

HTH
Ernst


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 20, 2004 11:13 am 
Beginner
Beginner

Joined: Thu Aug 19, 2004 5:36 am
Posts: 30
Location: Italy
ernst_pluess wrote:
Yes you are.

Note, that your have to use assigned id's. This means if you want to use cascading relations, that you have to implement an Interceptor.isUnsaved method. (see http://forum.hibernate.org/viewtopic.php?t=933521)

HTH
Ernst


Thank you very much, Ernst.
I need this approach only for a small number of tables that are not involved in cascading relationship.
But, in order to complicate things, I'll need to use this custom type as <id>.
So... I've another post for you...

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

Thank you in advance

Delta


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.