use of org.openforis.collect.model.ApplicationInfo in project collect by openforis.
the class ApplicationInfoDao method load.
public ApplicationInfo load() {
DSLContext dsl = dsl();
if (dsl.select().from(OFC_APPLICATION_INFO).fetchOne() != null) {
ApplicationInfo i = new ApplicationInfo();
String version = dsl.select().from(OFC_APPLICATION_INFO).fetchOne().getValue(OFC_APPLICATION_INFO.VERSION);
i.setVersion(version);
return i;
} else {
return null;
}
}
use of org.openforis.collect.model.ApplicationInfo in project collect by openforis.
the class DatabaseVersionManager method checkIsVersionCompatible.
public void checkIsVersionCompatible() throws DatabaseVersionNotCompatibleException {
ApplicationInfo info = applicationInfoDao.load();
Version schemaVersion = null;
if (info != null && StringUtils.isNotBlank(info.getVersion())) {
schemaVersion = new Version(info.getVersion());
}
Version appVersion = Collect.VERSION;
if (!isVersionCompatible(appVersion, schemaVersion)) {
throw new DatabaseVersionNotCompatibleException("Database version (" + (schemaVersion != null ? schemaVersion : "not specified") + ") is not compatible with Application version: " + appVersion);
}
}
Aggregations