Wednesday, February 16, 2011

JpaUnitils.assertMappingWithDatabaseConsistent() is your friend

This baby detects the differences between your schema and your entities, and generates the DDL to adjust your schema to the Entities (of course if you use a schema-first approach you would run the DDL on the Entities, not on the schema!)


Priceless!

Funnily enough, I have discovered that running the same tests using different versions of Oracle DB (Oracle XE and the "real" Oracle DB) can give different results concerning the DB Metadata, speficically for the error:

junit.framework.AssertionFailedError: Found mismatches between Java objects and database tables. Applying following DDL statements to the database should resolve the problem:

(list of DDL commands follows)


No comments: