要看你具体的数据库是什么啊!比如sqlserver,hibernate提供的identity与之对应,oracle则是sequence对应,根据具体情况选择!
hibernate建议使用uuid.hex
hibernate建议使用uuid.hex
解决方案 »
- java.util.ArrayList cannot be cast to txgl.entity.P_Person
- JS获取struts值问题
- 有没有一个较好的办法去转换DataTable中的字段显示值
- Struts与Spring整合的问题
- Xfire建立webservice的问题
- 请问一个 tomcat端口的问题
- 关于子框架替换父框架问题!
- 一个对于很多学习J2EE的人都很有帮助的问题,望各位DGDJ给小弟个解释(所有的分都送了)
- html格式的文件可否转为xml的,如何转?
- 感谢Anubis(为朋友两肋插刀,为MM插朋友两刀!!) ( 五级(中级)),来拿分!!
- 有关LookUpDispatchAction和中文的问题
- 在线等待,关于struts,hibernate里日期操作的问题,后台是oracle。谢谢
还是不行,显示不能插入空值.
用uuid.hex
显示
org.hibernate.PropertyAccessException: IllegalArgumentException occurred while calling setter of com.et.hibernate.AbstractBill.billId
private java.lang.Integer billId;
public java.lang.Integer getBillId()
{
return billId;
}
public void setBillId(java.lang.Integer billId)
{
this.billId = billId;
}
映射文件
<id name="billId" column="bill_id" type="java.lang.Integer" >
<generator class="native"/>
</id>
调用POJO Bill bill = new Bill();
bill.setBillName(name);
ss.save(bill);
JSP页面抛出异常
org.hibernate.exception.GenericJDBCException: could not insert: [com.et.hibernate.Bill]
控制台抛出异常org.hibernate.exception.GenericJDBCException: could not insert: [com.et.hibernate.Bill]
我QQ23395832