问题
This helps in unit testing.
回答1:
The following should work for you:
ServerSession session = entityManager.unwrap(ServerSession.class);
SchemaManager schemaManager = new SchemaManager(session);
schemaManager.replaceDefaultTables(true, true);
回答2:
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
来源:https://stackoverflow.com/questions/3746572/is-there-how-i-could-programmatically-ask-eclipselink-to-drop-and-create-all-tab