Hibernate 3.05. I saw nothing relevant in the FAQ or the manual, but I may not know the proper terminology to use to find what I need.
I have a table called ORDER and have successfully mapped it to a simple existing Java class.
Within the ORDER table are a number of fields related to a CUSTOMER, e.g.:
ORDER.CUST_FIRST_NAME
ORDER.CUST_LAST_NAME
...
I have an existing Customer class with appropriate fields to contain this data, contained inside the Order object:
Code:
class Order
{
private int OrderId;
private Customer customer;
...
}
How do I describe this mapping to Hibernate? I want to be able to fetch an order and access the embedded customer information by saying:
Code:
...
Customer cust = order.getCustomer();
...
order.update(); // Saves all ORDER fields, including the CUST fields if they've been modified
Thanks!
John