Beispiel #1
0
  /**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * Updates the specified CreditInfo with new attribute values.
   *
   * @param theCreditInfoBObj The object that contains CreditInfo attribute values to be updated
   * @return DWLResponse containing a CreditInfoBObj of the updated object.
   * @exception Exception
   * @generated
   */
  public DWLResponse handleUpdateCreditInfo(CreditInfoBObj theCreditInfoBObj) throws Exception {

    DWLStatus status = theCreditInfoBObj.getStatus();

    if (status == null) {
      status = new DWLStatus();
      theCreditInfoBObj.setStatus(status);
    }

    // set lastupdatetxid with txnid from dwlcontrol
    theCreditInfoBObj
        .getEObjCreditInfo()
        .setLastUpdateTxId(new Long(theCreditInfoBObj.getControl().getTxnId()));
    Persistence theCreditInfoBObjPersistence =
        getBObjPersistenceFactory()
            .createCreditInfoBObjPersistence(
                CreditInfoBObjQuery.CREDIT_INFO_UPDATE, theCreditInfoBObj);
    theCreditInfoBObjPersistence.persistUpdate();

    DWLResponse response = createDWLResponse();
    response.setData(theCreditInfoBObj);
    response.setStatus(theCreditInfoBObj.getStatus());

    return response;
  }
Beispiel #2
0
  /**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * Gets a CreditInfo from the database.
   *
   * @generated
   */
  public DWLResponse handleGetCreditInfobyPartyId(String PartyId, DWLControl control)
      throws Exception {
    DWLStatus status = new DWLStatus();
    DWLResponse response = createDWLResponse();

    BObjQuery bObjQuery = null;

    String asOfDate = (String) control.get(DWLControl.INQUIRE_AS_OF_DATE);

    // History data inquiry: if inquireAsOfDate field has value in request xml
    if (StringUtils.isNonBlank(asOfDate)) {
      Timestamp tsAsOfDate =
          getPITHistoryDate(
              asOfDate,
              AdditionsComponentID.ADDITIONS_COMPONENT,
              AdditionsErrorReasonCode.GETCREDITINFOBYPARTYID_INVALID_INQUIRE_AS_OF_DATE_FORMAT,
              status,
              control);

      bObjQuery =
          getBObjQueryFactory()
              .createCreditInfoBObjQuery(
                  CreditInfoBObjQuery.CREDIT_INFOBY_PARTY_ID_HISTORY_QUERY, control);
      bObjQuery.setParameter(0, DWLFunctionUtils.getLongFromString(PartyId));
      bObjQuery.setParameter(1, tsAsOfDate);
      bObjQuery.setParameter(2, tsAsOfDate);
    } else {
      bObjQuery =
          getBObjQueryFactory()
              .createCreditInfoBObjQuery(CreditInfoBObjQuery.CREDIT_INFOBY_PARTY_ID_QUERY, control);
      bObjQuery.setParameter(0, DWLFunctionUtils.getLongFromString(PartyId));
    }

    CreditInfoBObj o = (CreditInfoBObj) bObjQuery.getSingleResult();
    if (o == null) {
      return null;
    }

    if (o.getStatus() == null) {
      o.setStatus(status);
    }
    response.addStatus(o.getStatus());
    response.setData(o);

    return response;
  }
Beispiel #3
0
  /**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   *
   * @generated
   */
  public void loadBeforeImage(CreditInfoBObj bObj) throws DWLBaseException {
    logger.finest("ENTER loadBeforeImage(CreditInfoBObj bObj)");
    if (bObj.BeforeImage() == null) {

      CreditInfoBObj beforeImage = null;
      DWLResponse response = null;

      try {
        response = getCreditInfo(bObj.getCreditInfopkId(), bObj.getControl());
        beforeImage = (CreditInfoBObj) response.getData();

      } catch (Exception e) {
        if (logger.isFinestEnabled()) {
          String infoForLogging =
              "Error: Exception " + e.getMessage() + " while updating a record ";
          logger.finest("loadBeforeImage(CreditInfoBObj bObj) " + infoForLogging);
        }
        DWLExceptionUtils.throwDWLBaseException(
            e,
            new DWLUpdateException(e.getMessage()),
            bObj.getStatus(),
            DWLStatus.FATAL,
            AdditionsComponentID.CREDIT_INFO_BOBJ,
            "DIERR",
            AdditionsErrorReasonCode.CREDITINFO_BEFORE_IMAGE_NOT_POPULATED,
            bObj.getControl(),
            errHandler);
      }

      if (beforeImage == null) {
        if (logger.isFinestEnabled()) {
          String infoForLogging = "Error: Before image for updating a record is null ";
          logger.finest("loadBeforeImage(CreditInfoBObj bObj) " + infoForLogging);
        }
        DWLExceptionUtils.throwDWLBaseException(
            new DWLUpdateException(),
            bObj.getStatus(),
            DWLStatus.FATAL,
            AdditionsComponentID.CREDIT_INFO_BOBJ,
            "DIERR",
            AdditionsErrorReasonCode.CREDITINFO_BEFORE_IMAGE_NOT_POPULATED,
            bObj.getControl(),
            errHandler);
      }

      bObj.setBeforeImage(beforeImage);
    }
    logger.finest("RETURN loadBeforeImage(CreditInfoBObj bObj)");
  }
Beispiel #4
0
 /**
  *
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  * Executes the transaction updateCreditInfo.
  *
  * @param theBObj
  * @return com.dwl.base.DWLResponse
  * @exception DWLBaseException
  * @see #handleUpdateCreditInfo
  * @generated
  */
 @TxMetadata(
     actionCategory = DWLControlKeys.UPDATE_ACTION_CATEGORY,
     txErrorCode = TCRMErrorCode.UPDATE_RECORD_ERROR,
     txErrorReasonCode = AdditionsErrorReasonCode.UPDATECREDITINFO_FAILED)
 public DWLResponse updateCreditInfo(CreditInfoBObj theBObj) throws DWLBaseException {
   logger.finest("ENTER updateCreditInfo(CreditInfoBObj theBObj)");
   DWLTransaction txObj =
       new DWLTransactionPersistent("updateCreditInfo", theBObj, theBObj.getControl());
   DWLResponse retObj = null;
   if (logger.isFinestEnabled()) {
     String infoForLogging = "Before execution of transaction updateCreditInfo.";
     logger.finest("updateCreditInfo(CreditInfoBObj theBObj) " + infoForLogging);
   }
   retObj = executeTx(txObj);
   if (logger.isFinestEnabled()) {
     String infoForLogging = "After execution of transaction updateCreditInfo.";
     logger.finest("updateCreditInfo(CreditInfoBObj theBObj) " + infoForLogging);
     String returnValue = retObj.toString();
     logger.finest("RETURN updateCreditInfo(CreditInfoBObj theBObj) " + returnValue);
   }
   return retObj;
 }
Beispiel #5
0
  /**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * Adds a CreditInfo to the database.
   *
   * @param theCreditInfoBObj The object that contains CreditInfo attribute values.
   * @return DWLResponse containing a CreditInfoBObj object.
   * @exception Exception
   * @generated
   */
  public DWLResponse handleAddCreditInfo(CreditInfoBObj theCreditInfoBObj) throws Exception {
    DWLResponse response = null;
    DWLStatus status = theCreditInfoBObj.getStatus();
    if (status == null) {
      status = new DWLStatus();
      theCreditInfoBObj.setStatus(status);
    }

    String strPluggableID = null;

    try {
      // Pluggable Key Structure implementation
      strPluggableID = getSuppliedIdPKFromBObj(theCreditInfoBObj);

      if ((strPluggableID != null) && (strPluggableID.length() > 0)) {
        theCreditInfoBObj
            .getEObjCreditInfo()
            .setCreditInfopkId(FunctionUtils.getLongFromString(strPluggableID));
      } else {
        strPluggableID = null;
        theCreditInfoBObj.getEObjCreditInfo().setCreditInfopkId(null);
      }
      Persistence theCreditInfoBObjPersistence =
          getBObjPersistenceFactory()
              .createCreditInfoBObjPersistence(
                  CreditInfoBObjQuery.CREDIT_INFO_ADD, theCreditInfoBObj);
      theCreditInfoBObjPersistence.persistAdd();

      response = new DWLResponse();
      response.setData(theCreditInfoBObj);
      response.setStatus(theCreditInfoBObj.getStatus());
    } catch (Exception ex) {
      TCRMExceptionUtils.throwTCRMException(
          ex,
          new TCRMInsertException(ex.getMessage()),
          status,
          DWLStatus.FATAL,
          AdditionsComponentID.ADDITIONS_COMPONENT,
          TCRMErrorCode.INSERT_RECORD_ERROR,
          AdditionsErrorReasonCode.ADDCREDITINFO_FAILED,
          theCreditInfoBObj.getControl(),
          errHandler);
    }

    return response;
  }