Insert a record in 2 table bounded ontoone inJSF/JPA

Hello,

I am forced to ask for help / advice, I stopped on the following problem and I can not continue for a week - :frowning:
.
Current status code JSF / JPA:
2 entities = POJO class with fields corresponding to the form of writing from the web (Student) and a class representing the activation status of a given user in the system (UserActivation): below extracts without getters and setter fields defining and connecting master and foreign keys; attached MySQL schema for 2 tables in relation 1-1 and debugging dump from the Wfly console
throwing an exception:

"Can not add or update a child key: a foreign key constraint fails (paw_news``signatories_activation, CONSTRAINT signatories_activation_ibfk_1 FOREIGN KEY (id) REFERENCES signatories (id) ON UPDATE CASCADE) "

.
issue:
If the code saves data from the registration form to the ‘signatories’ table without any problems, it does not allow for parallel writing to the ‘signatories_activation’ table connected by the relation 1-1
.
Interestingly, if I delete the foreign key from the signatories_activation table in MYSQL, the code will save the data to two tables, except that
signatories_activation in the fields in the primary key and foreign set value
0
.
The record for the above scheme was carried out in a similar way as the Lord showed on the exercises: first to the table from the form via studentService and … Dao and then to the signatories_activation table through the studentService and … Dao.

Maybe somewhere in the JPA code you have to indicate that the generated value in the signatories.id field should be written in the field signatories_activation.id (I do not know how to do it, i did not practice such an example , i’ am rookie…:-))

Without seeing your code, it’s impossible to say what’s wrong.