public Map getJpaPropertyMap() {
Properties jpaProperties = new Properties();
if (getDatabasePlatform() != null) {
jpaProperties.setProperty("openjpa.jdbc.DBDictionary", getDatabasePlatform());
}
else if (getDatabase() != null) {
String databaseDictonary = determineDatabaseDictionary(getDatabase());
if (databaseDictonary != null) {
jpaProperties.setProperty("openjpa.jdbc.DBDictionary", databaseDictonary);
}
}
if (isGenerateDdl()) {
jpaProperties.setProperty("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true)");
}
if (isShowSql()) {
// Taken from the OpenJPA 0.9.6 docs ("Standard OpenJPA Log Configuration + All SQL Statements")
jpaProperties.setProperty("openjpa.Log", "DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE");
}
return jpaProperties;
}
|