hello,
is it possible to define a joined subclass that has
subclasses ? i have tried, but i get a the following error:
org.xml.sax.SAXParseException: Element "class"
does not allow "joined-subclass" here.
here the
structure:
<class
name="Transaction">
<id
name="id"column="id" type="java.lang.Long" unsaved-value="null">
<generator class="hilo"></generator>
</id>
<discriminator
column="transactionType" type="string"/>
<property name="billedAmount" type="java.math.BigDecimal" column="billedAmount" length="8" not-null="true">
<many-to-one
name="order" class="Order" column="orderId" not-null="true"/>
<many-to-one
name="payee" class="BusinessEntity" column="payee" not-null="true"/>
<many-to-one
name="reciever" class="BusinessEntity" column="reciever" not-null="true"/>
<property name="transactionType" type="java.lang.String" column="transactionType" length="10" not-null="true"/>
<subclass name="com.squirrel.model.order.CashTransaction"
discriminator-value="cash">
</subclass>
<subclass name="com.squirrel.model.order.ChequeTransaction"
discriminator-value="cheque">
<property name="bank"type="java.lang.String" column="bank" length="30"/>
</subclass>
<joined-subclass
name="com.squirrel.model.order.CardTransaction">
<key column="id"/>
<property name="approvalCode"type="java.lang.String" length="30" />
<property name="cardHolderName"
type="java.lang.String" length="50" not-null="true"/>
<property name="cardNumber"
type="java.lang.String" length="30"/>
<property name="cardType" type="java.lang.String" length="30"/>
<property name="expireyDate"
type="java.lang.String" length="5"/>
</joined-subclass>
</class>
I was also wondering if the feature could be added
so that you could define a descriminator value with a joined subclass. this
would remove the need for me to code this myself and provide the property in the
class definition. This would be useful as i am working with web developers who
are not using hibernate.
thanks for any feedback
cam
|
- Re: [Hibernate] joined subclasses with subclasses Cameron Jones