Hibernate的delete()方法
数据库的外键约束有级联删除,级联更新,set null三种。。。
hibernate的cascade="delete"可以忽略数据库外键约束。。。
因为
Hibernate: update book set type_id=null where type_id=1//先将外键设为nullHibernate: delete from book where id=1Hibernate: delete from book where id=2Hibernate: delete from book where id=3Hibernate: delete from book where id=4Hibernate: delete from book_type where id=1