嗨所以我创建了一个快速表:
package models;
import javax.persistence.*;
import play.db.ebean.Model;
@Entity
public class Phone extends Model {
@Id
public Long phoneID;
public String group;
public String name;
}
我收到以下错误:
PersistenceException:错误获取序列 nextval javax.persistence.PersistenceException:错误获取序列 nextval com.avaje.ebean.config.dbplatform.SequenceIdGenerator.getMoreIds(SequenceIdGenerator.java:213)com.avaje.ebean.config.dbplatform.SequenceIdGenerator.loadMoreIds( SequenceIdGenerator.java:163) com.avaje.ebean.config.dbplatform.SequenceIdGenerator.nextId(SequenceIdGenerator.java:118) com.avaje.ebeaninternal.server.deploy.BeanDescriptor.nextId(BeanDescriptor.java:1218) com.avaje。 ebeaninternal.server.persist.DefaultPersister.setIdGenValue(DefaultPersister.java:1304) com.avaje.ebeaninternal.server.persist.DefaultPersister.insert(DefaultPersister.java:403) com.avaje.ebeaninternal.server.persist.DefaultPersister.saveEnhanced( DefaultPersister.java:345) com.avaje.ebeaninternal。server.persist.DefaultPersister.saveRecurse(DefaultPersister.java:315) com.avaje.ebeaninternal.server.persist.DefaultPersister.save(DefaultPersister.java:282) com.avaje.ebeaninternal.server.core.DefaultServer.save(DefaultServer.save) java:1577) com.avaje.ebeaninternal.server.core.DefaultServer.save(DefaultServer.java:1567) com.avaje.ebean.Ebean.save(Ebean.java:538) play.db.ebean.Model.save( Model.java:76) models.Command.createCommand(Command.java:100) models.Command.populateCommands(Command.java:68) Global.onStart(Global.java:22) play.core.j.JavaGlobalSettingsAdapter.onStart( JavaGlobalSettingsAdapter.scala:15) play.api.GlobalPlugin.onStart(Global.scala:134) play.api.Play$$anonfun$start$1.apply(Play.scala:60) play.api.Play$$anonfun$start $1.apply(Play.scala:60) scala.collection。LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59) scala.collection.immutable.List.foreach(List.scala:45) play.api.Play$.start(Play.scala:60) play.core.ReloadableApplication$$ anonfun$get$1$$anonfun$apply$3$$anonfun$1.apply(ApplicationProvider.scala:125) play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$3$$anonfun$1.apply(ApplicationProvider.scala :112) scala.Option.map(Option.scala:133) play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$3.apply(ApplicationProvider.scala:112) play.core.ReloadableApplication$$anonfun$ get$1$$anonfun$apply$3.apply(ApplicationProvider.scala:110) scala.Either$RightProjection.flatMap(Either.scala:277) play.core.ReloadableApplication$$anonfun$get$1.apply(ApplicationProvider.scala:110 ) play.core。ReloadableApplication$$anonfun$get$1.apply(ApplicationProvider.scala:110) akka.dispatch.Future$$anon$3.liftedTree1$1(Future.scala:195) akka.dispatch.Future$$anon$3.run(Future.scala :194) akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:83) akka.jsr166y.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1381) akka.jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:259) akka.jsr166y .ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974) akka.jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1478) akka.jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)run(AbstractDispatcher.scala:83) akka.jsr166y.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1381) akka.jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:259) akka.jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool. java:974) akka.jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1478) akka.jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)run(AbstractDispatcher.scala:83) akka.jsr166y.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1381) akka.jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:259) akka.jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool. java:974) akka.jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1478) akka.jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)
我允许使用 h2 内存数据库的表的最大数量是多少?我真的不明白这个错误来自哪里。如果我删除此行,它可以正常工作,但看起来是另一个类导致了问题:createCommand,它只有以下内容:
public static void create(Command data) {
data.save();
}
public static void populateCommands() {
createCommand(0x00, "Cmd1");
createCommand(0x02, "Cmd2");
createCommand(0x03, "Cmd3");
}
任何帮助表示赞赏。