本文整理汇总了Java中org.kuali.rice.krad.service.BusinessObjectService.countMatching方法的典型用法代码示例。如果您正苦于以下问题:Java BusinessObjectService.countMatching方法的具体用法?Java BusinessObjectService.countMatching怎么用?Java BusinessObjectService.countMatching使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.krad.service.BusinessObjectService
的用法示例。
在下文中一共展示了BusinessObjectService.countMatching方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkForBlockingOffsetDefinitions
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
/**
* Checks that no offset definitions are dependent on the given object code if it is inactivated
* @param objectCode the object code trying to inactivate
* @return true if no offset definitions rely on the object code, false otherwise; this method also inserts error statements
*/
protected boolean checkForBlockingOffsetDefinitions(ObjectCode objectCode) {
final BusinessObjectService businessObjectService = SpringContext.getBean(BusinessObjectService.class);
boolean result = true;
Map<String, Object> keys = new HashMap<String, Object>();
keys.put("universityFiscalYear", objectCode.getUniversityFiscalYear());
keys.put("chartOfAccountsCode", objectCode.getChartOfAccountsCode());
keys.put("financialObjectCode", objectCode.getFinancialObjectCode());
final int matchingCount = businessObjectService.countMatching(OffsetDefinition.class, keys);
if (matchingCount > 0) {
GlobalVariables.getMessageMap().putErrorForSectionId("Edit Object Code",OLEKeyConstants.ERROR_DOCUMENT_OBJECTMAINT_INACTIVATION_BLOCKING,new String[] {(objectCode.getUniversityFiscalYear() != null ? objectCode.getUniversityFiscalYear().toString() : ""), objectCode.getChartOfAccountsCode(), objectCode.getFinancialObjectCode(), Integer.toString(matchingCount), OffsetDefinition.class.getName()});
result = false;
}
return result;
}
示例2: checkForBlockingIndirectCostRecoveryExclusionAccounts
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
/**
* Checks that no ICR Exclusion by Account records are dependent on the given object code if it is inactivated
* @param objectCode the object code trying to inactivate
* @return if no ICR Exclusion by Account records rely on the object code, false otherwise; this method also inserts error statements
*/
protected boolean checkForBlockingIndirectCostRecoveryExclusionAccounts(ObjectCode objectCode) {
boolean result = true;
final UniversityDateService universityDateService = SpringContext.getBean(UniversityDateService.class);
if (objectCode.getUniversityFiscalYear() != null && objectCode.getUniversityFiscalYear().equals(universityDateService.getCurrentFiscalYear())) {
final BusinessObjectService businessObjectService = SpringContext.getBean(BusinessObjectService.class);
Map<String, Object> keys = new HashMap<String, Object>();
keys.put("chartOfAccountsCode", objectCode.getChartOfAccountsCode());
keys.put("financialObjectCode", objectCode.getFinancialObjectCode());
final int matchingCount = businessObjectService.countMatching(IndirectCostRecoveryExclusionAccount.class, keys);
if (matchingCount > 0) {
GlobalVariables.getMessageMap().putErrorForSectionId("Edit Object Code",OLEKeyConstants.ERROR_DOCUMENT_OBJECTMAINT_INACTIVATION_BLOCKING,new String[] {(objectCode.getUniversityFiscalYear() != null ? objectCode.getUniversityFiscalYear().toString() : ""), objectCode.getChartOfAccountsCode(), objectCode.getFinancialObjectCode(), Integer.toString(matchingCount), IndirectCostRecoveryExclusionAccount.class.getName()});
result = false;
}
}
return result;
}
示例3: checkForBlockingOffsetDefinitions
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
/**
* Determines if the inactivating balance type should be blocked by offset definitions
* @param balanceType the balance type to check
* @return true if the balance type shouldn't be blocked by any existing offset definitions, false otherwise
*/
protected boolean checkForBlockingOffsetDefinitions(BalanceType balanceType) {
final BusinessObjectService businessObjectService = SpringContext.getBean(BusinessObjectService.class);
boolean result = true;
Map<String, Object> keys = new HashMap<String, Object>();
keys.put("financialBalanceTypeCode", balanceType.getFinancialBalanceTypeCode());
keys.put("universityFiscalYear", SpringContext.getBean(UniversityDateService.class).getCurrentFiscalYear());
final int matchingCount = businessObjectService.countMatching(OffsetDefinition.class, keys);
if (matchingCount > 0) {
GlobalVariables.getMessageMap().putErrorForSectionId("Edit Balance Type",OLEKeyConstants.ERROR_DOCUMENT_BALANCETYPMAINT_INACTIVATION_BLOCKING,new String[] {balanceType.getFinancialBalanceTypeCode(), Integer.toString(matchingCount), OffsetDefinition.class.getName()});
result = false;
}
return result;
}
示例4: validateExistenceOfOrganizationOption
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
/**
* This method returns true of organization option row exists with the same chart of accounts code and organization code
* as the customer invoice item code
*
* @param customerInvoiceItemCode
* @return
*/
public boolean validateExistenceOfOrganizationOption(CustomerInvoiceItemCode customerInvoiceItemCode) {
boolean isValid = true;
Map<String, String> criteria = new HashMap<String, String>();
criteria.put("chartOfAccountsCode", customerInvoiceItemCode.getChartOfAccountsCode());
criteria.put("organizationCode", customerInvoiceItemCode.getOrganizationCode());
BusinessObjectService businessObjectService = SpringContext.getBean(BusinessObjectService.class);
if( businessObjectService.countMatching(OrganizationOptions.class, criteria) == 0) {
putFieldError("organizationCode",ArKeyConstants.InvoiceItemCode.ORG_OPTIONS_DOES_NOT_EXIST_FOR_CHART_AND_ORG, new String[]{customerInvoiceItemCode.getChartOfAccountsCode(),customerInvoiceItemCode.getOrganizationCode()});
isValid = false;
}
return isValid;
}
示例5: checkForBlockingOffsetDefinitions
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
/**
* Checks that no offset definitions are dependent on the given object code if it is inactivated
* @param objectCode the object code trying to inactivate
* @return true if no offset definitions rely on the object code, false otherwise; this method also inserts error statements
*/
protected boolean checkForBlockingOffsetDefinitions(ObjectCode objectCode) {
final BusinessObjectService businessObjectService = SpringContext.getBean(BusinessObjectService.class);
boolean result = true;
Map<String, Object> keys = new HashMap<String, Object>();
keys.put("universityFiscalYear", objectCode.getUniversityFiscalYear());
keys.put("chartOfAccountsCode", objectCode.getChartOfAccountsCode());
keys.put("financialObjectCode", objectCode.getFinancialObjectCode());
final int matchingCount = businessObjectService.countMatching(OffsetDefinition.class, keys);
if (matchingCount > 0) {
GlobalVariables.getMessageMap().putErrorForSectionId("Edit Object Code",KFSKeyConstants.ERROR_DOCUMENT_OBJECTMAINT_INACTIVATION_BLOCKING,new String[] {(objectCode.getUniversityFiscalYear() != null ? objectCode.getUniversityFiscalYear().toString() : ""), objectCode.getChartOfAccountsCode(), objectCode.getFinancialObjectCode(), Integer.toString(matchingCount), OffsetDefinition.class.getName()});
result = false;
}
return result;
}
示例6: checkForBlockingIndirectCostRecoveryExclusionAccounts
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
/**
* Checks that no ICR Exclusion by Account records are dependent on the given object code if it is inactivated
* @param objectCode the object code trying to inactivate
* @return if no ICR Exclusion by Account records rely on the object code, false otherwise; this method also inserts error statements
*/
protected boolean checkForBlockingIndirectCostRecoveryExclusionAccounts(ObjectCode objectCode) {
boolean result = true;
final UniversityDateService universityDateService = SpringContext.getBean(UniversityDateService.class);
if (objectCode.getUniversityFiscalYear() != null && objectCode.getUniversityFiscalYear().equals(universityDateService.getCurrentFiscalYear())) {
final BusinessObjectService businessObjectService = SpringContext.getBean(BusinessObjectService.class);
Map<String, Object> keys = new HashMap<String, Object>();
keys.put("chartOfAccountsCode", objectCode.getChartOfAccountsCode());
keys.put("financialObjectCode", objectCode.getFinancialObjectCode());
final int matchingCount = businessObjectService.countMatching(IndirectCostRecoveryExclusionAccount.class, keys);
if (matchingCount > 0) {
GlobalVariables.getMessageMap().putErrorForSectionId("Edit Object Code",KFSKeyConstants.ERROR_DOCUMENT_OBJECTMAINT_INACTIVATION_BLOCKING,new String[] {(objectCode.getUniversityFiscalYear() != null ? objectCode.getUniversityFiscalYear().toString() : ""), objectCode.getChartOfAccountsCode(), objectCode.getFinancialObjectCode(), Integer.toString(matchingCount), IndirectCostRecoveryExclusionAccount.class.getName()});
result = false;
}
}
return result;
}
示例7: checkForBlockingOffsetDefinitions
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
/**
* Determines if the inactivating balance type should be blocked by offset definitions
* @param balanceType the balance type to check
* @return true if the balance type shouldn't be blocked by any existing offset definitions, false otherwise
*/
protected boolean checkForBlockingOffsetDefinitions(BalanceType balanceType) {
final BusinessObjectService businessObjectService = SpringContext.getBean(BusinessObjectService.class);
boolean result = true;
Map<String, Object> keys = new HashMap<String, Object>();
keys.put("financialBalanceTypeCode", balanceType.getFinancialBalanceTypeCode());
keys.put("universityFiscalYear", SpringContext.getBean(UniversityDateService.class).getCurrentFiscalYear());
final int matchingCount = businessObjectService.countMatching(OffsetDefinition.class, keys);
if (matchingCount > 0) {
GlobalVariables.getMessageMap().putErrorForSectionId("Edit Balance Type",KFSKeyConstants.ERROR_DOCUMENT_BALANCETYPMAINT_INACTIVATION_BLOCKING,new String[] {balanceType.getFinancialBalanceTypeCode(), Integer.toString(matchingCount), OffsetDefinition.class.getName()});
result = false;
}
return result;
}
示例8: getRoleMembershipWhenAccountInfoUnavailable
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
protected RoleMembership getRoleMembershipWhenAccountInfoUnavailable(String roleName, String principalId, Map<String,String> roleQualifier) {
BusinessObjectService businessObjectService = SpringContext.getBean(BusinessObjectService.class);
Map<String, Object> fieldValues = new HashMap<String, Object>();
RoleMembership roleMembership = null;
if ((OLEConstants.SysKimApiConstants.FISCAL_OFFICER_KIM_ROLE_NAME.equals(roleName))) {
fieldValues.put(OLEPropertyConstants.ACCOUNT_FISCAL_OFFICER_SYSTEM_IDENTIFIER, principalId);
if (businessObjectService.countMatching(Account.class, fieldValues) > 0) {
roleMembership = RoleMembership.Builder.create(null, null, principalId, MemberType.PRINCIPAL, roleQualifier).build();
}
}
else if (OLEConstants.SysKimApiConstants.FISCAL_OFFICER_PRIMARY_DELEGATE_KIM_ROLE_NAME.equals(roleName)) {
fieldValues.put(OLEPropertyConstants.ACCOUNT_DELEGATE_SYSTEM_ID, principalId);
fieldValues.put(OLEPropertyConstants.ACCOUNTS_DELEGATE_PRMRT_INDICATOR, Boolean.TRUE);
if (businessObjectService.countMatching(AccountDelegate.class, fieldValues) > 0) {
roleMembership = RoleMembership.Builder.create(null, null, principalId, MemberType.PRINCIPAL, roleQualifier).build();
}
}
else if (OLEConstants.SysKimApiConstants.FISCAL_OFFICER_SECONDARY_DELEGATE_KIM_ROLE_NAME.equals(roleName)) {
fieldValues.put(OLEPropertyConstants.ACCOUNT_DELEGATE_SYSTEM_ID, principalId);
fieldValues.put(OLEPropertyConstants.ACCOUNTS_DELEGATE_PRMRT_INDICATOR, Boolean.FALSE);
if (businessObjectService.countMatching(AccountDelegate.class, fieldValues) > 0) {
roleMembership = RoleMembership.Builder.create(null, null, principalId, MemberType.PRINCIPAL, roleQualifier).build();
}
}
return roleMembership;
}
示例9: setDetailAssignedId
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
/**
* Sets a valid detail assigned id to a vendor if the vendor has not had a detail assigned id yet. If this is a new parent whose
* header id is also null, this method will assign 0 as the detail assigned id. If this is a new division vendor, it will look
* for the count of vendor details in the database whose vendor header id match with the vendor header id of this new division,
* then look for the count of vendor details in the database, in a while loop, to find if a vendor detail with the same header
* id and detail id as the count has existed. If a vendor with such criteria exists, this method will increment the count
* by 1 and look up in the database again. If it does not exist, assign the count as the vendor detail id and change the
* boolean flag to stop the loop, because we have already found the valid detail assigned id that we were looking for
*
* @param vendorDetail VendorDetail The vendor whose detail assigned id we're trying to assign.
*/
private void setDetailAssignedId(VendorDetail vendorDetail) {
// If this is a new parent, let's set the detail id to 0.
if (ObjectUtils.isNull(vendorDetail.getVendorHeaderGeneratedIdentifier())) {
vendorDetail.setVendorDetailAssignedIdentifier(new Integer(0));
}
else {
// Try to get the count of all the vendor whose header id is the same as this header id.
Map criterias = new HashMap();
criterias.put(VendorPropertyConstants.VENDOR_HEADER_GENERATED_ID, vendorDetail.getVendorHeaderGeneratedIdentifier());
BusinessObjectService boService = SpringContext.getBean(BusinessObjectService.class);
int count = boService.countMatching(VendorDetail.class, criterias);
boolean validId = false;
while (!validId) {
criterias.put(VendorPropertyConstants.VENDOR_DETAIL_ASSIGNED_ID, count);
int result = boService.countMatching(VendorDetail.class, criterias);
if (result > 0) {
// increment the detail id by 1
count++;
}
else {
// count is a validId, so we'll use count as our vendor detail assigned id
validId = true;
vendorDetail.setVendorDetailAssignedIdentifier(new Integer(count));
}
}
}
}
示例10: getRoleMembershipWhenAccountInfoUnavailable
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
protected RoleMembership getRoleMembershipWhenAccountInfoUnavailable(String roleName, String principalId, Map<String,String> roleQualifier) {
BusinessObjectService businessObjectService = SpringContext.getBean(BusinessObjectService.class);
Map<String, Object> fieldValues = new HashMap<String, Object>();
RoleMembership roleMembership = null;
if ((KFSConstants.SysKimApiConstants.FISCAL_OFFICER_KIM_ROLE_NAME.equals(roleName))) {
fieldValues.put(KFSPropertyConstants.ACCOUNT_FISCAL_OFFICER_SYSTEM_IDENTIFIER, principalId);
if (businessObjectService.countMatching(Account.class, fieldValues) > 0) {
roleMembership = RoleMembership.Builder.create(null, null, principalId, MemberType.PRINCIPAL, roleQualifier).build();
}
}
else if (KFSConstants.SysKimApiConstants.FISCAL_OFFICER_PRIMARY_DELEGATE_KIM_ROLE_NAME.equals(roleName)) {
fieldValues.put(KFSPropertyConstants.ACCOUNT_DELEGATE_SYSTEM_ID, principalId);
fieldValues.put(KFSPropertyConstants.ACCOUNTS_DELEGATE_PRMRT_INDICATOR, Boolean.TRUE);
if (businessObjectService.countMatching(AccountDelegate.class, fieldValues) > 0) {
roleMembership = RoleMembership.Builder.create(null, null, principalId, MemberType.PRINCIPAL, roleQualifier).build();
}
}
else if (KFSConstants.SysKimApiConstants.FISCAL_OFFICER_SECONDARY_DELEGATE_KIM_ROLE_NAME.equals(roleName)) {
fieldValues.put(KFSPropertyConstants.ACCOUNT_DELEGATE_SYSTEM_ID, principalId);
fieldValues.put(KFSPropertyConstants.ACCOUNTS_DELEGATE_PRMRT_INDICATOR, Boolean.FALSE);
if (businessObjectService.countMatching(AccountDelegate.class, fieldValues) > 0) {
roleMembership = RoleMembership.Builder.create(null, null, principalId, MemberType.PRINCIPAL, roleQualifier).build();
}
}
return roleMembership;
}
示例11: setDetailAssignedId
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
/**
* Sets a valid detail assigned id to a vendor if the vendor has not had a detail assigned id yet. If this is a new parent whose
* header id is also null, this method will assign 0 as the detail assigned id. If this is a new division vendor, it will look
* for the count of vendor details in the database whose vendor header id match with the vendor header id of this new division,
* then look for the count of vendor details in the database, in a while loop, to find if a vendor detail with the same header
* id and detail id as the count has existed. If a vendor with such criteria exists, this method will increment the count
* by 1 and look up in the database again. If it does not exist, assign the count as the vendor detail id and change the
* boolean flag to stop the loop, because we have already found the valid detail assigned id that we were looking for
*
* @param vendorDetail VendorDetail The vendor whose detail assigned id we're trying to assign.
*/
private void setDetailAssignedId(VendorDetail vendorDetail) {
// If this is a new parent, let's set the detail id to 0.
if (ObjectUtils.isNull(vendorDetail.getVendorHeaderGeneratedIdentifier())) {
vendorDetail.setVendorDetailAssignedIdentifier(new Integer(0));
}
else {
// Try to get the count of all the vendor whose header id is the same as this header id.
Map criterias = new HashMap();
criterias.put(VendorPropertyConstants.VENDOR_HEADER_GENERATED_ID, vendorDetail.getVendorHeaderGeneratedIdentifier());
BusinessObjectService boService = SpringContext.getBean(BusinessObjectService.class);
int count = boService.countMatching(VendorDetail.class, criterias);
boolean validId = false;
while (!validId) {
criterias.put(VendorPropertyConstants.VENDOR_DETAIL_ASSIGNED_ID, count);
int result = boService.countMatching(VendorDetail.class, criterias);
if (result > 0) {
// increment the detail id by 1
count++;
}
else {
// count is a validId, so we'll use count as our vendor detail assigned id
validId = true;
vendorDetail.setVendorDetailAssignedIdentifier(new Integer(count));
}
}
}
}
示例12: enrouteDocumentsExist
import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
/**
* Look for any documents (created by optional unit tests) that may be at the accounting organization hierarchy or
* organization hierarchy route nodes so we can bypass running tests that may fail
* @return whether there are any enroute documents or not
*/
protected boolean enrouteDocumentsExist() {
final BusinessObjectService boService = SpringContext.getBean(BusinessObjectService.class);
Map<String, Object> fieldValues = new HashMap<String, Object>();
fieldValues.put(KFSPropertyConstants.WORKFLOW_DOCUMENT_STATUS_CODE, DocumentStatus.ENROUTE.getCode());
int count = boService.countMatching(FinancialSystemDocumentHeader.class, fieldValues);
return count > 0;
}