ERROR - Exception occurred during processing request: ids for this class must be manually assigned before calling save(): cn.czq.entity.Product; nested exception is org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): cn.czq.entity.Product
org.springframework.orm.hibernate3.HibernateSystemException: ids for this class must be manually assigned before calling save(): cn.czq.entity.Product; nested exception is org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): cn.czq.entity.Product
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:690)
一直这个问题好恼火啊
ids for this class must be manually assigned before calling save():
说你的id必须要设置了才能执行存储。
应该是在Product.hbm.xml里面看一下pid下面配了<generator class="native"></generator>或者是increment什么的生成器没。
方法中参数不对引起的