Skip to content

Commit aa697c0

Browse files
committed
MIR-1334 add missing default properties that formerly were present in generated persistence.xml files
1 parent 703af95 commit aa697c0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

mir-wizard/src/main/java/org/mycore/mir/wizard/command/MIRWizardGenerateJPAConfig.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ public class MIRWizardGenerateJPAConfig extends MIRWizardCommand {
5050

5151
private static final String COMPLEX_DATABASE_PREFIX
5252
= MCRPersistenceProvider.JPA_PERSISTENCE_UNIT_PROPERTY_NAME + PERSISTENCE_UNIT_NAME + ".";
53+
54+
public static final String HIKARI_PROVIDER = "org.hibernate.hikaricp.internal.HikariCPConnectionProvider";
5355

5456
public MIRWizardGenerateJPAConfig() {
5557
this("persistence.properties");
@@ -62,10 +64,12 @@ private MIRWizardGenerateJPAConfig(String name) {
6264
private static Properties getDefaultProps() {
6365
Properties props = new Properties();
6466

65-
props.setProperty(COMPLEX_DATABASE_PREFIX + "Class",
66-
MCRSimpleConfigPersistenceUnitDescriptor.class.getName());
67-
props.setProperty("MCR.JPA.Connection.MaximumPoolSize", "10");
67+
props.setProperty(COMPLEX_DATABASE_PREFIX + "Class", MCRSimpleConfigPersistenceUnitDescriptor.class.getName());
6868
props.setProperty(COMPLEX_DATABASE_PREFIX + "Properties.hibernate.auto_quote_keyword", "true");
69+
props.setProperty("MCR.JPA.Cache.UseSecondLevelCache", "false");
70+
props.setProperty("MCR.JPA.Hbm2ddlAuto", "validate");
71+
props.setProperty("MCR.JPA.Connection.ProviderClass", HIKARI_PROVIDER);
72+
props.setProperty("MCR.JPA.Connection.MaximumPoolSize", "10");
6973

7074
return props;
7175
}

0 commit comments

Comments
 (0)