May 16th, 2011, 02:48 PM
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?
May 16th, 2011, 04:09 PM
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