Jhipster休眠序列未从序列池中返回ID
Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value
violates unique constraint "pk_video_catalog" Detail: Key (id)=(2) already
exists. at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutor
Impl.java:2440) at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183) at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365) at
org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatemen
t.java:143) at
org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:120) at
com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61) at
com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPre
具有序列生成器的实体
public class VideoCatalog extends AbstractAuditingEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
private Long id;
数据库具有hibernate_sequence
作为序列