use of org.dbflute.exception.IllegalBehaviorStateException in project fess by codelibs.
the class BsRoleTypeBhv method createEntity.
@Override
protected <RESULT extends RoleType> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setCreatedBy(DfTypeUtil.toString(source.get("createdBy")));
result.setCreatedTime(DfTypeUtil.toLong(source.get("createdTime")));
result.setName(DfTypeUtil.toString(source.get("name")));
result.setSortOrder(DfTypeUtil.toInteger(source.get("sortOrder")));
result.setUpdatedBy(DfTypeUtil.toString(source.get("updatedBy")));
result.setUpdatedTime(DfTypeUtil.toLong(source.get("updatedTime")));
result.setValue(DfTypeUtil.toString(source.get("value")));
return updateEntity(source, result);
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
use of org.dbflute.exception.IllegalBehaviorStateException in project fess by codelibs.
the class BsScheduledJobBhv method createEntity.
@Override
protected <RESULT extends ScheduledJob> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setAvailable(DfTypeUtil.toBoolean(source.get("available")));
result.setCrawler(DfTypeUtil.toBoolean(source.get("crawler")));
result.setCreatedBy(DfTypeUtil.toString(source.get("createdBy")));
result.setCreatedTime(DfTypeUtil.toLong(source.get("createdTime")));
result.setCronExpression(DfTypeUtil.toString(source.get("cronExpression")));
result.setJobLogging(DfTypeUtil.toBoolean(source.get("jobLogging")));
result.setName(DfTypeUtil.toString(source.get("name")));
result.setScriptData(DfTypeUtil.toString(source.get("scriptData")));
result.setScriptType(DfTypeUtil.toString(source.get("scriptType")));
result.setSortOrder(DfTypeUtil.toInteger(source.get("sortOrder")));
result.setTarget(DfTypeUtil.toString(source.get("target")));
result.setUpdatedBy(DfTypeUtil.toString(source.get("updatedBy")));
result.setUpdatedTime(DfTypeUtil.toLong(source.get("updatedTime")));
return updateEntity(source, result);
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
use of org.dbflute.exception.IllegalBehaviorStateException in project fess by codelibs.
the class BsLabelTypeBhv method createEntity.
@Override
protected <RESULT extends LabelType> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setCreatedBy(DfTypeUtil.toString(source.get("createdBy")));
result.setCreatedTime(DfTypeUtil.toLong(source.get("createdTime")));
result.setExcludedPaths(DfTypeUtil.toString(source.get("excludedPaths")));
result.setIncludedPaths(DfTypeUtil.toString(source.get("includedPaths")));
result.setName(DfTypeUtil.toString(source.get("name")));
result.setPermissions(toStringArray(source.get("permissions")));
result.setSortOrder(DfTypeUtil.toInteger(source.get("sortOrder")));
result.setUpdatedBy(DfTypeUtil.toString(source.get("updatedBy")));
result.setUpdatedTime(DfTypeUtil.toLong(source.get("updatedTime")));
result.setValue(DfTypeUtil.toString(source.get("value")));
return updateEntity(source, result);
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
use of org.dbflute.exception.IllegalBehaviorStateException in project fess by codelibs.
the class BsRequestHeaderBhv method createEntity.
@Override
protected <RESULT extends RequestHeader> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setCreatedBy(DfTypeUtil.toString(source.get("createdBy")));
result.setCreatedTime(DfTypeUtil.toLong(source.get("createdTime")));
result.setName(DfTypeUtil.toString(source.get("name")));
result.setUpdatedBy(DfTypeUtil.toString(source.get("updatedBy")));
result.setUpdatedTime(DfTypeUtil.toLong(source.get("updatedTime")));
result.setValue(DfTypeUtil.toString(source.get("value")));
result.setWebConfigId(DfTypeUtil.toString(source.get("webConfigId")));
return updateEntity(source, result);
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
use of org.dbflute.exception.IllegalBehaviorStateException in project fess by codelibs.
the class BsFileConfigToLabelBhv method createEntity.
@Override
protected <RESULT extends FileConfigToLabel> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setFileConfigId(DfTypeUtil.toString(source.get("fileConfigId")));
result.setLabelTypeId(DfTypeUtil.toString(source.get("labelTypeId")));
return updateEntity(source, result);
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
Aggregations