I have mapping like -
User has many Order
Order has many OrderItem
OrderItem has one Address.
When a user make order - I have to save User, Order, OrderItem, Address in database.
In my DAO, I am saving record for Order as
I have to further save Orderitem and Addresses. Please guide me how do I do save records in OrderItem ? First, should I get id from Order which is just created and then save that in OrderItems. Then get Id for OderItem when it is saved in database and then save Address, etc for that orderitem. Please help.