Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPA One to Many Uni - Many side without PK

 
Chaminda Amarasinghe
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

I have 2 tables as follows.

Employee
-----
id (pk)
name

Address
-----
emp_id (fk to employee)
street

Note that
Employee can have multiple addresses.
address does not have id (pk) field so as per my understanding address can not be marked as entity.

Questions
What is the right annotation for Address,
What is the right annotation for Set<Address> addresses field in Employee classes.

Thanks in advanced.
Chaminda
 
Chaminda Amarasinghe
Ranch Hand
Posts: 413
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic