-->
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: Null DiscriminatorColumns in Database table
PostPosted: Sat Sep 06, 2014 11:07 pm 
Newbie

Joined: Sat Sep 06, 2014 10:52 pm
Posts: 1
I have a three level inheritance(A, B and C) with 2 children(C1 and C2) extending the second level parent class(B)
given that each entity has specific table for each of them in the data model,


Code:
@Entity
@Table(name="A")
@Inheritance(strategy=InheritanceType.JOINED)
@DiscriminatorColumn(name="A_DISCRIMINATOR_COLUMN")
public abstract class A {}

@Entity
@Table(name="B")
@DiscriminatorValue(“B_type”)
@DisriminatorColumn(“B_DISCRIMINATOR_COLUMN”)
@PrimaryKeyJoinColum("b_id")
public abstract class B extends A {}

@Entity
@Tabe(name = “C1”)
@DiscriminatorValue(“C_1_type”)
@PrimaryKeyJoinColum("c_1_id")
public class C1 extends B {}

@Entity
@Tabe(name = “C2”)
@DiscriminatorValue(“C_2_type”)
@PrimaryKeyJoinColum("c_2_id")
public class C2 extends B {}


I cannot map my discriminator values using this kind of inheritance strategy, the discriminator values of the children(C1 and C2) are the values being mapped into the Grand-parent (A)'s Discriminator Column and the Parent (B)'s Discriminator column is having a null value. what could be the solution or any approach I can do to make this kind of strategy possible?


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.