用hibernate一对一关联的两张表该如何删除? 请教了两表是双向外键关联 ,无法删除表我该咋办呢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://blog.csdn.net/shadow55/archive/2009/08/09/4428059.aspx 客服与包裹 1对多customer.hbm.xml<set name="packageInfos" inverse="true" cascade="all"> <key> <column name="CustomerId" /> </key> <one-to-many class="com.logistics.bean.PackageInfo" /> </set>package.hbm.xml<many-to-one name="customerInfo" class="com.logistics.bean.CustomerInfo"> <column name="CustomerId" /> </many-to-one>删除的时候,不能new 一定要用dao从数据库拿出来Customer customer = this.customerDao.get(customerId);if(customer != null) { this.customerDao.delete(customer);} 急!!有哪些java开源系统具有问题分享、进度跟踪、数据查询等功能的? ibatis三表级联查询?? freemarker 我写的Filter把我的拦截文件夹下面所有地址都给拦截了! xml解析 空标识则处理 文件下载 jasperreports問題 xmlhttp对象问题,和服务端有什么关系呢? j2ee里有个CMP,是什么东东?能否解释一下 java 执行sessionFactory.getCurrentSession()报错 关于JS的,有点急!! 100分 求 J2EE的医疗门诊查询系统
customer.hbm.xml
<set name="packageInfos" inverse="true" cascade="all">
<key>
<column name="CustomerId" />
</key>
<one-to-many class="com.logistics.bean.PackageInfo" />
</set>package.hbm.xml
<many-to-one name="customerInfo" class="com.logistics.bean.CustomerInfo">
<column name="CustomerId" />
</many-to-one>删除的时候,不能new 一定要用dao从数据库拿出来
Customer customer = this.customerDao.get(customerId);
if(customer != null) {
this.customerDao.delete(customer);
}