1:1 Mapping with Bidirectional relationship.
590594Jul 30 2007 — edited Aug 7 2007We have two table Order & Order_Billing.
The primary key of the Order table is Order_Id which is also the foreign key of the Order_Billing table.
The primary key of the Order_Billing table is order_billing_id which is again the forign key in the order table.
All the primary keys are getting generated using oracle database sequence.
We want to persist the Object Order using TopLink which should automatically persist the OrderBilling object maintaining the bi-directional relationship.
As per our current design, we are having Order object which has the OrderBilling object as an attribute.
While saving the Order object TopLink is making an entry in the Order_Billing table for the OrderBilling object but the order_id is not getting populated in the Order_Billing table where as the order_billing_id is properly getting set in the order table.
Please suggest how to go for it.