错误信息(以物流中心质量表函为例):
select
max(ID)
from
WLZX_ZLBH {executed in 0 msec}
org.springframework.orm.hibernate3.HibernateSystemException: this id generator generates long, integer, short; nested exception is org.hibernate.id.IdentifierGenerationException: this id generator generates long, integer, short
解决办法:
改javabean中ID的get方法
@Id @GeneratedValue(generator="custom-id")
@GenericGenerator(name="custom-id", strategy = "increment")
@Column(name = "ID", unique = true, nullable = false, insertable = true, updatable = true, length = 40)
public java.lang.String getId() {
return this.id;
}
改为
@Id @GeneratedValue(generator="custom-id")
@GenericGenerator(name="custom-id", strategy = "uuid.hex")
@Column(name = "ID", unique = true, nullable = false, insertable = true, updatable = true, length = 40)
public java.lang.String getId() {
return this.id;
}