hibernate删除子表失败update t_order_consumption set order_code=null where order_code=?关键是这句话
Hibernate:updatet_order_consumptionsetorder_code=nullwhereorder_code=?2015-1-49:52:43...
Hibernate: update t_order_consumption set order_code=null where order_code=?
2015-1-4 9:52:43 org.hibernate.util.JDBCExceptionReporter logExceptions
警告: SQL Error: 1407, SQLState: 72000
2015-1-4 9:52:43 org.hibernate.util.JDBCExceptionReporter logExceptions
严重: ORA-01407: 无法更新 ("HAIYUN"."T_ORDER_CONSUMPTION"."ORDER_CODE") 为 NULL
2015-1-4 9:52:43 org.hibernate.util.JDBCExceptionReporter logExceptions
警告: SQL Error: 1407, SQLState: 72000
2015-1-4 9:52:43 org.hibernate.util.JDBCExceptionReporter logExceptions
严重: ORA-01407: 无法更新 ("HAIYUN"."T_ORDER_CONSUMPTION"."ORDER_CODE") 为 NULL
2015-1-4 9:52:43 org.hibernate.event.def.AbstractFlushingEventListener performExecutions
严重: Could not synchronize database state with session
org.hibernate.QueryTimeoutException: Could not execute JDBC batch update
下面是我的实体类配置
主表:
Order
private String code;
private List<OrderConsumption> orderConsumptions;
@OneToMany(cascade={CascadeType.ALL},fetch=FetchType.LAZY)
@JoinColumns(value={@JoinColumn(name="orderCode",referencedColumnName="code")})
@OrderBy("id")
public List<OrderConsumption> getOrderConsumptions() {
return orderConsumptions;
}
public void setOrderConsumptions(List<OrderConsumption> orderConsumptions) {
this.orderConsumptions = orderConsumptions;
}
子表:
OrderConsumption
private String orderCode; 展开
2015-1-4 9:52:43 org.hibernate.util.JDBCExceptionReporter logExceptions
警告: SQL Error: 1407, SQLState: 72000
2015-1-4 9:52:43 org.hibernate.util.JDBCExceptionReporter logExceptions
严重: ORA-01407: 无法更新 ("HAIYUN"."T_ORDER_CONSUMPTION"."ORDER_CODE") 为 NULL
2015-1-4 9:52:43 org.hibernate.util.JDBCExceptionReporter logExceptions
警告: SQL Error: 1407, SQLState: 72000
2015-1-4 9:52:43 org.hibernate.util.JDBCExceptionReporter logExceptions
严重: ORA-01407: 无法更新 ("HAIYUN"."T_ORDER_CONSUMPTION"."ORDER_CODE") 为 NULL
2015-1-4 9:52:43 org.hibernate.event.def.AbstractFlushingEventListener performExecutions
严重: Could not synchronize database state with session
org.hibernate.QueryTimeoutException: Could not execute JDBC batch update
下面是我的实体类配置
主表:
Order
private String code;
private List<OrderConsumption> orderConsumptions;
@OneToMany(cascade={CascadeType.ALL},fetch=FetchType.LAZY)
@JoinColumns(value={@JoinColumn(name="orderCode",referencedColumnName="code")})
@OrderBy("id")
public List<OrderConsumption> getOrderConsumptions() {
return orderConsumptions;
}
public void setOrderConsumptions(List<OrderConsumption> orderConsumptions) {
this.orderConsumptions = orderConsumptions;
}
子表:
OrderConsumption
private String orderCode; 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询