I need help in finishing a hbm file for the following scenario:
Table: Customer
Columns: customer_id, customer_name, start_date and end_date
Primary key: customer_id, customer_name and start_date
public class Customer {
private String customerId;
private String customerName;
private DateRange dateRange;
}
public class DateRange {
private Date startDate;
private Date endDate;
}
HBM file:
<class name="Customer" table="Customer">
<composite-id>
<key-property name="customerId" column="customer_id"/>
<key-property name="customerName" column="customer_name"
</composite-id>
</class>
How do i specify start_date as part of the key?
|