<p>Create put CnvTfsHasId(Integer).</p>
@param pBeanName - bean name
@param pClass - bean class
@param pIdName - bean ID name
@return requested CnvTfsHasId(Integer)
@throws Exception - an exception
2926
protected final CnvTfsHasId<IHasId<Integer>, Integer>
    createHasIntegerIdConverter(final String pBeanName,
      final Class pClass, final String pIdName) throws Exception {
    CnvTfsHasId<IHasId<Integer>, Integer> convrt =
      new CnvTfsHasId<IHasId<Integer>, Integer>();
    convrt.setUtlReflection(getUtlReflection());
    convrt.setIdConverter(lazyGetCnvTfsInteger());
    convrt.init(pClass, pIdName);
    this.convertersMap.put(pBeanName, convrt);
    return convrt;
  }
221941
protected final PrcEntityFSave<RS, IHasId<Object>, Object>
    createPutPrcEntityFSave(
      final Map<String, Object> pAddParam) throws Exception {
    @SuppressWarnings("unchecked")
    PrcEntityFSave<RS, IHasId<Object>, Object> proc =
      (PrcEntityFSave<RS, IHasId<Object>, Object>)
        this.fctBnEntitiesProcessors
          .lazyGet(pAddParam, PrcEntityFSave.class.getSimpleName());
    //assigning fully initialized object:
    this.processorsMap.put(PrcEntityFSave.class.getSimpleName(), proc);
    return proc;
  }
158008
@Override
  public final IProcessor lazyGet(
    final Map<String, Object> pAddParam,
      final String pBeanName) throws Exception {
    IProcessor proc =
      this.processorsMap.get(pBeanName);
    if (proc == null) {
      // locking:
      synchronized (this.processorsMap) {
        // make sure again whether it's null after locking:
        proc = this.processorsMap.get(pBeanName);
        if (proc == null) {
          if (pBeanName.equals(PrcEntitiesPage.class.getSimpleName())) {
            proc = createPutPrcEntitiesPage();
          } else if (pBeanName.equals(PrcRefreshHndlI18n
            .class.getSimpleName())) {
            proc = lazyGetPrcRefreshHndlI18n(pAddParam);
          } else if (pBeanName.equals(PrcAbout.class.getSimpleName())) {
            proc = lazyGetPrcAbout(pAddParam);
          }
        }
      }
    }
    if (proc == null && !this.isItSubfactory) {
      throw new ExceptionWithCode(ExceptionWithCode.CONFIGURATION_MISTAKE,
        "There is no processor with name " + pBeanName);
    }
    return proc;
  }
1044305
@Override
  public final void set(final String pBeanName,
    final IProcessor pBean) throws Exception {
    //only PPL processor:
    if ("PrPpl".equals(pBeanName)) {
      this.processorsMap.put(pBeanName, pBean);
    } else {
      throw new Exception("Setting is not allowed!");
    }
  }
546138
@Override
  public final synchronized void set(final String pBeanName,
    final IConverterToFromString<?> pBean) throws Exception {
    this.convertersMap.put(pBeanName, pBean);
  }
343323
@Override
  public final <T> void insertEntity(final Map<String, Object> pAddParam,
    final T pEntity) throws Exception {
    ColumnsValues columnsValues = evalColumnsValues(pAddParam, pEntity);
    long result = getSrvDatabase().executeInsert(pEntity.getClass()
      .getSimpleName().toUpperCase(), columnsValues);
    if (result != 1) {
      String query = getHlpInsertUpdate().evalSqlInsert(pEntity.getClass()
        .getSimpleName().toUpperCase(), columnsValues);
      throw new ExceptionWithCode(ISrvDatabase.ERROR_INSERT_UPDATE,
        "It should be 1 row inserted but it is "
          + result + ", query:\n" + query + ";\n");
    }
    String[] idName = columnsValues.getIdColumnsNames();
    if (idName.length == 1) { // if non-composite PK
      Field fieldId = getUtlReflection()
        .retrieveField(pEntity.getClass(), idName[0]);
      fieldId.setAccessible(true);
      Object idValue = fieldId.get(pEntity);
      if (idValue == null) {
        //It must be an autogenerated Integer or Long ID
        IRecordSet<RS> recordSet = null;
        try {
          String insertedIdName = "INSERTEDID";
          recordSet = getSrvDatabase().retrieveRecords(
            "select SCOPE_IDENTITY() as " + insertedIdName + ";");
          recordSet.moveToFirst();
          if (fieldId.getType() == Long.class) {
            fieldId.set(pEntity, recordSet.getLong(insertedIdName));
          } else if (fieldId.getType() == Integer.class) {
            fieldId.set(pEntity, recordSet.getInteger(insertedIdName));
          } else {
            String msg = "There is no rule to fill ID "
              + fieldId.getName().toUpperCase()
                + " of " + fieldId.getType() + " in "
                  + pEntity;
            throw new ExceptionWithCode(ExceptionWithCode.NOT_YET_IMPLEMENTED,
              msg);
          }
        } finally {
          if (recordSet != null) {
            recordSet.close();
          }
        }
      }
    }
  }
502262
protected final CnvHasVersionToColumnsValues
    lazyGetCnvHasVersionToColumnsValues(
      final Class pBeanClass) throws Exception {
    @SuppressWarnings("unchecked")
    CnvHasVersionToColumnsValues<IHasVersion> convrt =
      (CnvHasVersionToColumnsValues<IHasVersion>)
        this.convertersMap.get(pBeanClass);
    if (convrt == null) {
      convrt = new CnvHasVersionToColumnsValues<IHasVersion>();
      convrt.setCnvObjectToColumnsValues(
        lazyGetCnvObjectToColumnsValues(pBeanClass));
      //assigning fully initialized object:
      this.convertersMap.put(pBeanClass, convrt);
    }
    return convrt;
  }
118145
@Override
  public final IConverterIntoByName<?, ColumnsValues> lazyGet(
    final Map<String, Object> pAddParam,
      final String pBeanName) throws Exception {
    IConverterIntoByName<?, ColumnsValues> convrt =
      this.convertersMap.get(pBeanName);
    if (convrt == null) {
      // locking:
      synchronized (this.convertersMap) {
        // make sure again whether it's null after locking:
        convrt = this.convertersMap.get(pBeanName);
        if (convrt == null) {
          if (pBeanName
            .equals(CnvIbnLongToCv.class.getSimpleName())) {
            convrt = createPutCnvIbnLongToCv();
          } else if (pBeanName
            .equals(CnvIbnFloatToCv.class.getSimpleName())) {
            convrt = createPutCnvIbnFloatToCv();
          } else if (pBeanName
            .equals(CnvIbnDoubleToCv.class.getSimpleName())) {
            convrt = createPutCnvIbnDoubleToCv();
          } else if (pBeanName
            .equals(CnvIbnBigDecimalToCv.class.getSimpleName())) {
            convrt = createPutCnvIbnBigDecimalToCv();
          } else if (pBeanName
            .equals(CnvIbnBooleanToCv.class.getSimpleName())) {
            convrt = createPutCnvIbnBooleanToCv();
          } else if (pBeanName
            .equals(CnvIbnDateToCv.class.getSimpleName())) {
            convrt = createPutCnvIbnDateToCv();
          } else if (pBeanName
            .equals(CnvIbnEnumToCv.class.getSimpleName())) {
            convrt = createPutCnvIbnEnumToCv();
          } else if (pBeanName
            .equals(CnvIbnStringToCv.class.getSimpleName())) {
            convrt = createPutCnvIbnStringToCv();
          } else if (pBeanName
            .equals(CnvIbnEntitiesToCv.class.getSimpleName())) {
            convrt = createPutCnvIbnEntitiesToCv();
          } else if (pBeanName
            .equals(CnvIbnVersionToCv.class.getSimpleName())) {
            convrt = createPutCnvIbnVersionToCv();
          } else if (pBeanName
            .equals(CnvIbnIntegerToCv.class.getSimpleName())) {
            convrt = createPutCnvIbnIntegerToCv();
          }
        }
      }
    }
    if (convrt == null) {
      throw new ExceptionWithCode(ExceptionWithCode.CONFIGURATION_MISTAKE,
        "There is no converter with name " + pBeanName);
    }
    return convrt;
  }
933826
protected final CnvTfsDateTimeSec
    createPutCnvTfsDateTimeSec() throws Exception {
    CnvTfsDateTimeSec convrt = new CnvTfsDateTimeSec();
    this.convertersMap.put(CnvTfsDateTimeSec.class
      .getSimpleName(), convrt);
    return convrt;
  }
489091
@Override
  public final synchronized void set(final String pBeanName,
    final IEntityFileReporter pBean) throws Exception {
    this.reportersMap.put(pBeanName, pBean);
  }
926790
@Override
  public final IConverterByName<IRecordSet<RS>, ?> lazyGet(
    final Map<String, Object> pAddParam,
      final String pBeanName) throws Exception {
    IConverterByName<IRecordSet<RS>, ?> convrt =
      this.convertersMap.get(pBeanName);
    if (convrt == null) {
      // locking:
      synchronized (this.convertersMap) {
        // make sure again whether it's null after locking:
        convrt = this.convertersMap.get(pBeanName);
        if (convrt == null) {
          if (pBeanName
            .equals(CnvBnRsToFloat.class.getSimpleName())) {
            convrt = createPutCnvBnRsToFloat();
          } else if (pBeanName
            .equals(CnvBnRsToEnum.class.getSimpleName())) {
            convrt = createPutCnvBnRsToEnum();
          } else if (pBeanName
            .equals(CnvBnRsToEntity.class.getSimpleName())) {
            convrt = createPutCnvBnRsToEntity();
          } else if (pBeanName
            .equals(CnvBnRsToDouble.class.getSimpleName())) {
            convrt = createPutCnvBnRsToDouble();
          } else if (pBeanName
            .equals(CnvBnRsToInteger.class.getSimpleName())) {
            convrt = createPutCnvBnRsToInteger();
          } else if (pBeanName
            .equals(CnvBnRsToLong.class.getSimpleName())) {
            convrt = createPutCnvBnRsToLong();
          } else if (pBeanName
            .equals(CnvBnRsToBoolean.class.getSimpleName())) {
            convrt = createPutCnvBnRsToBoolean();
          } else if (pBeanName
            .equals(CnvBnRsToDate.class.getSimpleName())) {
            convrt = createPutCnvBnRsToDate();
          } else if (pBeanName
            .equals(CnvBnRsToString.class.getSimpleName())) {
            convrt = createPutCnvBnRsToString();
          } else if (pBeanName
            .equals(CnvBnRsToBigDecimal.class.getSimpleName())) {
            convrt = createPutCnvBnRsToBigDecimal();
          }
        }
      }
    }
    if (convrt == null) {
      throw new ExceptionWithCode(ExceptionWithCode.CONFIGURATION_MISTAKE,
        "There is no converter with name " + pBeanName);
    }
    return convrt;
  }
223195
@Override
  public final <T> void insertEntity(final Map<String, Object> pAddParam,
    final T pEntity) throws Exception {
    ColumnsValues columnsValues = evalColumnsValues(pAddParam, pEntity);
    columnsValues.getLongsMap().remove(ISrvOrm.VERSIONOLD_NAME);
    Long result = getSrvDatabase().executeInsert(pEntity.getClass()
      .getSimpleName().toUpperCase(), columnsValues);
    String[] idName = columnsValues.getIdColumnsNames();
    if (idName.length == 1) { // if non-composite PK
      Field fieldId = getUtlReflection()
                .retrieveField(pEntity.getClass(), idName[0]);
      fieldId.setAccessible(true);
      Object idValue = fieldId.get(pEntity);
      if (idValue == null) {
        //It must be an autogenerated Integer or Long ID
        if (fieldId.getType() == Long.class) {
          fieldId.set(pEntity, result);
        } else if (fieldId.getType() == Integer.class) {
          fieldId.set(pEntity, result.intValue());
        } else {
          String msg = "There is no rule to fill ID "
            + fieldId.getName()
              + " of " + fieldId.getType() + " in "
                + pEntity;
          throw new ExceptionWithCode(ExceptionWithCode.NOT_YET_IMPLEMENTED,
            msg);
        }
      }
    }
  }
465457
private void addException(ObjectName pName, Exception pExp) {
        JSONObject mBeansMap = getOrCreateJSONObject(infoMap, pName.getDomain());
        JSONObject mBeanMap = getOrCreateJSONObject(mBeansMap, getKeyPropertyString(pName));
        mBeanMap.put(DataKeys.ERROR.getKey(), pExp.toString());
    }
543381
protected final PrcPaymentFromSave<RS> createPutPrcPaymentFromSave(
      final Map<String, Object> pAddParam) throws Exception {
    PrcPaymentFromSave<RS> proc = new PrcPaymentFromSave<RS>();
    proc.setSrvAccSettings(getSrvAccSettings());
    proc.setSrvAccEntry(getSrvAccEntry());
    proc.setSrvOrm(getSrvOrm());
    proc.setSrvI18n(getSrvI18n());
    proc.setPrcSalesInvoiceSave(lazyGetPrcSalesInvoiceSave(pAddParam));
    //assigning fully initialized object:
    this.processorsMap.put(PrcPaymentFromSave.class.getSimpleName(), proc);
    return proc;
  }
413678
protected final FactoryAccDoc
    createPutFactoryAccDoc(
      final Class<?> pBeanClass) throws Exception {
    FactoryAccDoc factory = new FactoryAccDoc();
    factory.setObjectClass(pBeanClass);
    factory.setDatabaseId(this.srvDatabase.getIdDatabase());
    //assigning fully initialized object:
    this.factoriesMap
      .put(pBeanClass, factory);
    return factory;
  }
656418
protected final PrcAccEntityPbWithSubaccEditDelete<RS, IPersistableBase>
    createPutPrcAccEntityPbWithSubaccEditDelete(
      final Map<String, Object> pAddParam) throws Exception {
    PrcAccEntityPbWithSubaccEditDelete<RS, IPersistableBase> proc =
      new PrcAccEntityPbWithSubaccEditDelete<RS, IPersistableBase>();
    @SuppressWarnings("unchecked")
    PrcEntityPbEditDelete<RS, IPersistableBase> procDlg =
      (PrcEntityPbEditDelete<RS, IPersistableBase>) this.fctBnEntitiesProcessors
        .lazyGet(pAddParam, PrcEntityPbEditDelete.class.getSimpleName());
    proc.setPrcAccEntityPbEditDelete(procDlg);
    proc.setSrvTypeCode(getSrvTypeCode());
    //assigning fully initialized object:
    this.processorsMap
      .put(PrcAccEntityPbWithSubaccEditDelete.class.getSimpleName(), proc);
    return proc;
  }
177342
protected final PrcEntityCopy<RS, IHasId<Object>, Object>
    createPutPrcEntityCopy() throws Exception {
    PrcEntityCopy<RS, IHasId<Object>, Object> proc =
      new PrcEntityCopy<RS, IHasId<Object>, Object>();
    proc.setSrvOrm(getSrvOrm());
    proc.setMngUvdSettings(getMngUvdSettings());
    proc.setFillersFieldsFactory(getFillersFieldsFactory());
    proc.setEntitiesFactoriesFatory(getEntitiesFactoriesFatory());
    proc.setUtlProperties(getUtlProperties());
    proc.setSrvDate(getSrvDate());
    proc.setConvertersFieldsFatory(getConvertersFieldsFatory());
    proc.setFieldConverterNamesHolder(getFieldConverterNamesHolder());
    //assigning fully initialized object:
    this.processorsMap
      .put(PrcEntityCopy.class.getSimpleName(), proc);
    return proc;
  }