Hello,
My use case is as follows: I use MySQL and JPA 2 and I have two entities: Order and LineItem that are associated by a OneToMany relationship.
I would like for the GUI layer to persist the Order together with the LineItems at the same time (using the Order PK).
Bearing in mind that the PK of Order is auto-generated by MySQL and is part of the PK of LineItem, I don't know how to retrieve the generated Order PK in order to use it for the LineItem PK within the same transaction.
Is there any special JPA configuration I could use to achieve this?
Can anyone help please?
|