I want to delete an object but can't do this because it is connected to other objects.
This is Hibernate's output:
To delete the references manually I tried the following:Hibernate: delete from student where id=? and version=? 2011-09-19 15:25:10,317 [http-8080-3] ERROR org.hibernate.util.JDBCExceptionReporter - Cannot delete or update a parent row: a foreign key constraint fails (database.student_course, CONSTRAINT FKF8A06F72970A31AF FOREIGN KEY (students) REFERENCES students (id))
but it doesn't work at all.Code:@PreRemove void preRemove() { this.setServices(null); }


Reply With Quote