Hi,
I have a two classes such as Student/Department which have many-to-many association with each other, there is a link table created out of this association "student_dept".
Code:
Class Department {
...
private Set students;
....
}
Class Student {
...
private Set depts;
....
}
Now, if I want to delete entries related to a
particular Department using HQL, can I do the following:
"delete from Department.students ......"
or
//define values and types
.....
String hql = "select dept.students from Department as dept .....";
session.delete(hql, values, types);
I am wondering if the above cases hold true? Otherwise how can I achieve this?
thanks,