There are 2 tables in database and 2 entities according them. I make them easier.
Table 1 and entity:
Table 2 and entity:
Then I make 2 objects. First of the first entity, second of the second entity. Then set second object into first and persist first entity. In result first table fill in correctly, but in the second table appiars a problem. Field Table1Id contains null, but not id of the first entity. Why is it so? What can be the problem of this and how can I solve my problem?