use of com.manydesigns.portofino.model.database.Database in project Portofino by ManyDesigns.
the class CrudAction method prepare.
@Override
protected ClassAccessor prepare(ActionInstance actionInstance) {
Database actualDatabase = getCrudConfiguration().getActualDatabase();
// TODO I18n
if (actualDatabase == null) {
String message = "Crud " + crudConfiguration.getName() + " (" + actionInstance.getPath() + ") " + "refers to a nonexistent database: " + getCrudConfiguration().getDatabase();
logger.warn(message);
RequestMessages.addErrorMessage(message);
return null;
}
baseTable = getCrudConfiguration().getActualTable();
if (baseTable == null) {
String message = "Crud " + crudConfiguration.getName() + " (" + actionInstance.getPath() + ") " + "refers to an invalid table.";
logger.warn(message);
RequestMessages.addErrorMessage(message);
return null;
}
return persistence.getTableAccessor(baseTable);
}
Aggregations