Enable Hibernate HiLo Strategy
问题 I'm initializing Hibernate without any XML by something like org.hibernate.SessionFactory sessionFactory = new org.hibernate.cfg.Configuration(). .setProperty(...) .setProperty(...) ... .buildSessionFactory(); My classes use an ID like @Id @Generated(GenerationTime.INSERT) @GeneratedValue private Integer id; The generator used is SequenceStyleGenerator , which seems to be the replacement for the deprecated SequenceGenerator and SequenceHiLoGenerator and whatever. It uses public static final