Example #1
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;
  }
Example #2
0
 /**
  *
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  *
  * @generated
  */
 public void beforePreExecuteGetCreditInfo(DWLTransaction transaction) throws DWLBaseException {
   // Check if the parameters are valid.
   Object[] arguments = getInquiryArgumentType((DWLTransactionInquiry) transaction);
   String pk = null;
   if (arguments != null && arguments.length > 0) {
     pk = (String) arguments[0];
   }
   // Check if the parameter passed in exists.
   if ((pk == null) || (pk.trim().length() == 0)) {
     TCRMExceptionUtils.throwTCRMException(
         null,
         new TCRMReadException(),
         transaction.getStatus(),
         DWLStatus.FATAL,
         AdditionsComponentID.CREDIT_INFO_BOBJ,
         TCRMErrorCode.FIELD_VALIDATION_ERROR,
         AdditionsErrorReasonCode.CREDITINFO_CREDITINFOPKID_NULL,
         transaction.getTxnControl(),
         errHandler);
   }
 }