use of org.dbflute.exception.IllegalBehaviorStateException in project fess by codelibs.
the class BsElevateWordToLabelBhv method createEntity.
@Override
protected <RESULT extends ElevateWordToLabel> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setElevateWordId(DfTypeUtil.toString(source.get("elevateWordId")));
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);
}
}
use of org.dbflute.exception.IllegalBehaviorStateException in project fess by codelibs.
the class BsFailureUrlBhv method createEntity.
@Override
protected <RESULT extends FailureUrl> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setConfigId(DfTypeUtil.toString(source.get("configId")));
result.setErrorCount(DfTypeUtil.toInteger(source.get("errorCount")));
result.setErrorLog(DfTypeUtil.toString(source.get("errorLog")));
result.setErrorName(DfTypeUtil.toString(source.get("errorName")));
result.setLastAccessTime(DfTypeUtil.toLong(source.get("lastAccessTime")));
result.setThreadName(DfTypeUtil.toString(source.get("threadName")));
result.setUrl(DfTypeUtil.toString(source.get("url")));
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 BsFileAuthenticationBhv method createEntity.
@Override
protected <RESULT extends FileAuthentication> 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.setFileConfigId(DfTypeUtil.toString(source.get("fileConfigId")));
result.setHostname(DfTypeUtil.toString(source.get("hostname")));
result.setParameters(DfTypeUtil.toString(source.get("parameters")));
result.setPassword(DfTypeUtil.toString(source.get("password")));
result.setPort(DfTypeUtil.toInteger(source.get("port")));
result.setProtocolScheme(DfTypeUtil.toString(source.get("protocolScheme")));
result.setUpdatedBy(DfTypeUtil.toString(source.get("updatedBy")));
result.setUpdatedTime(DfTypeUtil.toLong(source.get("updatedTime")));
result.setUsername(DfTypeUtil.toString(source.get("username")));
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 BsCrawlingInfoBhv method createEntity.
@Override
protected <RESULT extends CrawlingInfo> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setCreatedTime(DfTypeUtil.toLong(source.get("createdTime")));
result.setExpiredTime(DfTypeUtil.toLong(source.get("expiredTime")));
result.setName(DfTypeUtil.toString(source.get("name")));
result.setSessionId(DfTypeUtil.toString(source.get("sessionId")));
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 BsDataConfigBhv method createEntity.
@Override
protected <RESULT extends DataConfig> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setAvailable(DfTypeUtil.toBoolean(source.get("available")));
result.setBoost(DfTypeUtil.toFloat(source.get("boost")));
result.setCreatedBy(DfTypeUtil.toString(source.get("createdBy")));
result.setCreatedTime(DfTypeUtil.toLong(source.get("createdTime")));
result.setDescription(DfTypeUtil.toString(source.get("description")));
result.setHandlerName(DfTypeUtil.toString(source.get("handlerName")));
result.setHandlerParameter(DfTypeUtil.toString(source.get("handlerParameter")));
result.setHandlerScript(DfTypeUtil.toString(source.get("handlerScript")));
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")));
return updateEntity(source, result);
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
Aggregations