Skip to content
Snippets Groups Projects
Commit c861c5db authored by Lukas Köhler's avatar Lukas Köhler
Browse files

fix: persist data in controller, only when in persistance.xml is drop-and-create or create

parent 9b1d7db0
No related branches found
No related tags found
No related merge requests found
......@@ -189,7 +189,13 @@ public class Controller {
return;
}
lab02EntityManager.persistData();
String schemaGeneration = (String) lab02EntityManager.getEntityManager().getProperties()
.get("javax.persistence.schema-generation.database.action");
if (schemaGeneration.equals("drop-and-create") ||
schemaGeneration.equals("create")) {
lab02EntityManager.persistData();
}
isPersisted = true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment