About Peter comment MySQLIntegrityConstraintViolationException
I just look in the mysql script and I found the :
CREATE TABLE CEQACTION (
CONTROLLED_ACTION INT NOT NULL,
INFORMATION_ID INT NOT NULL,
PERSON_ID INT NOT NULL,
LOG_ID INT NOT NULL,
FOREIGN KEY (INFORMATION_ID) REFERENCES INFORMATION_CEQ (INFORMATION_ID),
FOREIGN KEY (PERSON_ID) REFERENCES PERSON_CEQ (PERSON_ID)
– FOREIGN KEY (LOG_ID) REFERENCES ACTION_DATA (ACTION_LOG_ID)
on my script is on the line 548
this script part builds a a table and sets a relation with other tables (INFORMATION_ID and PERSON_ID). This is perfect legal, but, the corresponding java model does not supports this relation. The next code snippet shows the CEQACTION properties.
@Column(name = "LOG_ID") private int nLogID;
@Column(name = "CONTROLLED_ACTION") private int nControledAction;
@Column(name = "INFORMATION_ID") private int nInfoID;
@Column(name = "PERSON_ID") private int nPersonID;
As si easy to see here - no relation is defined (none of the relation annotation is used). In my opinion this can cause the problem early described by Peter. More precisely, the ORM framework is responsible for the generating the primary key and the foreign key also- so the nInfoID and the nPersonID integer properties must be replaced with the proper relation. The actual implementation gets this responsibility from the ORM framework and replace it with its own code.
The solution can look like this :
For the moment I am not sure if the relation must be uni or bidirectional.
Because this can cause some side effects I will try to fix this in a separate branch. I also think that this problem is a different bug than one described in this JIRA report (424) and I will generate an other one.