use of org.dbflute.exception.IllegalBehaviorStateException in project fess by codelibs.
the class BsFileConfigToRoleBhv method createEntity.
@Override
protected <RESULT extends FileConfigToRole> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setFileConfigId(DfTypeUtil.toString(source.get("fileConfigId")));
result.setRoleTypeId(DfTypeUtil.toString(source.get("roleTypeId")));
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 BsJobLogBhv method createEntity.
@Override
protected <RESULT extends JobLog> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setEndTime(DfTypeUtil.toLong(source.get("endTime")));
result.setJobName(DfTypeUtil.toString(source.get("jobName")));
result.setJobStatus(DfTypeUtil.toString(source.get("jobStatus")));
result.setScriptData(DfTypeUtil.toString(source.get("scriptData")));
result.setScriptResult(DfTypeUtil.toString(source.get("scriptResult")));
result.setScriptType(DfTypeUtil.toString(source.get("scriptType")));
result.setStartTime(DfTypeUtil.toLong(source.get("startTime")));
result.setTarget(DfTypeUtil.toString(source.get("target")));
result.setLastUpdated(DfTypeUtil.toLong(source.get("lastUpdated")));
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 BsBadWordBhv method createEntity.
@Override
protected <RESULT extends BadWord> 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.setSuggestWord(DfTypeUtil.toString(source.get("suggestWord")));
result.setTargetLabel(DfTypeUtil.toString(source.get("targetLabel")));
result.setTargetRole(DfTypeUtil.toString(source.get("targetRole")));
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 BsUserInfoBhv method createEntity.
@Override
protected <RESULT extends UserInfo> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setCreatedAt(toLocalDateTime(source.get("createdAt")));
result.setUpdatedAt(toLocalDateTime(source.get("updatedAt")));
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 BsFavoriteLogBhv method createEntity.
@Override
protected <RESULT extends FavoriteLog> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setCreatedAt(toLocalDateTime(source.get("createdAt")));
result.setUrl(DfTypeUtil.toString(source.get("url")));
result.setDocId(DfTypeUtil.toString(source.get("docId")));
result.setQueryId(DfTypeUtil.toString(source.get("queryId")));
result.setUserInfoId(DfTypeUtil.toString(source.get("userInfoId")));
return updateEntity(source, result);
} catch (InstantiationException | IllegalAccessException e) {
final String msg = "Cannot create a new instance: " + entityType.getName();
throw new IllegalBehaviorStateException(msg, e);
}
}
Aggregations