简体   繁体   中英

Hibernate_sequence does not exist with hibernate envers

I am using Hibernate Envers with entity

@Entity
@Table(name = "users", schema = "core")
@Audited public class Users implements java.io.Serializable, Comparable<Users> {
    protected static final long serialVersionUID = 1250157348010696249L;    
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "userid")
    protected Integer userId;

    @Column(name = "aduserid")
    protected String aduserId;

    @Column(name = "firstname")
    protected String firstName;

    @Column(name = "middlename")

i am getting error hibernate sequence does not exist.

when i am changing false then it says revision generator does not exist. Pls help me.

Hibernate Envers需要一个全局序列“hibernate_sequence”才能插入“revinfo”表。

you need to create hibernate_sequence in your database, check sample code

CREATE SEQUENCE hibernate_sequence  INCREMENT 1  MINVALUE 1
  MAXVALUE 9223372036854775807
  START 1
  CACHE 1;

@Jean-Christophe, 6 years later, but based on what was your statement? Any documentation or code to support that? I cannot find on official Hibernate documentation saying anything about hibernate_sequence:)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM