Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:3.2ga
Full stack trace of any exception that occurs:
Name and version of the database you are using:mysql 5
two entities associated as manytomany
@Entity
public class Subject{
...
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable(name = "SubjectLinkedToCalendar",
joinColumns = {@JoinColumn(name = "idSubjectFK")},
inverseJoinColumns = @JoinColumn(name = "idCalendarFK"))
public Set<Calendar> getCalendars() {
return calendars;
}
}
@Entity
public class Calendar{
....
@ManyToMany(cascade = CascadeType.REMOVE)
@JoinTable(name = "SubjectLinkedToCalendar", joinColumns = {@JoinColumn(name = "idCalendarFK")}, inverseJoinColumns = @JoinColumn(name = "idSubjectFK"))
public Set<Subject> getSubjects() {
return appointments;
}
}
maybe i made wrong joinTable mapping i don't know but it sucessfully works with persist , merge, delete, etc. operations
but don't handles bu transactions:
this means when i removing some subject.. associations to calendar are removings too.. but if i make transaction.rollback()
everything is rollbacks except SubjectLinkedToCalendarTable
(so i have database damage)
help please..