当前位置: 首页>>代码示例>>Java>>正文


Java BusinessObjectService.retrieve方法代码示例

本文整理汇总了Java中org.kuali.rice.krad.service.BusinessObjectService.retrieve方法的典型用法代码示例。如果您正苦于以下问题:Java BusinessObjectService.retrieve方法的具体用法?Java BusinessObjectService.retrieve怎么用?Java BusinessObjectService.retrieve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.krad.service.BusinessObjectService的用法示例。


在下文中一共展示了BusinessObjectService.retrieve方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: preUpdate

import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
@Override protected void preUpdate() {
    super.preUpdate();
    try {
        // KULCOA-549: update the sufficient funds table
        // get the current data from the database
        BusinessObjectService boService = SpringContext.getBean(BusinessObjectService.class);
        Account originalAcct = (Account) boService.retrieve(this);

        if (originalAcct != null) {
            if (!originalAcct.getSufficientFundsCode().equals(getSufficientFundsCode()) || originalAcct.isExtrnlFinEncumSufficntFndIndicator() != isExtrnlFinEncumSufficntFndIndicator() || originalAcct.isIntrnlFinEncumSufficntFndIndicator() != isIntrnlFinEncumSufficntFndIndicator() || originalAcct.isPendingAcctSufficientFundsIndicator() != isPendingAcctSufficientFundsIndicator() || originalAcct.isFinPreencumSufficientFundIndicator() != isFinPreencumSufficientFundIndicator()) {
                SufficientFundRebuild sfr = new SufficientFundRebuild();
                sfr.setAccountFinancialObjectTypeCode(SufficientFundRebuild.REBUILD_ACCOUNT);
                sfr.setChartOfAccountsCode(getChartOfAccountsCode());
                sfr.setAccountNumberFinancialObjectCode(getAccountNumber());
                if (boService.retrieve(sfr) == null) {
                    boService.save(sfr);
                }
            }
        }
    }
    catch (Exception ex) {
        LOG.error("Problem updating sufficient funds rebuild table: ", ex);
    }
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:25,代码来源:Account.java

示例2: preUpdate

import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
@Override protected void preUpdate() {
    super.preUpdate();
    try {
        // KULCOA-549: update the sufficient funds table
        // get the current data from the database
        BusinessObjectService boService = SpringContext.getBean(BusinessObjectService.class);
        ObjectLevel originalObjLevel = (ObjectLevel) boService.retrieve(this);

        if (originalObjLevel != null) {
            if (!originalObjLevel.getFinancialConsolidationObjectCode().equals(getFinancialConsolidationObjectCode())) {
                SufficientFundRebuild sfr = new SufficientFundRebuild();
                sfr.setAccountFinancialObjectTypeCode(SufficientFundRebuild.REBUILD_OBJECT);
                sfr.setChartOfAccountsCode(originalObjLevel.getChartOfAccountsCode());
                sfr.setAccountNumberFinancialObjectCode(originalObjLevel.getFinancialConsolidationObjectCode());
                if (boService.retrieve(sfr) == null) {
                    boService.save(sfr);
                }
                sfr = new SufficientFundRebuild();
                sfr.setAccountFinancialObjectTypeCode(SufficientFundRebuild.REBUILD_OBJECT);
                sfr.setChartOfAccountsCode(getChartOfAccountsCode());
                sfr.setAccountNumberFinancialObjectCode(getFinancialConsolidationObjectCode());
                if (boService.retrieve(sfr) == null) {
                    boService.save(sfr);
                }
            }
        }
    }
    catch (Exception ex) {
        LOG.error("Problem updating sufficient funds rebuild table: ", ex);
    }
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:32,代码来源:ObjectLevel.java

示例3: revertDetaiLine

import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
/**
 * revert the detail line in the specified position
 */
protected void revertDetaiLine(List<EffortCertificationDetail> detailLines, int lineToRevertIndex) {
    EffortCertificationDetail lineToRevert = detailLines.get(lineToRevertIndex);

    BusinessObjectService businessObjectService = SpringContext.getBean(BusinessObjectService.class);
    EffortCertificationDetail revertedLine = (EffortCertificationDetail) businessObjectService.retrieve(lineToRevert);
    this.resetPersistedFields(revertedLine);

    detailLines.remove(lineToRevertIndex);
    detailLines.add(lineToRevertIndex, revertedLine);
}
 
开发者ID:kuali,项目名称:kfs,代码行数:14,代码来源:CertificationReportAction.java

示例4: handleRequestFromWorkflow

import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
/**
 * This method handles when request is from a work flow document search
 * 
 * @param equipmentLoanOrReturnForm Form
 * @param equipmentLoanOrReturnDocument Document
 * @param service BusinessObjectService
 * @return Asset
 */
protected Asset handleRequestFromWorkflow(EquipmentLoanOrReturnForm equipmentLoanOrReturnForm, EquipmentLoanOrReturnDocument equipmentLoanOrReturnDocument, BusinessObjectService businessObjectService) {
    Asset newAsset = new Asset();
    if (equipmentLoanOrReturnForm.getDocId() != null) {
        newAsset.setCapitalAssetNumber(equipmentLoanOrReturnDocument.getCapitalAssetNumber());
        newAsset = (Asset) businessObjectService.retrieve(newAsset);
        equipmentLoanOrReturnDocument.setAsset(newAsset);
    }
    return newAsset;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:18,代码来源:EquipmentLoanOrReturnAction.java

示例5: testSaveApprovedChanges_Offcampus

import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
@ConfigureContext(session = khuntley, shouldCommitTransactions = false)
public void testSaveApprovedChanges_Offcampus() throws Exception {
    AssetTransferDocument document = buildTransferDocument(AssetTransferFixture.ACTIVE_CAPITAL_ASSET.newAsset(), true);
    document.setOffCampusAddress("4700 S HAGADORN");
    document.setOffCampusCityName("E LANSING");
    document.setOffCampusStateCode("MI");
    document.setOffCampusZipCode("48823");

    // clear fields that conflict with off-campus data
    document.setCampusCode(null);
    document.setBuildingCode(null);
    document.setBuildingRoomNumber(null);
    document.setBuildingSubRoomNumber(null);

    this.assetTransferService.saveApprovedChanges(document);
    BusinessObjectService boService = SpringContext.getBean(BusinessObjectService.class);
    Asset asset = document.getAsset();
    asset = (Asset) boService.retrieve(asset);
    asset.refreshReferenceObject(CamsPropertyConstants.Asset.ASSET_LOCATIONS);
    SpringContext.getBean(AssetLocationService.class).setOffCampusLocation(asset);
    assertNotNull(asset);
    assertEquals(document.getOrganizationOwnerChartOfAccountsCode(), asset.getOrganizationOwnerChartOfAccountsCode());
    assertEquals(document.getOrganizationOwnerAccountNumber(), asset.getOrganizationOwnerAccountNumber());
    assertEquals(document.getCampusCode(), asset.getCampusCode());
    assertTrue(DateUtils.isSameDay(new java.util.Date(), asset.getLastInventoryDate()));
    AssetLocation offCampusLocation = asset.getOffCampusLocation();
    assertNotNull(offCampusLocation);
    assertEquals("4700 S HAGADORN", offCampusLocation.getAssetLocationStreetAddress());
    assertEquals("E LANSING", offCampusLocation.getAssetLocationCityName());
    assertEquals("MI", offCampusLocation.getAssetLocationStateCode());
    assertEquals("48823", offCampusLocation.getAssetLocationZipCode());
}
 
开发者ID:kuali,项目名称:kfs,代码行数:33,代码来源:AssetTransferServiceTest.java

示例6: testSaveApprovedChanges_AssetOrgInfo

import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
@ConfigureContext(session = khuntley, shouldCommitTransactions = false)
public void testSaveApprovedChanges_AssetOrgInfo() throws Exception {
    AssetTransferDocument document = buildTransferDocument(AssetTransferFixture.ACTIVE_CAPITAL_ASSET.newAsset(), true);
    document.setOrganizationTagNumber("TEL");
    document.setOrganizationText("TEXT");
    this.assetTransferService.saveApprovedChanges(document);
    BusinessObjectService boService = SpringContext.getBean(BusinessObjectService.class);
    Asset asset = document.getAsset();
    asset = (Asset) boService.retrieve(asset);
    asset.refreshReferenceObject(CamsPropertyConstants.AssetOrganization.ASSET_ORGANIZATION);
    AssetOrganization assetOrganization = asset.getAssetOrganization();
    assertNotNull(assetOrganization);
    assertEquals("TEL", assetOrganization.getOrganizationTagNumber());
    assertEquals("TEXT", assetOrganization.getOrganizationText());
}
 
开发者ID:kuali,项目名称:kfs,代码行数:16,代码来源:AssetTransferServiceTest.java

示例7: setDefaultsAndStore

import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
/**
 * Sets defaults for fields not populated from file. Store an origin entry group, all gl entries and id billing entries from the
 * processed file. Also write the header for the duplicate file check.
 * 
 * @param originEntryGroup the group into which to store the origin entries
 * @param collectorReportData report data
 */
public void setDefaultsAndStore(CollectorReportData collectorReportData, String demergerOutputFileName, PrintStream originEntryOutputPs) {
    BusinessObjectService businessObjectService = SpringContext.getBean(BusinessObjectService.class);  
    CollectorDetailService collectorDetailService = SpringContext.getBean(CollectorDetailService.class);
    
    // persistHeader is used to persist a collector header record into the DB
    CollectorHeader persistHeader = createCollectorHeaderForStorage();
    CollectorHeader foundHeader = retrieveDuplicateHeader();

    if (foundHeader != null) {
        // update the version number to prevent OptimisticLockingExceptions
        persistHeader.setVersionNumber(foundHeader.getVersionNumber());
    }
    businessObjectService.save(persistHeader);
          
    // store origin entries by using the demerger output file
    
    BufferedReader inputFileReader = null;
    try {
        inputFileReader = new BufferedReader(new FileReader(demergerOutputFileName));
        String line = null;
        while ((line = inputFileReader.readLine()) != null) {
            originEntryOutputPs.printf("%s\n", line);
        }
    }
    catch (IOException e) {
        throw new RuntimeException("IO Error encountered trying to persist collector batch.", e);
    }
    finally {
        IOUtils.closeQuietly(inputFileReader);
        inputFileReader = null;
    }  
    Date nowDate  = new Date(SpringContext.getBean(DateTimeService.class).getCurrentDate().getTime());
    RunDateService runDateService = SpringContext.getBean(RunDateService.class);
    Date createDate = new java.sql.Date((runDateService.calculateRunDate(nowDate).getTime()));
    
    Integer sequenceNumber = new Integer(0);
    Integer nextSequence = collectorDetailService.getNextCreateSequence(createDate);
    if (nextSequence != null) {
        sequenceNumber = nextSequence;
    }
    int countOfdetails = collectorDetails.size();
    for (int numSavedDetails = 0; numSavedDetails < countOfdetails; numSavedDetails++) {
        CollectorDetail idDetail = this.collectorDetails.get(numSavedDetails);           
      //  setDefaultsCollectorDetail(idDetail);
     
        idDetail.setTransactionLedgerEntrySequenceNumber( ++sequenceNumber);
        idDetail.setCreateDate(createDate);
        CollectorDetail foundIdDetail = (CollectorDetail) businessObjectService.retrieve(idDetail);
        if (foundIdDetail != null) {
            idDetail.setVersionNumber(foundIdDetail.getVersionNumber());
        }

        businessObjectService.save(idDetail);
    }
    
    collectorReportData.setNumSavedDetails(this, countOfdetails);
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:65,代码来源:CollectorBatch.java

示例8: testSaveApprovedChanges

import org.kuali.rice.krad.service.BusinessObjectService; //导入方法依赖的package包/类
@ConfigureContext(session = khuntley, shouldCommitTransactions = false)
public void testSaveApprovedChanges() throws Exception {
    AssetTransferDocument document = buildTransferDocument(AssetTransferFixture.ACTIVE_CAPITAL_ASSET.newAsset(), true);
    this.assetTransferService.saveApprovedChanges(document);
    BusinessObjectService boService = SpringContext.getBean(BusinessObjectService.class);
    Asset asset = document.getAsset();
    asset = (Asset) boService.retrieve(asset);
    asset.refreshReferenceObject(CamsPropertyConstants.Asset.ASSET_PAYMENTS);
    assertNotNull(asset);
    assertEquals(document.getOrganizationOwnerChartOfAccountsCode(), asset.getOrganizationOwnerChartOfAccountsCode());
    assertEquals(document.getOrganizationOwnerAccountNumber(), asset.getOrganizationOwnerAccountNumber());
    assertEquals(document.getCampusCode(), asset.getCampusCode());
    assertEquals(document.getBuildingCode(), asset.getBuildingCode());
    assertEquals(document.getBuildingRoomNumber(), asset.getBuildingRoomNumber());
    assertEquals(document.getBuildingSubRoomNumber(), asset.getBuildingSubRoomNumber());
    assertTrue(DateUtils.isSameDay(new java.util.Date(), asset.getLastInventoryDate()));
    List<AssetPayment> assetPayments = asset.getAssetPayments();
    // sort the payment
    Collections.sort(assetPayments, new Comparator<AssetPayment>() {
        @Override
        public int compare(AssetPayment o1, AssetPayment o2) {
            return o1.getPaymentSequenceNumber().compareTo(o2.getPaymentSequenceNumber());
        }
    });
    assertEquals(6, assetPayments.size());
    // Asset original payment 1
    AssetPayment testDataPayment = AssetTransferFixture.PAYMENT1_WITH_OFFSET.newAssetPayment();
    AssetPayment assetPayment1 = assetPayments.get(0);
    assertOriginalPayment(testDataPayment, assetPayment1);

    // Assert original payment 2
    testDataPayment = AssetTransferFixture.PAYMENT2_WITH_OFFSET.newAssetPayment();
    AssetPayment assetPayment2 = assetPayments.get(1);
    assertOriginalPayment(testDataPayment, assetPayment2);

    // Assert offset payment 1
    testDataPayment = AssetTransferFixture.PAYMENT1_WITH_OFFSET.newAssetPayment();
    AssetPayment offsetPayment1 = assetPayments.get(2);
    assertOffsetPayment(testDataPayment, offsetPayment1);

    // Assert offset payment 2
    testDataPayment = AssetTransferFixture.PAYMENT2_WITH_OFFSET.newAssetPayment();
    AssetPayment offsetPayment2 = assetPayments.get(3);
    assertOffsetPayment(testDataPayment, offsetPayment2);

    // Assert new payment 1
    testDataPayment = AssetTransferFixture.PAYMENT1_WITH_OFFSET.newAssetPayment();
    AssetPayment newPayment1 = assetPayments.get(4);
    assertNewPayment(document, testDataPayment, newPayment1);

    // Assert new payment 2
    testDataPayment = AssetTransferFixture.PAYMENT2_WITH_OFFSET.newAssetPayment();
    AssetPayment newPayment2 = assetPayments.get(5);
    assertNewPayment(document, testDataPayment, newPayment2);
}
 
开发者ID:kuali,项目名称:kfs,代码行数:56,代码来源:AssetTransferServiceTest.java


注:本文中的org.kuali.rice.krad.service.BusinessObjectService.retrieve方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。