-->
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.  [ 1 post ] 
Author Message
 Post subject: Two kind of inheritance (JOINED and SINGLE_TABLE)
PostPosted: Mon Apr 18, 2011 6:16 am 
Newbie

Joined: Mon Apr 18, 2011 6:02 am
Posts: 1
Hi All,

I tried to combined two kind of inheritance (JOINED and SINGLE_TABLE), but it doesn't work. It seems that "Discriminator" annotations are ignored. Look at the sample below :

Code:
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
Class A{
//code
}

@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "INSTRUMENT", discriminatorType = DiscriminatorType.STRING)
@DiscriminatorValue("All")
Class B extends A{
//code
}

@Entity
@DiscriminatorValue("FutureSpread")
Class C extends B{
//code
}


This example create 3 tables (A,B and C) instead of 2 (A and B) by using hibernate maven plugin (mvn hibernate3:hbm2ddl)
What do you think about this?

Thanks in advance.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.