@Override public void afterPropertiesSet() throws Exception {
List<String> schemas = new ArrayList<>();
ArrayList<Study> studies = null;
try {
studies = studyDao.findAll();
for (Study study : studies) {
if (StringUtils.isNotEmpty(study.getSchemaName())) {
logger.info("Adding a schema:" + study.getSchemaName() + " to Liquibase");
schemas.add(study.getSchemaName());
}
}
} catch (Exception e) {
logger.info("There are no tables created as of yet.", e.getMessage(), e);
}
if (schemas.size() == 0)
return;
super.setSchemas(schemas);
super.afterPropertiesSet();
}