use of com.github.mongobee.Mongobee in project jhipster-sample-app-mongodb by jhipster.
the class CloudDatabaseConfiguration method mongobee.
@Bean
public Mongobee mongobee(MongoDbFactory mongoDbFactory, MongoTemplate mongoTemplate, Cloud cloud) {
log.debug("Configuring Cloud Mongobee");
List<ServiceInfo> matchingServiceInfos = cloud.getServiceInfos(MongoDbFactory.class);
if (matchingServiceInfos.size() != 1) {
throw new CloudException("No unique service matching MongoDbFactory found. Expected 1, found " + matchingServiceInfos.size());
}
MongoServiceInfo info = (MongoServiceInfo) matchingServiceInfos.get(0);
Mongobee mongobee = new Mongobee(info.getUri());
mongobee.setDbName(mongoDbFactory.getDb().getName());
mongobee.setMongoTemplate(mongoTemplate);
// package to scan for migrations
mongobee.setChangeLogsScanPackage("io.github.jhipster.sample.config.dbmigrations");
mongobee.setEnabled(true);
return mongobee;
}
use of com.github.mongobee.Mongobee in project jhipster-sample-app-mongodb by jhipster.
the class DatabaseConfiguration method mongobee.
@Bean
public Mongobee mongobee(MongoClient mongoClient, MongoTemplate mongoTemplate, MongoProperties mongoProperties) {
log.debug("Configuring Mongobee");
Mongobee mongobee = new Mongobee(mongoClient);
mongobee.setDbName(mongoProperties.getDatabase());
mongobee.setMongoTemplate(mongoTemplate);
// package to scan for migrations
mongobee.setChangeLogsScanPackage("io.github.jhipster.sample.config.dbmigrations");
mongobee.setEnabled(true);
return mongobee;
}
Aggregations