首页 文章

GenerationType和MySQL错误

提问于
浏览
0

我有用户插入数据的Web表单 . 然后存储在数据库中 . 但我在db中遇到记录问题 . 我使用spring 3,jpa,eclipselink和mysql . 在实体中生成@Id . 当我使用策略时:GenerationType.AUTO,GenerationType.TABLE数据未存储且错误:
异常[EclipseLink-4002](Eclipse Persistence Services - 2.5.0.v20130507-3faac2b):org.eclipse.persistence.exceptions.DatabaseException内部异常:java.sql.SQLException:找不到基表或视图,来自服务器的消息:"Table 'sklep.sequence' doesn't exist"错误代码:1146调用:UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT?在哪里SEQ_NAME =?bind => [2个参数绑定]
当使用GenerationType.IDENTITY,GenerationType.SEQUENCE时,只存储第一个数据,然后:javax.persistence.PersistenceException:Exception [EclipseLink-4002](Eclipse Persistence Services - 2.5.0.v20130507-3faac2b):org.eclipse.persistence .exceptions.DatabaseException内部异常:java.sql.SQLException:null,来自服务器的消息:"Duplicate entry '0' for key 'PRIMARY'"错误代码:1062
到底是怎么回事?这是mysql的问题还是什么?救命!谢谢!

1 回答

相关问题