This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin 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
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!