-->
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: Table per subclass using discriminator
PostPosted: Fri Aug 25, 2006 9:14 am 
Newbie

Joined: Fri Aug 25, 2006 9:02 am
Posts: 1
Is it possible to configure the following inheritance mapping for a table per subclass mapping with a discriminator value:
if discriminator=="Class1" instantiate Class1
if discriminator=="Class2" instantiate Class2
in all other cases instantiate Class3 (meaning that the discriminator column can contain any value except "Class1" or "Class2").

Best regards,
Andreas


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 25, 2006 9:53 am 
Beginner
Beginner

Joined: Wed Jan 25, 2006 10:18 am
Posts: 28
Yeah, you could use a discriminator formula for the hierarchy. Something like:

Code:
case
  when discriminator='Class1' then 'Class1'
  when discriminator='Class2' then 'Class2'
  else 'Class3'
end


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.