hi,
I wanna mapping interface to hbm.xml file. (sorry I i repeat this post, i really find not answer)
I had a interface Payment, which class CreditCard and class Cash is implements.
my code mapping file like this
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping >
<class name="Payment" abstract="true">
<id name="id" column="id" >
<generator class="native"/>
</id>
<discriminator column="Payment_type" type="string"/>
<subclass
name="CreditCardPayment" discriminator-value="CreditCard">
<property name="number" />
<property name="amount" />
<property name="expireDate" />
<property name="BankCode" />
<property name="creditCardType" />
</subclass>
<subclass
name="CashPayment" discriminator-value="Cash">
<property name="amount" />
</subclass>
</class>
</hibernate-mapping>
but it give an exception : field [id] not found on Payment
after many search on google, still canot find a answer/solution.
my question is :
1) can hibernate mapping interface directly ?
2) since interface can't cannot instantiate, hence no [id] can declare in interface, I wondering can we make the [id] exclusive withouth setter and getter in interface Payment ?
any idea ?
kiwi