Hi Appfuse Users, I am using Appfuse 2.0-M5, Struts2, mysql and Hibernate. In my project I have a one-to-many relationship.
Here is the sample code public class School extends BaseObject{ // .... @OneToMany(cascade = CascadeType.ALL, mappedBy = ("school")) public Set<Student> getStudents() { return students; } // .... } public class Student extends BaseObject{ // .... @ManyToOne(cascade = CascadeType.ALL) @JoinColumn(name = ("SchoolId"), nullable = false, unique = false) public School getSchool() { return school; } // .... } The Database is generated by hibernate3-plugin, and I couldn't manage to make the relationship between these two tables, delete on cascade. So I cannot remove School if there exists any students related to that school. When I change the FK to on delete cascade using mysql query browser, everything works fine. Is there a way to make it using annotations? If no how do you make these delete on cascade relations automaticly? Do you make them manually by modifying your database? or you don't just use these delete on cascade stuff :) Thanks in advance. -- View this message in context: http://www.nabble.com/How-to-make-hibernate3-Plugin-to-make-Relationships-cascade-delete-tf4017195s2369.html#a11408896 Sent from the AppFuse - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]