If you tell OpenJPA that a foreign key relationship exists between the instances, then OpenJPA should automatically flush them in the appropriate order.
If the one instance needs to be flushed even before IDs are assigned to the second, you'll probably have to call em.flush() after calling persist() on the first instance. -Patrick On Jan 30, 2008 11:40 AM, Miroslav Nachev <[EMAIL PROTECTED]> wrote: > I do that using native JDBC/SQL statement instead to use JPA techniques. Is > that correct? > > > Miro. > > > On 1/30/08, Miroslav Nachev <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I have custom JDBCSequence implementation where before to return the > > generated Id I would like to persists one object which is required > > (Foreign Key constrain) from the main object which will use the returned > > Id from nextInternal() method. > > > > How can I persists that object in the same transaction before the main > > object to be persisted? > > > > > > Regards, > > Miro. > > > -- Patrick Linskey 202 669 5907
