Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

eclipselink jpa association table mysql autoincrement problem

user10373232May 11 2012 — edited May 14 2012
Hi,
I have problem inserting a record in the following scenario using Netbeans7.1-EclipseLink-Mysql
I have 3 tables:

A
B
A_B

the id Autogenerated primary key in A and B are autoincrement primary key on mysql db and the primary key on the A_B table has given by the A.I and B.Id fields.

The reverted generated entity classes are 4:

AEntity
BEntity
A_BEntity
A_BEntityPK

all with the relatives annotation.....@ManyToOne etc etc

I have tried to persist an AEntity Object Or a A_BEntityObject but I have always the same problem:

The A_BEntityPK object is not inizialized.If I initialize it a new Constructor It loss the integrity with A.PK and B.PK and goes in intergrity violation.It seems like it can retrieve the autogerated A.Pk and B.Pk to populate the A_B.PK Object.

Any ideas?

thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 11 2012
Added on May 11 2012
5 comments
593 views