Cat 中的是true我这样写就可以 级联删除成功
public void removeCat(final Cat cat) {
this.getHibernateTemplate().executeFind(new HibernateCallback() {
public Object .....(Session s) throws Excption {
Transation tx = s.begin...;
....
}
}
);
}
//可以删除主表,但从表不知怎么删除//该怎样写呢
public void remove(Child c) {
remove this.getHibernateTemplate().delete(cat);
}
public void removeCat(final Cat cat) {
this.getHibernateTemplate().executeFind(new HibernateCallback() {
public Object .....(Session s) throws Excption {
Transation tx = s.begin...;
....
}
}
);
}
//可以删除主表,但从表不知怎么删除//该怎样写呢
public void remove(Child c) {
remove this.getHibernateTemplate().delete(cat);
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货