• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

One2One Uni-directional Problem

 
S Subbu
Ranch Hand
Posts: 87
jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi , I am Using JPA Annotation .

My Problem is i associate One2One Uni - directional Relation. My Actual Problem is

In Table1




Insert Code




But When was insert Record , i got exception like assign value to id in com.entity.Table2 before calling save()



I dont want to assign id value , it will get From Table1 Id value . What i have to do for this.


Thanks
 
Prabaharan Gopalan
Ranch Hand
Posts: 66
Java Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The id in Table2 is the primary key for table2. Unless you have a generation strategy specified for that Id, you'd have to manually set the id.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic