Hibernate为GenerationType.SEQUENCE中定义的序列创建表

时间:2018-08-04 09:47:34

标签: java oracle hibernate

我有以下用于Entity生成序列的代码

@Id
    @GeneratedValue(strategy=GenerationType.SEQUENCE,generator="hotel_seq") 
    @SequenceGenerator(
        name="hotel_seq",
        sequenceName="hotel_id_s"
    )
    private Integer id;

运行应用程序时,hibernate尝试创建具有序列的表,但由于我使用的是Oracle数据库,并且不支持bigint数据类型,因此失败并出现以下异常。

Invocation of init method failed; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Unable to execute schema management to JDBC target [create table hotel_id_s (next_val bigint)]

有人可以帮我吗?

0 个答案:

没有答案