I have 2 tables, Order and OrderItem, which have a 1-many relationship.
When I am adding a new order at the front end, how to I create the relationship. E.g.
(Order and OrderItem generated by SubSonic).
Order order = new Order();
//populate order details.
OrderItem item = new OrderItem();
//populate orderItem details.
How do I then set the relationship so that when I save them to the database they will store the correct foreign key values, something along the lines of
item.setParent(order);
EDIT:
I tried using
order.OrderItemRecords().Add(item);
but still getting error when I update DB.