I want to create a <many-to-many> relation mapping between 2 classes by using “Hibernate reverse engineering” thru MyEclipse 7.0 but I am not getting what should be the foreign key relationship between 2 database tables??I included Foreign Key in both tables but the generated POJO files are like this and also in mapping files <many-to-many> tag is not used instead <one-to-many>/<many-to-one> tags are used.
Code:
[b]Employee.java[/b]
Long empid;
String empname;
Department department; //According to me this should not be generated
Set departments;
//set()/get() methods
Code:
[b]Department.java[/b]
Long deptid;
String deptname;
Employee employee; //According to me this should not be generated
Set employees;
the database schema are
Employee table
EMPID(pk),EMPNAME,DEPTID(fk)
Department table
DEPTID(pk),DEPTNAME,EMPID(fk)
thanks,
Shivam