Is there how I could programmatically ask eclipsel

2019-05-13 16:41发布

问题:

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