Hi all,
I am looking for a solution for the following problem (found at
http://sourceforge.net/mailarchive/foru ... nth=200402). Can anybody helb?
Thanx,
Thomas
--------- schnipp ---------------
I"m putting together an example demo for some students (like I"m the
expert :-\) and I"m using XDoclet, Tomcat, and MySQL for it all.
Person, abstract class extended by (joined-subclass) Teacher and
Student, with just an extra field in each, such as Course and Grade to
show the polymorphism.
I"d like to have a bidrectional many-to-many collection, a Teacher has a
set of Students, a Student has a set of teachers, basically I need a
teacher_student(teacherId, studentId) relation table. In the @hibernate
tags in Teacher.java:
/**
* Set the set of students
* @hibernate.set
* inverse="true" lazy="true" table="teacher_student"
* @hibernate.collection-many-to-many
* unique="false"
* class="csusb.Student"
* @hibernate.collection-key
* column="studentId"
*
* @return java.util.Set
*/
public void setStudents(Set students) {
this.students = students;
}
A similar thing is done in Student.java, except of course I turn around
the classes.
create table teacher_student (
studentId INTEGER not null,
elt INTEGER not null,
teacherId INTEGER not null,
primary key (teacherId, elt)
);
is generated by schemaexport. What is that ELT! How can I get rid of
it, what @hibernate tag or value am I missing?
------------------- schnapp -------------------------