Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] JPA OneToOne with Primary Key FK Question

I'm having a hard time with a OneToOne with a Primary Key as Foriegn
Key relationship.

The secondary table is not getting the PK set, it's going in as null,
instead of grabbing

Here's the EO's.

Account and AccountDetails

They both share account_id as PK's.

I set the relationships on both sides and persist the account object,
the insert on the account_details fails with a null account_id.

public class Accounts extends CreatedByModifiedByBaseEntity implements
Serializable {
	private Long accountId;

	private AccountDetails accountDetails;

public class AccountDetails extends ModifiedByBaseEntity implements
Serializable {
	private Long accountId2;

	private Accounts accountId;


Back to the top