javax.persistence.PersistenceException

org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned beforeQuery calling save(): org.hibernate.bugs.ORMUnitTestCase$Address

Solutions on the web1043

  • via Hibernate JIRA by Flemming Harms, 2 months ago
    org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned beforeQuery calling save(): org.hibernate.bugs.ORMUnitTestCase$Address
  • via Stack Overflow by mmc18
    , 11 months ago
    org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): alarm.ServiceAlarmConfEntity
  • org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): us.kirin.bc.BetRecordAgGR
  • Stack trace

    • javax.persistence.PersistenceException: org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned beforeQuery calling save(): org.hibernate.bugs.ORMUnitTestCase$Address at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:147) at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:155) at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:162) at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:769) at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:742) at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:747) at org.hibernate.bugs.ORMUnitTestCase.insertTestData(ORMUnitTestCase.java:118) at org.hibernate.bugs.ORMUnitTestCase.hhh11303Test(ORMUnitTestCase.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:45) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74) Caused by: org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned beforeQuery calling save(): org.hibernate.bugs.ORMUnitTestCase$Address at org.hibernate.id.Assigned.generate(Assigned.java:33) at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:105) at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:192) at org.hibernate.event.internal.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:38) at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:177) at org.hibernate.event.internal.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:32) at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:73) at org.hibernate.internal.SessionImpl.fireSave(SessionImpl.java:673) at org.hibernate.internal.SessionImpl.save(SessionImpl.java:665) at org.hibernate.id.ForeignGenerator.generate(ForeignGenerator.java:108) at org.hibernate.mapping.Component$ValueGenerationPlan.execute(Component.java:418) at org.hibernate.id.CompositeNestedGeneratedValueGenerator.generate(CompositeNestedGeneratedValueGenerator.java:97) at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:105) at org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:189) at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:132) at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:58) at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:762) ... 16 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    4 times, 1 month ago
    Once, 4 months ago
    Unknown user
    Once, 11 months ago
    Once, 11 months ago
    Unknown user
    Once, 1 year ago
    5 more bugmates