• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in JPA mapping

 
Pedro Lobato Sena
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

I have the following scenario:

Trip has two colums: traveler_id and requestor_id

Person has one column: idPerson

I need to map the Trip to have two instances of Person, one indicating who will be the responsable by the travel(traveler_id) and the another one indicating who requested the trip.

I tried to use two @ManyToOne, but got the message indicating that I should use insertable and updatable false for one of them, that is not what I want.

How should I map it ?

Thanks in advance,

Pedro Sena
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic