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.