我用S2SH合成的一个项目,在修改时出现以下错误,哪位高手帮忙解决下?The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.springframework.dao.InvalidDataAccessApiUsageException: The given object has a null identifier: com.ztcx.pet.petinfo.pojo.Petinfo; nested exception is org.hibernate.TransientObjectException: The given object has a null identifier: com.ztcx.pet.petinfo.pojo.Petinfo
exception
org.springframework.dao.InvalidDataAccessApiUsageException: The given object has a null identifier: com.ztcx.pet.petinfo.pojo.Petinfo; nested exception is org.hibernate.TransientObjectException: The given object has a null identifier: com.ztcx.pet.petinfo.pojo.Petinfo
注意,如果在Hibernate中设置了主键由数据库生成的话,那数据库一定要设置主键自动增长。
这个实体的id为空。你的前台页面上没有传它的值,用个hidden