项目作者: hemanthgit

项目描述 :
HIbernate Many To Many BiDirectional Mapping with Annotations
高级语言: Java
项目地址: git://github.com/hemanthgit/HibManyToMany_BiDirectional_App.git


HibManyToMany_BiDirectional_App

Only change in this relationship( ManyToMany Bidirectional) and ManyToMany Unidirectional is that, in the Subject class we have added following property.

@ManyToMany(mappedBy=”subjects”)
private List students = new ArrayList();

Nothing else changes.We added this property in Subject class to make the relationship bidirectional.
You can now navigate from Subject to Student.mappedBy attribute tells that this is the inverse side of relationship which is managed by “subjects”
property of Student annotated with @JoinColumn.