This helps in unit testing.
views:
49answers:
2
A:
One way to do that is to execute the sql scripts eclipselink generates specifying:
<property name="eclipselink.ddl-generation.output-mode" value="both"/>
in persistence.xml
simpatico
2010-09-19 16:50:51
+3
A:
The following should work for you:
ServerSession session = entityManager.unwrap(ServerSession.class);
SchemaManager schemaManager = new SchemaManager(session);
schemaManager.replaceDefaultTables(true, true);
Gordon Yorke
2010-09-20 12:58:39
I've replaced your code with my database destroying code, but then tests fail. Why could that be? Do I have to run this code inside a transaction?
simpatico
2010-10-23 17:25:07
No this code should be run outside of a transaction.
Gordon Yorke
2010-10-26 16:22:23