Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

[ASK] designing an entity in hibernate  RSS feed

Kevin Liauw
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Consider the following table

1. User : id(Primary key)

2. Site : id(Primary key)

3. Role : id(Primary key)

each User can have different Role in the different Site , so i have created another table

user_role_site : user_id, role_id, site_id(Composite primary key)

The problem is :

If it's for two table ( for example : users_sites : user_id,site_id(Composite primary key) ) i can create an annotation in the entity like

But i'm dunno how to create an annotation for facilitates 3 table , please can anyone could share me an hints or another approach to solve this problem

Thanks and regards

I'm sorry if there is similiar threads before
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!