contact_naga wrote:
Hello,
I am running into exception when I use following one-to-many mapping using Hibernate. I need favor in this one-to-many mapping when the child has composite key in it.
My java classes are as follows:
public class Order
{
int orderId; //PK
Set orderLineItem;
......
}
public java OrderLineItem
{
int lineNo; //PK
int orderId; //PK
String desc;
......
}
In the OrderLineItem class lineNo and orderId will form the unique key.
My mapping file is as follows:
<hibernate-mapping>
<class
name="com.cpships.nsd.booking.domain.Booking" table="BOOKING">
<id name="bookingNumber" type="int" unsaved-value="null">
<column name="BKNG_NUM" sql-type="number(10)" not-null="true"/>
<generator class="increment"></generator>
</id>
PLEASE IGNORE THIS QUESTION AND refer to the new post
"Failed to save child object in one-to-many". Sorry for the inconvenience.