Hi all,
I have a question regarding the use of components as composite ids (as described in
Section 8.4 of the documentation) Does this approach suppose that the setter of the property containing an associated object also set the related property in the id component?
In other words, is this how it's supposed to work (see code below, using the example in the doc)?
Code:
public class OrderLineId {
...
public setLineId(int lineId){...}
public setOrderId(int orderId){...}
public setCustomerId(int customerId){...}
}
public class OrderLine {
...
public setId(OrderLineId id){...}
public setOrder(Order order){
this.order = order;
this.id.setOrderId(order.getId());
}
}
Or am I supposed to set those two properties separately every time i want to update the order property, even though the two properties essentially hold the same thing?
Thanks.
Eugene