use of org.dbflute.exception.IllegalBehaviorStateException in project fess by codelibs.
the class BsBoostDocumentRuleBhv method createEntity.
@Override
protected <RESULT extends BoostDocumentRule> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setBoostExpr(DfTypeUtil.toString(source.get("boostExpr")));
result.setCreatedBy(DfTypeUtil.toString(source.get("createdBy")));
result.setCreatedTime(DfTypeUtil.toLong(source.get("createdTime")));
result.setSortOrder(DfTypeUtil.toInteger(source.get("sortOrder")));
result.setUpdatedBy(DfTypeUtil.toString(source.get("updatedBy")));
result.setUpdatedTime(DfTypeUtil.toLong(source.get("updatedTime")));
result.setUrlExpr(DfTypeUtil.toString(source.get("urlExpr")));
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 BsCrawlingInfoParamBhv method createEntity.
@Override
protected <RESULT extends CrawlingInfoParam> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setCrawlingInfoId(DfTypeUtil.toString(source.get("crawlingInfoId")));
result.setCreatedTime(DfTypeUtil.toLong(source.get("createdTime")));
result.setKey(DfTypeUtil.toString(source.get("key")));
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 BsDataConfigToLabelBhv method createEntity.
@Override
protected <RESULT extends DataConfigToLabel> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setDataConfigId(DfTypeUtil.toString(source.get("dataConfigId")));
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 BsDataConfigToRoleBhv method createEntity.
@Override
protected <RESULT extends DataConfigToRole> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setDataConfigId(DfTypeUtil.toString(source.get("dataConfigId")));
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 BsFileConfigBhv method createEntity.
@Override
protected <RESULT extends FileConfig> 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.setConfigParameter(DfTypeUtil.toString(source.get("configParameter")));
result.setCreatedBy(DfTypeUtil.toString(source.get("createdBy")));
result.setCreatedTime(DfTypeUtil.toLong(source.get("createdTime")));
result.setDepth(DfTypeUtil.toInteger(source.get("depth")));
result.setDescription(DfTypeUtil.toString(source.get("description")));
result.setExcludedDocPaths(DfTypeUtil.toString(source.get("excludedDocPaths")));
result.setExcludedPaths(DfTypeUtil.toString(source.get("excludedPaths")));
result.setIncludedDocPaths(DfTypeUtil.toString(source.get("includedDocPaths")));
result.setIncludedPaths(DfTypeUtil.toString(source.get("includedPaths")));
result.setIntervalTime(DfTypeUtil.toInteger(source.get("intervalTime")));
result.setTimeToLive(DfTypeUtil.toInteger(source.get("timeToLive")));
result.setMaxAccessCount(DfTypeUtil.toLong(source.get("maxAccessCount")));
result.setName(DfTypeUtil.toString(source.get("name")));
result.setNumOfThread(DfTypeUtil.toInteger(source.get("numOfThread")));
result.setPaths(DfTypeUtil.toString(source.get("paths")));
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