Hi,
I am trying to use composite-id for a table, customer.
customer.hbm file is :
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping>
<class name="com.specsavers.mis.businesstype.Customer" table="customer" lazy="false">
<meta attribute="extends" inherit="false">MISPlatoTransferVO</meta>
[b]<composite-id>
<key-property name="contactlenseschemeid" type="java.lang.String" column="contactlenseschemeid" />
<key-property name="firstName" type="java.lang.String" column="firstname" length="25" />
</composite-id>[/b]
<property name="lastName" type="java.lang.String" column="lastname" length="25" />
</class>
</hibernate-mapping>
BUT I am able to save two customer records having the same contactlenseschemeid and firstName.
KIndly help to locate the problem.
cheers
|