docs: @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();
            }
          }
        }
      }
    }