事物保存不了
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)
一直這個問題好惱火啊
2016-11-21
?ids for this class must be manually assigned before calling save():
說你的id必須要設(shè)置了才能執(zhí)行存儲。
應(yīng)該是在Product.hbm.xml里面看一下pid下面配了<generator class="native"></generator>或者是increment什么的生成器沒。
2016-11-24