Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubt in JPA mapping

Pedro Lobato Sena
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
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!