• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPA reference OneToOne CascadeType problems

 
Sergey Deplake
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Sergey Deplake
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for help. Now everything work correct!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic