Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to add columns in ManyToMany Relation?

 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All..

Currently, iam still confused.. how to add Another columns in ManyToMany Relation...
now, iam just creating a Third Table and adding @ManyToOne Annotation..

assume that i have classes which related with Many To Many.. Say That One Major has Many Principles and Point Column addition, then One Principles has Many Majors and Point Column..

Here is the mappings between that classes : (in this instance i added third table which named PrincipleOfMajor)


is that relation true or not?..

Thanks in advance..
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, you have a one to many relationship to a class that has a one to many relationship with another, which means, the classes on the opposite sides of the relation, if we can speak that way, have a many to many relationship. So, it seems right to me, and in fact, that is a common way to address the issue of adding a property to the many to many join table when performing a many to many mapping in Hibernate and the Java Persistence API (JPA).

-Cameron McKenzie
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I really doubted about it before..
Yap.. i got it..

Thanks Cameron..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic