-->
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: Generalization with Hibernate
PostPosted: Fri Jan 28, 2011 9:43 am 
Newbie

Joined: Sat Jun 09, 2007 12:29 pm
Posts: 19
Hi,

I'm having a following case:

Class A @Inheritance(strategy=InheritanceType.JOINED)
|
Class B @Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "type", discriminatorType=DiscriminatorType.STRING)
@DiscriminatorValue("a")
|
Class C @DiscriminatorValue("b")

I have Class A where I have general entity attributes like uuid, creationDate, updateDate, owner ....
The Class B extends Class A with a @Inheritance(strategy=InheritanceType.JOINED), so I have both classes in their own tables.
Now I need Class C which extends Class B, but has @Inheritance(strategy=InheritanceType.SINGLE_TABLE) stategy.

When I use this composition, the attributes of the Class C are not created. I've heard, that there shouldn0t be strategy mixing, but I realy need this case. Is there anything I can use?

Best regards,
Bojan

_________________
http://www.objectverse.com
http://www.alcyone.si
http://blog.alcyone.si


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.