本文整理汇总了Java中org.kuali.rice.core.api.util.RiceKeyConstants类的典型用法代码示例。如果您正苦于以下问题:Java RiceKeyConstants类的具体用法?Java RiceKeyConstants怎么用?Java RiceKeyConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RiceKeyConstants类属于org.kuali.rice.core.api.util包,在下文中一共展示了RiceKeyConstants类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: validateSearchParameterPositiveValues
import org.kuali.rice.core.api.util.RiceKeyConstants; //导入依赖的package包/类
/**
* Validates that any numeric value is non-negative.
*
* @param form lookup form instance containing the lookup data
* @param propertyName property name of the search criteria field to be validated
* @param searchPropertyValue value given for field to search for
*/
protected void validateSearchParameterPositiveValues(LookupForm form, String propertyName, String searchPropertyValue) {
if (StringUtils.isBlank(searchPropertyValue)) {
return;
}
NumberFormat format = NumberFormat.getInstance();
Number number = null;
try {
number = format.parse(searchPropertyValue);
} catch (ParseException e) {
return;
}
if (Math.signum(number.doubleValue()) < 0) {
GlobalVariables.getMessageMap().putError(propertyName,
RiceKeyConstants.ERROR_NEGATIVES_NOT_ALLOWED_ON_FIELD, getCriteriaLabel(form, propertyName));
}
}
开发者ID:kuali,项目名称:kc-rice,代码行数:26,代码来源:TravelLookupableImpl.java
示例2: getAsText
import org.kuali.rice.core.api.util.RiceKeyConstants; //导入依赖的package包/类
/**
* This overridden method converts
* <code>org.kuali.rice.core.api.util.type.KualiPercent</code> objects to the
* display string.
*
* @see java.beans.PropertyEditorSupport#getAsText()
*/
@Override
public String getAsText() {
Object value = this.getValue();
// Previously returned N/A
if (value == null)
return "";
String stringValue = "";
try {
if (value instanceof KualiDecimal) {
value = ((KualiDecimal) this.getValue()).bigDecimalValue();
}
BigDecimal bigDecValue = (BigDecimal) value;
bigDecValue = bigDecValue.setScale(PERCENTAGE_SCALE, BigDecimal.ROUND_HALF_UP);
stringValue = NumberFormat.getInstance().format(bigDecValue.doubleValue());
} catch (IllegalArgumentException iae) {
throw new FormatException("formatting", RiceKeyConstants.ERROR_PERCENTAGE, this.getValue().toString(), iae);
}
return stringValue +"%";
}
开发者ID:kuali,项目名称:kc-rice,代码行数:31,代码来源:CustomPercentageEditor.java
示例3: testInvalidUSAddress
import org.kuali.rice.core.api.util.RiceKeyConstants; //导入依赖的package包/类
@Test
/**
* tests that an invalid US address will generate the expected errors
*
* @see DictionaryValidationServiceImpl#validate(Object, String, String, boolean)
* @see org.kuali.rice.krad.datadictionary.validation.constraint.MustOccurConstraint
*/
public void testInvalidUSAddress() {
DictionaryValidationResult dictionaryValidationResult = service.validate(invalidUSAddress,
"org.kuali.rice.kns.datadictionary.validation.MockAddress", addressEntry, true);
Assert.assertEquals(0, dictionaryValidationResult.getNumberOfWarnings());
Assert.assertEquals(2, dictionaryValidationResult.getNumberOfErrors());
Assert.assertTrue(hasError(dictionaryValidationResult, "country", RiceKeyConstants.ERROR_REQUIRES_FIELD));
Assert.assertTrue(hasError(dictionaryValidationResult, "postalCode", RiceKeyConstants.ERROR_OUT_OF_RANGE));
}
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:DictionaryValidationServiceImplTest.java
示例4: testInvalidDCAddress
import org.kuali.rice.core.api.util.RiceKeyConstants; //导入依赖的package包/类
@Test
/**
* tests that an invalid DC address will generate the expected errors
*
* <p>the attribute street1 has a ValidCharacters constraint that is activated when the state attribute has the value 'DC'</p>
*
* @see DictionaryValidationServiceImpl#validate(Object, String, String, boolean)
* @see org.kuali.rice.krad.datadictionary.validation.constraint.WhenConstraint
* @see DictionaryValidationResult
*/
public void testInvalidDCAddress() {
DictionaryValidationResult dictionaryValidationResult = service.validate(invalidDCUSAddress,
"org.kuali.rice.krad.datadictionary.validation.Address", addressEntry, true);
Assert.assertEquals(0, dictionaryValidationResult.getNumberOfWarnings());
Assert.assertEquals(1, dictionaryValidationResult.getNumberOfErrors());
Assert.assertTrue(hasError(dictionaryValidationResult, "street1", RiceKeyConstants.ERROR_INVALID_FORMAT));
}
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:DictionaryValidationServiceImplTest.java
示例5: testSimpleCaseConstraints
import org.kuali.rice.core.api.util.RiceKeyConstants; //导入依赖的package包/类
@Test
/**
* tests that an error is generated when an address where the country attribute is 'CN' has not value for street2
*
* @see DictionaryValidationServiceImpl#validate(Object, String, String, boolean)
* @see org.kuali.rice.krad.datadictionary.validation.constraint.WhenConstraint
* @see org.kuali.rice.krad.datadictionary.validation.constraint.SimpleConstraint
*/
public void testSimpleCaseConstraints() throws IOException {
DictionaryValidationResult dictionaryValidationResult = service.validate(invalidHKAddress,
"org.kuali.rice.krad.datadictionary.validation.Address", addressEntry, true);
Assert.assertEquals(0, dictionaryValidationResult.getNumberOfWarnings());
Assert.assertEquals(1, dictionaryValidationResult.getNumberOfErrors());
Assert.assertTrue(hasError(dictionaryValidationResult, "street2", RiceKeyConstants.ERROR_REQUIRED));
}
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:DictionaryValidationServiceImplTest.java
示例6: getUpperDateTimeBound
import org.kuali.rice.core.api.util.RiceKeyConstants; //导入依赖的package包/类
public static DateTime getUpperDateTimeBound(String dateRange) throws ParseException {
Range range = SearchExpressionUtils.parseRange(dateRange);
if (range == null) {
throw new IllegalArgumentException("Failed to parse date range from given string: " + dateRange);
}
if (range.getUpperBoundValue() != null) {
java.util.Date upperRangeDate = null;
try{
upperRangeDate = CoreApiServiceLocator.getDateTimeService().convertToDate(range.getUpperBoundValue());
}catch(ParseException pe){
GlobalVariables.getMessageMap().putError("dateCreated", RiceKeyConstants.ERROR_CUSTOM, pe.getMessage());
}
MutableDateTime dateTime = new MutableDateTime(upperRangeDate);
// set it to the last millisecond of the day
dateTime.setMillisOfDay((24 * 60 * 60 * 1000) - 1);
return dateTime.toDateTime();
}
return null;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:DocumentSearchInternalUtils.java
示例7: validateAttributeRequired
import org.kuali.rice.core.api.util.RiceKeyConstants; //导入依赖的package包/类
@Override
@Deprecated
public void validateAttributeRequired(String objectClassName, String attributeName, Object attributeValue,
Boolean forMaintenance, String errorKey) {
// check if field is a required field for the business object
if (attributeValue == null || (attributeValue instanceof String && StringUtils.isBlank(
(String) attributeValue))) {
Boolean required = getDataDictionaryService().isAttributeRequired(objectClassName, attributeName);
ControlDefinition controlDef = getDataDictionaryService().getAttributeControlDefinition(objectClassName,
attributeName);
if (required != null && required.booleanValue() && !(controlDef != null && controlDef.isHidden())) {
// get label of attribute for message
String errorLabel = getDataDictionaryService().getAttributeErrorLabel(objectClassName, attributeName);
GlobalVariables.getMessageMap().putError(errorKey, RiceKeyConstants.ERROR_REQUIRED, errorLabel);
}
}
}
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:DictionaryValidationServiceImpl.java
示例8: convertToObject
import org.kuali.rice.core.api.util.RiceKeyConstants; //导入依赖的package包/类
/**
* Convert display text to <code>java.sql.Date</code> object using the
* <code>org.kuali.rice.core.api.datetime.DateTimeService</code>.
*
* @param text
* the display text
* @return the <code>java.sql.Date</code> object
* @throws IllegalArgumentException
* the illegal argument exception
*/
protected Object convertToObject(String text) throws IllegalArgumentException {
try {
// Allow user to clear dates
if (text == null || text.equals("")) {
return null;
}
Date result = getDateTimeService().convertToSqlDate(text);
Calendar calendar = Calendar.getInstance();
calendar.setTime(result);
if (calendar.get(Calendar.YEAR) < 1000 && verbatimYear(text).length() < 4) {
throw new FormatException("illegal year format", RiceKeyConstants.ERROR_DATE, text);
}
return result;
} catch (ParseException e) {
throw new FormatException("parsing", RiceKeyConstants.ERROR_DATE, text, e);
}
}
开发者ID:kuali,项目名称:kc-rice,代码行数:29,代码来源:UifDateEditor.java
示例9: convertToObject
import org.kuali.rice.core.api.util.RiceKeyConstants; //导入依赖的package包/类
/**
* Convert display text to <code>java.util.Calendar</code> object using the
* <code>org.kuali.rice.core.api.datetime.DateTimeService</code>.
*
* @param text the display text
* @return the <code>java.util.Calendar</code> object
* @throws IllegalArgumentException the illegal argument exception
*/
protected Object convertToObject(String text) throws IllegalArgumentException {
try {
// Allow user to clear dates
if (text == null || text.equals("")) {
return null;
}
Date result = getDateTimeService().convertToSqlDate(text);
Calendar calendar = getDateTimeService().getCalendar(result);
calendar.setTime(result);
if (calendar.get(Calendar.YEAR) < 1000 && verbatimYear(text).length() < 4) {
throw new FormatException("illegal year format", RiceKeyConstants.ERROR_DATE, text);
}
return calendar;
} catch (ParseException e) {
throw new FormatException("parsing", RiceKeyConstants.ERROR_DATE, text, e);
}
}
开发者ID:kuali,项目名称:kc-rice,代码行数:29,代码来源:UifCalendarEditor.java
示例10: validDuplicateRoleName
import org.kuali.rice.core.api.util.RiceKeyConstants; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected boolean validDuplicateRoleName(IdentityManagementRoleDocument roleDoc){
Role role = KimApiServiceLocator.getRoleService().getRoleByNamespaceCodeAndName(roleDoc.getRoleNamespace(),
roleDoc.getRoleName());
boolean rulePassed = true;
if(role!=null){
if(role.getId().equals(roleDoc.getRoleId())) {
rulePassed = true;
}
else{
GlobalVariables.getMessageMap().putError("document.roleName",
RiceKeyConstants.ERROR_DUPLICATE_ENTRY, new String[] {"Role Name"});
rulePassed = false;
}
}
return rulePassed;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:IdentityManagementRoleDocumentRule.java
示例11: evaluateAndAddError
import org.kuali.rice.core.api.util.RiceKeyConstants; //导入依赖的package包/类
/**
* This method uses the evaluationSucceeds method to evaluate the
* constrainedValue. If evaluation does not succeed, it adds an error to
* GlobalVariables.getErrorMap(). The businessObjectOrDocumentClass,
* nameOfConstrainedProperty and userEditablePropertyName are used to
* retrieve the appropriate labels from the DataDictionary.
*
* @param businessObjectOrDocumentClass
* @return boolean indicating whether evaluation succeeded (see
* evaluationSucceeds)
*/
public boolean evaluateAndAddError(Class<? extends Object> businessObjectOrDocumentClass,
String constrainedPropertyName, String userEditablePropertyName) {
if (!evaluationSucceeds()) {
GlobalVariables.getMessageMap().putError(
userEditablePropertyName,
constraintIsAllow() ? RiceKeyConstants.ERROR_DOCUMENT_INVALID_VALUE_ALLOWED_VALUES_PARAMETER : RiceKeyConstants.ERROR_DOCUMENT_INVALID_VALUE_DENIED_VALUES_PARAMETER,
new String[] {
getDataDictionaryService().getAttributeLabel( businessObjectOrDocumentClass, constrainedPropertyName),
constrainedValue,
toStringForMessage(),
getParameterValuesForMessage(),
getDataDictionaryService().getAttributeLabel( businessObjectOrDocumentClass, userEditablePropertyName)
} );
return false;
}
return true;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:29,代码来源:ParameterEvaluatorImpl.java
示例12: processPropertyAccessException
import org.kuali.rice.core.api.util.RiceKeyConstants; //导入依赖的package包/类
/**
* Adds an entry to the {@link org.kuali.rice.krad.util.GlobalVariables#getMessageMap()} for the given
* binding processing error
*
* @param ex exception that was thrown
* @param bindingResult binding result containing the results of the binding process
*/
@Override
public void processPropertyAccessException(PropertyAccessException ex, BindingResult bindingResult) {
// Create field error with the exceptions's code, e.g. "typeMismatch".
super.processPropertyAccessException(ex, bindingResult);
Object rejectedValue = ex.getValue();
if (!(rejectedValue == null || rejectedValue.equals(""))) {
if (ex.getCause() instanceof FormatException) {
GlobalVariables.getMessageMap().putError(ex.getPropertyName(),
((FormatException) ex.getCause()).getErrorKey(),
new String[] {rejectedValue.toString()});
} else {
GlobalVariables.getMessageMap().putError(ex.getPropertyName(), RiceKeyConstants.ERROR_CUSTOM,
new String[] {"Invalid format"});
}
}
}
开发者ID:kuali,项目名称:kc-rice,代码行数:25,代码来源:UifBindingErrorProcessor.java
示例13: generatePessimisticLockMessages
import org.kuali.rice.core.api.util.RiceKeyConstants; //导入依赖的package包/类
/**
* Generates the messages that warn users that the document has been locked for editing by another user.
*
* @param form form instance containing the transactional document data
*/
protected void generatePessimisticLockMessages(TransactionalDocumentFormBase form) {
Document document = form.getDocument();
Person user = GlobalVariables.getUserSession().getPerson();
for (PessimisticLock lock : document.getPessimisticLocks()) {
if (!lock.isOwnedByUser(user)) {
String lockDescriptor = StringUtils.defaultIfBlank(lock.getLockDescriptor(), "full");
String lockOwner = lock.getOwnedByUser().getName();
String lockTime = RiceConstants.getDefaultTimeFormat().format(lock.getGeneratedTimestamp());
String lockDate = RiceConstants.getDefaultDateFormat().format(lock.getGeneratedTimestamp());
GlobalVariables.getMessageMap().putError(KRADConstants.GLOBAL_ERRORS,
RiceKeyConstants.ERROR_TRANSACTIONAL_LOCKED, lockDescriptor, lockOwner, lockTime, lockDate);
}
}
}
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:TransactionalDocumentView.java
示例14: validAssignGroup
import org.kuali.rice.core.api.util.RiceKeyConstants; //导入依赖的package包/类
protected boolean validAssignGroup(GroupDocumentMember groupMember, IdentityManagementGroupDocument document){
boolean rulePassed = true;
if(StringUtils.isNotEmpty(document.getGroupNamespace())){
Map<String,String> roleDetails = new HashMap<String,String>();
roleDetails.put(KimConstants.AttributeConstants.NAMESPACE_CODE, document.getGroupNamespace());
roleDetails.put(KimConstants.AttributeConstants.GROUP_NAME, document.getGroupName());
if (!getDocumentDictionaryService().getDocumentAuthorizer(document).isAuthorizedByTemplate(
document,
KimConstants.NAMESPACE_CODE,
KimConstants.PermissionTemplateNames.POPULATE_GROUP,
GlobalVariables.getUserSession().getPerson().getPrincipalId(),
roleDetails, null)){
GlobalVariables.getMessageMap().putError(ERROR_PATH, RiceKeyConstants.ERROR_ASSIGN_GROUP,
new String[] {document.getGroupNamespace(), document.getGroupName()});
rulePassed = false;
}
}
return rulePassed;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:GroupDocumentMemberRule.java
示例15: validateAttributeRequired
import org.kuali.rice.core.api.util.RiceKeyConstants; //导入依赖的package包/类
/**
* <p>Validates required-ness of an attribute against its corresponding value</p>
* <p>This implementation checks if an attribute value is null or blank, and if so checks if the
* {@link RemotableAttributeField} is required. If it is, a {@link RemotableAttributeError} is created
* with the message populated by a call to {@link #createErrorString(String, String...)}.</p>
*
* @param field the field for the attribute being tested
* @param objectClassName the class name for the component
* @param attributeName the name of the attribute
* @param attributeValue the value of the attribute
* @param errorKey the errorKey used to identify the field
* @return the List of errors ({@link RemotableAttributeError}s) encountered during validation. Cannot return null.
*/
protected List<RemotableAttributeError> validateAttributeRequired(RemotableAttributeField field,
String objectClassName, String attributeName, Object attributeValue, String errorKey) {
List<RemotableAttributeError> errors = new ArrayList<RemotableAttributeError>();
// check if field is a required field for the business object
if (attributeValue == null
|| (attributeValue instanceof String && StringUtils.isBlank((String) attributeValue))) {
boolean required = field.isRequired();
if (required) {
// get label of attribute for message
String errorLabel = getAttributeErrorLabel(field);
errors.add(RemotableAttributeError.Builder.create(errorKey,
createErrorString(RiceKeyConstants.ERROR_REQUIRED, errorLabel)).build());
}
}
return errors;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:33,代码来源:AttributeValidatingTypeServiceBase.java
示例16: validGroupMemberPrincipalIDs
import org.kuali.rice.core.api.util.RiceKeyConstants; //导入依赖的package包/类
protected boolean validGroupMemberPrincipalIDs(List<GroupDocumentMember> groupMembers) {
boolean valid = true;
List<String> principalIds = new ArrayList<String>();
for(GroupDocumentMember groupMember: groupMembers) {
if (StringUtils.equals(groupMember.getMemberTypeCode(), KimConstants.KimGroupMemberTypes.PRINCIPAL_MEMBER_TYPE.getCode()) ) {
principalIds.add(groupMember.getMemberId());
}
}
if(!principalIds.isEmpty()) {
// retrieve valid principals/principal-ids from identity service
List<Principal> validPrincipals = getIdentityService().getPrincipals(principalIds);
List<String> validPrincipalIds = new ArrayList<String>(validPrincipals.size());
for (Principal principal : validPrincipals) {
validPrincipalIds.add(principal.getPrincipalId());
}
// check that there are no invalid principals in the principal list, return false
List<String> invalidPrincipalIds = new ArrayList<String>(CollectionUtils.subtract(principalIds, validPrincipalIds));
// if list is not empty add error messages and return false
if(CollectionUtils.isNotEmpty(invalidPrincipalIds)) {
GlobalVariables.getMessageMap().putError("document.member.memberId", RiceKeyConstants.ERROR_MEMBERID_MEMBERTYPE_MISMATCH,
invalidPrincipalIds.toArray(new String[invalidPrincipalIds.size()]));
valid = false;
}
}
return valid;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:27,代码来源:IdentityManagementGroupDocumentRule.java
示例17: validateUniquePersonRoleQualifiersUniqueForMembership
import org.kuali.rice.core.api.util.RiceKeyConstants; //导入依赖的package包/类
/**
* Checks all the qualifiers for the given membership, so that all qualifiers which should be unique are guaranteed to be unique
*
* @param roleIndex the index of the role on the document (for error reporting purposes)
* @param membershipToCheckIndex the index of the person's membership in the role (for error reporting purposes)
* @return true if all unique values are indeed unique, false otherwise
*/
protected boolean validateUniquePersonRoleQualifiersUniqueForMembership(PersonDocumentRole role, KimDocumentRoleMember membershipToCheck, int membershipToCheckIndex, Set<String> uniqueQualifierAttributes, int roleIndex, List<RemotableAttributeError> validationErrors) {
boolean foundError = false;
int count = 0;
for (KimDocumentRoleMember membership : role.getRolePrncpls()) {
if (sameMembershipQualifications(membershipToCheck, membership, uniqueQualifierAttributes)) {
if (count == 0 ) {
count +=1;
} else {
count += 1;
foundError = true;
int qualifierCount = 0;
for (KimDocumentRoleQualifier qualifier : membership.getQualifiers()) {
if (qualifier != null && uniqueQualifierAttributes.contains(qualifier.getKimAttrDefnId())) {
validationErrors.add(RemotableAttributeError.Builder.create("document.roles["+roleIndex+"].rolePrncpls["+membershipToCheckIndex+"].qualifiers["+qualifierCount+"].attrVal", RiceKeyConstants.ERROR_DOCUMENT_IDENTITY_MANAGEMENT_PERSON_QUALIFIER_VALUE_NOT_UNIQUE+":"+qualifier.getKimAttribute().getAttributeName()+";"+qualifier.getAttrVal()).build());
}
qualifierCount += 1;
}
}
}
}
return foundError;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:33,代码来源:IdentityManagementPersonDocumentRule.java
示例18: validateSensitiveDataValue
import org.kuali.rice.core.api.util.RiceKeyConstants; //导入依赖的package包/类
protected boolean validateSensitiveDataValue(String fieldName, String fieldValue, String fieldLabel) {
boolean dataValid = true;
if (fieldValue == null) {
return dataValid;
}
boolean patternFound = KRADUtils.containsSensitiveDataPatternMatch(fieldValue);
boolean warnForSensitiveData = CoreFrameworkServiceLocator.getParameterService().getParameterValueAsBoolean(
KRADConstants.KNS_NAMESPACE, ParameterConstants.ALL_COMPONENT,
KRADConstants.SystemGroupParameterNames.SENSITIVE_DATA_PATTERNS_WARNING_IND);
if (patternFound && !warnForSensitiveData) {
dataValid = false;
GlobalVariables.getMessageMap().putError(fieldName,
RiceKeyConstants.ERROR_DOCUMENT_FIELD_CONTAINS_POSSIBLE_SENSITIVE_DATA, fieldLabel);
}
return dataValid;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:DocumentRuleBase.java
示例19: checkAllowsMaintenanceEdit
import org.kuali.rice.core.api.util.RiceKeyConstants; //导入依赖的package包/类
protected boolean checkAllowsMaintenanceEdit(String initiatorPrincipalId, ParameterBo newBO) {
boolean allowsEdit = false;
ParameterBo parm = newBO;
Map<String, String> permissionDetails = new HashMap<String, String>();
permissionDetails.put(KimConstants.AttributeConstants.NAMESPACE_CODE, parm.getNamespaceCode());
permissionDetails.put(KimConstants.AttributeConstants.COMPONENT_NAME, parm.getComponentCode());
permissionDetails.put(KimConstants.AttributeConstants.PARAMETER_NAME, parm.getName());
allowsEdit = KimApiServiceLocator.getPermissionService().isAuthorizedByTemplate(
GlobalVariables.getUserSession().getPerson().getPrincipalId(), KRADConstants.KNS_NAMESPACE,
KimConstants.PermissionTemplateNames.MAINTAIN_SYSTEM_PARAMETER, permissionDetails,
Collections.<String, String>emptyMap());
if(!allowsEdit){
putGlobalError(RiceKeyConstants.AUTHORIZATION_ERROR_PARAMETER);
}
return allowsEdit;
}
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:ParameterRule.java
示例20: verifyVersionNumber
import org.kuali.rice.core.api.util.RiceKeyConstants; //导入依赖的package包/类
@Override
public void verifyVersionNumber(Object dataObject) {
if (isPersistable(dataObject.getClass())) {
Object pbObject = businessObjectService.retrieve(dataObject);
if ( dataObject instanceof Versioned ) {
Long pbObjectVerNbr = KRADUtils.isNull(pbObject) ? null : ((Versioned) pbObject).getVersionNumber();
Long newObjectVerNbr = ((Versioned) dataObject).getVersionNumber();
if (pbObjectVerNbr != null && !(pbObjectVerNbr.equals(newObjectVerNbr))) {
GlobalVariables.getMessageMap().putError(KRADConstants.GLOBAL_ERRORS,
RiceKeyConstants.ERROR_VERSION_MISMATCH);
throw new ValidationException(
"Version mismatch between the local business object and the database business object");
}
}
}
}
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:KNSLegacyDataAdapterImpl.java
注:本文中的org.kuali.rice.core.api.util.RiceKeyConstants类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论