Is there a way that I could programmatically ask eclipselink to delete and create all tables?

This helps in unit testing.

+3
source share
2 answers

The following should work for you:

ServerSession session = entityManager.unwrap(ServerSession.class);  
SchemaManager schemaManager = new SchemaManager(session);  
schemaManager.replaceDefaultTables(true, true);
+7
source

One way to do this is to execute sql scripts. eclipselink generates an indication:

      <property name="eclipselink.ddl-generation.output-mode" value="both"/>

in persistence.xml

+1
source

Source: https://habr.com/ru/post/1765520/


All Articles