Hello,
i decided to make use of the Table per subclass strategy and it works good for me.
I only have 1 problem: how can i map these classes to a property?
(the code below worked for "simple" mapped Object without inhetirance, after adding inhetirance, i get the error "Column 'paymentType_id' cannot be null" )
So my question is: how can i map the classes, as i far as i can see it should work this way.
Thank u very much, hard to explain this problem, hope the code below makes it clear.
Code:
<many-to-one name="paymentType" class="de.autotest24.bean.PaymentType" column="paymentType_id"/>
The mappingfile PaymentType.hbm.xml for the
Code:
<hibernate-mapping>
<class name="de.autotest24.bean.PaymentType" table="paymenttype">
<id name="paymentType_id" column="paymentType_id">
<generator class="native"/>
</id>
<property name="description"/>
<joined-subclass name="de.autotest24.bean.CreditCardPaymentType" table="creditcardpaymenttype">
<key column="paymentType_id"/>
<property name="validUntil"/>
<property name="creditCardNumber"/>
<property name="creditCardOwnerName"/>
</joined-subclass>
<joined-subclass name="de.autotest24.bean.BankCollectionPaymentType" table="bankcollectionpaymenttype">
<key column="paymentType_id"/>
<property name="bankIdentifierCode"/>
<property name="bankAccountNumber"/>
<property name="bankAccountOwner"/>
</joined-subclass>
</class>
</hibernate-mapping>