为什么使用Hibernate和Oracle 10g方言使用JPA创建一个名为hibernate_sequence的序列? [英] Why is a sequence named hibernate_sequence being created with JPA using Hibernate with the Oracle 10g dialect?
本文介绍了为什么使用Hibernate和Oracle 10g方言使用JPA创建一个名为hibernate_sequence的序列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的所有实体都使用这种类型的 @Id
All my entities use this type of @Id
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "MYENTITY_SEQ")
@SequenceGenerator(name = "MYENTITY_SEQ", sequenceName = "MYENTITY_SEQ")
@Column(name = "MYENTITY", nullable = false)
private Long id;
或
@Id
@Column(name = "MYENTITY")
总是创建一个名为 hibernate_sequence
的Oracle序列。这是为什么?我怎样才能避免这种情况?
I find that an Oracle sequence named hibernate_sequence
is always created. Why is this so? And how can I avoid this?
我使用JPA1与Hibernate 3和Oracle 10g方言。
I am using JPA1 with Hibernate 3 and the Oracle 10g dialect.
推荐答案
我怀疑这是因为我正在使用Hibernate Envers,因为我已经重复检查过我的实体,并且它们都有正确的@Id映射。
I suspect it's because i am using Hibernate Envers as i've double checked my entities and all of them have the correct @Id mappings.
这篇关于为什么使用Hibernate和Oracle 10g方言使用JPA创建一个名为hibernate_sequence的序列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文