use of org.dbflute.exception.IllegalBehaviorStateException in project fess by codelibs.
the class BsRoleBhv method createEntity.
@Override
protected <RESULT extends Role> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setName(DfTypeUtil.toString(source.get("name")));
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 BsUserBhv method createEntity.
@Override
protected <RESULT extends User> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {
try {
final RESULT result = entityType.newInstance();
result.setName(DfTypeUtil.toString(source.get("name")));
result.setPassword(DfTypeUtil.toString(source.get("password")));
result.setSurname(DfTypeUtil.toString(source.get("surname")));
result.setGivenName(DfTypeUtil.toString(source.get("givenName")));
result.setEmployeeNumber(DfTypeUtil.toString(source.get("employeeNumber")));
result.setMail(DfTypeUtil.toString(source.get("mail")));
result.setTelephoneNumber(DfTypeUtil.toString(source.get("telephoneNumber")));
result.setHomePhone(DfTypeUtil.toString(source.get("homePhone")));
result.setHomePostalAddress(DfTypeUtil.toString(source.get("homePostalAddress")));
result.setLabeledURI(DfTypeUtil.toString(source.get("labeledURI")));
result.setRoomNumber(DfTypeUtil.toString(source.get("roomNumber")));
result.setDescription(DfTypeUtil.toString(source.get("description")));
result.setTitle(DfTypeUtil.toString(source.get("title")));
result.setPager(DfTypeUtil.toString(source.get("pager")));
result.setStreet(DfTypeUtil.toString(source.get("street")));
result.setPostalCode(DfTypeUtil.toString(source.get("postalCode")));
result.setPhysicalDeliveryOfficeName(DfTypeUtil.toString(source.get("physicalDeliveryOfficeName")));
result.setDestinationIndicator(DfTypeUtil.toString(source.get("destinationIndicator")));
result.setInternationaliSDNNumber(DfTypeUtil.toString(source.get("internationaliSDNNumber")));
result.setState(DfTypeUtil.toString(source.get("state")));
result.setEmployeeType(DfTypeUtil.toString(source.get("employeeType")));
result.setFacsimileTelephoneNumber(DfTypeUtil.toString(source.get("facsimileTelephoneNumber")));
result.setPostOfficeBox(DfTypeUtil.toString(source.get("postOfficeBox")));
result.setInitials(DfTypeUtil.toString(source.get("initials")));
result.setCarLicense(DfTypeUtil.toString(source.get("carLicense")));
result.setMobile(DfTypeUtil.toString(source.get("mobile")));
result.setPostalAddress(DfTypeUtil.toString(source.get("postalAddress")));
result.setCity(DfTypeUtil.toString(source.get("city")));
result.setTeletexTerminalIdentifier(DfTypeUtil.toString(source.get("teletexTerminalIdentifier")));
result.setX121Address(DfTypeUtil.toString(source.get("x121Address")));
result.setBusinessCategory(DfTypeUtil.toString(source.get("businessCategory")));
result.setRegisteredAddress(DfTypeUtil.toString(source.get("registeredAddress")));
result.setDisplayName(DfTypeUtil.toString(source.get("displayName")));
result.setPreferredLanguage(DfTypeUtil.toString(source.get("preferredLanguage")));
result.setDepartmentNumber(DfTypeUtil.toString(source.get("departmentNumber")));
result.setUidNumber(DfTypeUtil.toLong(source.get("uidNumber")));
result.setGidNumber(DfTypeUtil.toLong(source.get("gidNumber")));
result.setHomeDirectory(DfTypeUtil.toString(source.get("homeDirectory")));
result.setGroups(toStringArray(source.get("groups")));
result.setRoles(toStringArray(source.get("roles")));
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