-->
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: Why can I not use an enum as Discriminator type?
PostPosted: Wed Oct 03, 2007 9:13 am 
Beginner
Beginner

Joined: Thu Oct 26, 2006 4:45 am
Posts: 39
I've been trying to use an enum as the Discriminator type, but than I get this error:

<enum> is not a valid discriminator type.

Anybody know why this makes sense?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 04, 2007 12:07 am 
Expert
Expert

Joined: Fri May 13, 2005 11:13 am
Posts: 292
Location: Rochester, NY
Because discriminator values aren't visible to the object side of the architecture. What the database knows as the discriminator value is translated to the object side as the class of the object. It doesn't make sense to define the discriminator as an enum, because there would be no use for it. So, going to the trouble of translating a string in the mapping to the associated enum value then numeric value for the DB was probably just left out.


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.