Hi Gunnar,
We have persistence.xml files for non-environment specific settings (entities, transaction types etc) and then we bootstrap in Guice/Onami Persistence where we programmatically supplement those properties with the environment specific ones. e.g.
Code:
protected Properties mongoDbJpaConfigurationFrom(final String dbUriProperty) {
final MongoDbConfig config = MongoDbConfig.fromURI(getProperty(dbUriProperty));
Properties properties = new Properties();
properties.put("hibernate.ogm.datastore.database", config.getDatabase());
properties.put("hibernate.ogm.datastore.host", config.toHostAddress());
properties.put("hibernate.ogm.datastore.username", config.getUsername());
properties.put("hibernate.ogm.datastore.password", config.getPassword());
properties.put("org.hibernate.flushMode", "COMMIT");
if(config.isSsl()) {
properties.put("hibernate.ogm.mongodb.driver.sslEnabled", true);
properties.put("hibernate.ogm.mongodb.driver.sslInvalidHostNameAllowed", true);
// TODO: add certificate import
}
return properties;
}
Thanks,
Dave.