JPA自动生成的主键出错

时间:2016-07-29 10:20:28

标签: jpa orm oracle11g jpa-2.0

实体对象ID:

@Id @GeneratedValue(strategy=GenerationType.SEQUENCE)
@Column(name="MY_ID")
private long myId;

此字段在数据库中声明为主键。当我创建对象并尝试通过EntityManager的persist方法将其插入数据库时​​,会发生以下错误:

[7/29/16 18:02:00:637 CST] 0000005d SystemOut     O Hibernate: 
    select
        next_val as id_val 
    from
        hibernate_sequence with (updlock,
        rowlock)
[7/29/16 18:02:00:676 CST] 0000005d SystemOut     O 18:02:00,671 ERROR TableStructure:149 - could not read a hi value
java.sql.SQLSyntaxErrorException: ORA-00933: SQL command not properly ended

还有什么我需要做的吗?谢谢。数据库通过Oracle11g的方式

0 个答案:

没有答案