[jboss-user] [EJB 3.0] - InheritanceType JOINED stategy problem

grdzeli_kaci do-not-reply at jboss.com
Wed Mar 14 02:25:21 EDT 2007


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 :

  | @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 :


  | @Entity()
  | @Table(name = "BANK_TRNSF_METHOD_INFO", schema = "CCARE")
  | @DiscriminatorValue("BankTransfer_MethodData")
  | public class BankTrnsfMethodInfo extends PaymentMethodData implements
  | 		Serializable {
  | }
  | 
second child :

  | @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

can anybody help me ?

Regards,
Paata.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4027823#4027823

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4027823



More information about the jboss-user mailing list