-->
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: Type safe enum - values stored in a separate table
PostPosted: Wed Oct 13, 2004 10:43 am 
Regular
Regular

Joined: Fri Sep 03, 2004 2:01 pm
Posts: 51
Hibernate version2.1.6:

For constraints reasons, we often store type safe enum values in a separate table A_enum for example.

In Java, I have create a type safe enum class, along with its associated Hibernate user type.

In MyEnum.hbm.xml I've set the following:

<id name="value" type="myEnumUserType">
<generator class="assigned"/>
</id>

However, when Hibernate loads the data in, it seems to be trying to set the 'value" property directly and not use the user type class to do it.

Is this a limitation of <id> and user types, or is there a better way to do this?

Nick


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 13, 2004 11:48 am 
Regular
Regular

Joined: Fri Sep 03, 2004 2:01 pm
Posts: 51
...without using an Interceptor.


From the looks of the steps that Hibernate goes through when its hydrating objects, it doesnt look like <id> types can be anything other than basic types - the nullSafeGet() / nullSafeSet() seem to be bypassed - am I correct in this?

Nick


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.