-->
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.  [ 3 posts ] 
Author Message
 Post subject: InheritanceType JOINED stategy problem
PostPosted: Wed Mar 14, 2007 3:30 am 
Beginner
Beginner

Joined: Tue Jan 17, 2006 6:16 am
Posts: 31
hi all,
i have 3 table into database
Root Table : PAYMENT_METHOD_DATA
Child Table : BANK_TRNSF_METHOD_INFO
Child Table : SCRATCH_METHOD_INFO

in java i have inheritance joined strategy, then root class loojks like this :
Code:
@Entity()
@Table(name = "PAYMENT_METHOD_DATA", schema = "CCARE")
@Inheritance(strategy = InheritanceType.JOINED)
@DiscriminatorColumn(name = "METHOD_DATA_TYPE", discriminatorType = DiscriminatorType.STRING)
@DiscriminatorValue("Base_MethodData")
public abstract class PaymentMethodData implements Serializable {
}






then fiers child looks like :
Code:
@Entity()
@Table(name = "BANK_TRNSF_METHOD_INFO", schema = "CCARE")
@DiscriminatorValue("BankTransfer_MethodData")
public class BankTrnsfMethodInfo extends PaymentMethodData implements
      Serializable {
}



second child :
Code:
@Entity()
@Table(name = "SCRATCH_METHOD_INFO", schema = "CCARE")
@DiscriminatorValue("Scratch_methodData")
public class ScratchMethodInfo extends PaymentMethodData implements
      Serializable {
}



when i persist BankTrnsfMethodInfo entity object,
automatically persisted also PaymentMethodData, but into PAYMENT_METHOD_DATA column METHOD_DATA_TYPE value is NULL. i don't understand what heppened

I NEED PARRENT-CHILDS STRATEGY, is the JOINED strategy for this task ?

can anybody help me ?

Regards,
Paata.


Top
 Profile  
 
 Post subject: Re: InheritanceType JOINED stategy problem
PostPosted: Wed Mar 14, 2007 11:53 pm 
Beginner
Beginner

Joined: Tue Jan 17, 2006 6:16 am
Posts: 31
is anybody knows about this problem ?


Top
 Profile  
 
 Post subject: Re: InheritanceType JOINED stategy problem
PostPosted: Mon Mar 19, 2007 1:07 am 
Beginner
Beginner

Joined: Tue Jan 17, 2006 6:16 am
Posts: 31
i can't resolve this problem yet, could anybody help me ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.