1
我們一直在使用Play 2.3.9,現在我們正在遷移到Play 2.4.1當我使用舊版本的玩保存一個實體的作品,但與新的版本Id不會生成。Migration 2.4後,使用現有的postgresdb序列生成Play-2.4實體的ID
如果我使用,
@GeneratedValue(strategy = GenerationType.SEQUENCE)
它的正常工作,但是當我使用,
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
在型號
得到以下異常
[error] p.c.s.n.PlayDefaultUpstreamHandler - Cannot invoke the action
javax.persistence.PersistenceException: ERROR executing DML bindLog[] error[ERROR: null value in column "id" violates not-null constraint\n Detail: Failing row contains (null, null, kumar, null, 9581672143, [email protected], +j+b2lc5C7B48IGct2+L1jKBEIXhl0aOYy1BOnb85/Q=, iCZqST2EU4ECVaPwzGxr1hZ/b4Da34BI/C9xKCbpo78=, null, null, null, f, f, null, BLOOD_BANK_ADMIN, null, f, f, null, null, null, null, t, f, 2015-08-03 15:53:47.308, 2015-08-03 15:53:47.309, null, null, null, null, null, null, null, f, null).]
at com.avaje.ebeaninternal.server.persist.dml.DmlBeanPersister.execute(DmlBeanPersister.java:90) ~[avaje-ebeanorm-4.6.2.jar:na]
at com.avaje.ebeaninternal.server.persist.dml.DmlBeanPersister.insert(DmlBeanPersister.java:57) ~[avaje-ebeanorm-4.6.2.jar:na]
at com.avaje.ebeaninternal.server.persist.DefaultPersistExecute.executeInsertBean(DefaultPersistExecute.java:59) ~[avaje-ebeanorm-4.6.2.jar:na]
at com.avaje.ebeaninternal.server.core.PersistRequestBean.executeNow(PersistRequestBean.java:446) ~[avaje-ebeanorm-4.6.2.jar:na]
at com.avaje.ebeaninternal.server.core.PersistRequestBean.executeOrQueue(PersistRequestBean.java:480) ~[avaje-ebeanorm-4.6.2.jar:na]
有什麼建議?