5 Replies Latest reply on Mar 28, 2007 1:32 PM by paata lominadze

    InheritanceType JOINED stategy problem

    paata lominadze Master

      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 :

      @Table(name = "PAYMENT_METHOD_DATA", schema = "CCARE")
      @Inheritance(strategy = InheritanceType.JOINED)
      @DiscriminatorColumn(name = "METHOD_DATA_TYPE", discriminatorType = DiscriminatorType.STRING)
      public abstract class PaymentMethodData implements Serializable {

      then fiers child looks like :

      @Table(name = "BANK_TRNSF_METHOD_INFO", schema = "CCARE")
      public class BankTrnsfMethodInfo extends PaymentMethodData implements
       Serializable {

      second child :
      @Table(name = "SCRATCH_METHOD_INFO", schema = "CCARE")
      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 ?