要看你具体的数据库是什么啊!比如sqlserver,hibernate提供的identity与之对应,oracle则是sequence对应,根据具体情况选择!
hibernate建议使用uuid.hex
hibernate建议使用uuid.hex
解决方案 »
- 在校生不知道该如何学习了
- 关于weblogic10查询nvarchar2类型数据出错问题
- ssh 上没有见过这个错误 请高手讲解一下。在线等待~!
- 怎么容易找到我想要的源代码呢?
- 关于搜索引擎lucene的一个问题
- jsp页面默认显示值的奇怪问题 大家帮我看看 谢谢
- Property 'dataSource' is not writable in bean class [org.springframework.orm.iba
- 安装jwsdp的时候提示select a web container
- jb8+weblogic7开发cmp2.0,如何将wls里的DataSouse加进去?
- ##############关于怎样考试,参加什么样的考试,各为什么要考试的问题?(300分献上,分三张贴子)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- 有关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