-->
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: id element in hibernate
PostPosted: Fri Oct 29, 2004 12:39 am 
Beginner
Beginner

Joined: Thu Oct 14, 2004 10:53 pm
Posts: 45
question.

is it possible to specify an identifier with a custom type, as opposed to the normal types supplied by hibernate, e.g. int, string??

In one of my POJO classes, I have a primary key field that has a custom type called "Identifier". Inside this Identifier object I have other types, such as digit, code, etc. I am wondering whether this Identifier type can be incorporated in my id element in the hibernate mapping file? Can this be supported, or am I restricted to only the supplied hibernate types?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 29, 2004 1:45 am 
Expert
Expert

Joined: Tue Oct 05, 2004 9:45 am
Posts: 263
yes, you can use your own type for an <id> in hibernate ... you can set your type using the 'type'-attribute of the <id>-tag ...

But as far as my tests have shown, it's not enough to implement only the "UserType"-interface. For the proper Interface take a look in the existing Hibernate-Types and take the same ... or extend an existing hibernate-type.

gtx
curio


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.