Announcement Announcement Module
Collapse
No announcement yet.
Roo IntegrationTest failing testPersist with IdentifierGenerationException Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Roo IntegrationTest failing testPersist with IdentifierGenerationException

    I have an entity class named SessionUUID who's Roo generated SessionUUIDIntegrationTest class is failing on the testPersist() method. It seems to happen because the DataOnDemand class is not setting the value of the @Id field in the getNewTransientSessionUUID method. I see it's setting other entity fields, just not the @Id field. The @Id field is basically just a String field that i set at runtime. So the test fails with "IdentifierGenerationException: ids for this class must be assigned before calling save()."

    Any idea how I can fix that?

  • #2
    This appears to be a Hibernate issue -see https://jira.springsource.org/browse/ROO-1040 and https://jira.springsource.org/browse/ROO-2424.

    A work-around is to use EclipseLink, or perhaps introduce a @PrePersist methof to assign the id first

    Comment

    Working...
    X