public final void makeTableSqlFromXml(final TableSql pTableSql,
    final Class<?> pClazz) throws Exception {
    pTableSql.setVersionAlgorithm(Integer.parseInt(this.mngSettings
      .lazClsSts(pClazz).get("versionAlgorithm")));
    pTableSql.setIdColumnsNames(this.mngSettings.lazClsSts(pClazz)
      .get("idColumnsNames").split(","));
    pTableSql.setIdFieldName(this.mngSettings.lazClsSts(pClazz)
      .get("idFieldName"));
    if (pTableSql.getIdFieldName() == null) {
      throw new ExceptionWithCode(ExceptionWithCode.CONFIGURATION_MISTAKE,
        "Where is no field ID name for class: " + pClazz.getSimpleName());
    }
    pTableSql.setOwnerFieldName(this.mngSettings.lazClsSts(pClazz)
      .get("ownerFieldName"));
    Field[] fields = getUtlReflection().retrieveFields(pClazz);
    for (Field field : fields) {
      Map<String, String> fldSts = this.mngSettings
        .lazFldSts(pClazz, field.getName());
      if (fldSts != null) {
        FieldSql fieldSql = new FieldSql();
        String definition = fldSts.get("definition");
        if (definition != null) {
          String isNullableStr = fldSts.get("isNullable");
          if (!Boolean.valueOf(isNullableStr)
            && !definition.contains("not null")) {
            definition += " not null";
          }
        }
        fieldSql.setDefinition(definition);
        pTableSql.getFieldsMap().put(field.getName(), fieldSql);
      }
    }
  }
public final void makeTableSqlFromXml ( final TableSql pTableSql , final Class < ? > pClazz ) throws Exception { pTableSql . setVersionAlgorithm ( Integer . parseInt ( this . mngSettings . lazClsSts ( pClazz ) . get ( "versionAlgorithm" ) ) ) ; pTableSql . setIdColumnsNames ( this . mngSettings . lazClsSts ( pClazz ) . get ( "idColumnsNames" ) . split ( "," ) ) ; pTableSql . setIdFieldName ( this . mngSettings . lazClsSts ( pClazz ) . get ( "idFieldName" ) ) ; if ( pTableSql . getIdFieldName ( ) == null ) { throw new ExceptionWithCode ( ExceptionWithCode . CONFIGURATION_MISTAKE , "Where is no field ID name for class: " + pClazz . getSimpleName ( ) ) ; } pTableSql . setOwnerFieldName ( this . mngSettings . lazClsSts ( pClazz ) . get ( "ownerFieldName" ) ) ; Field [ ] fields = getUtlReflection ( ) . retrieveFields ( pClazz ) ; for ( Field field : fields ) { Map < String , String > fldSts = this . mngSettings . lazFldSts ( pClazz , field . getName ( ) ) ; if ( fldSts != null ) { FieldSql fieldSql = new FieldSql ( ) ; String definition = fldSts . get ( "definition" ) ; if ( definition != null ) { String isNullableStr = fldSts . get ( "isNullable" ) ; if ( ! Boolean . valueOf ( isNullableStr ) && ! definition . contains ( "not null" ) ) { definition += " not null" ; } } fieldSql . setDefinition ( definition ) ; pTableSql . getFieldsMap ( ) . put ( field . getName ( ) , fieldSql ) ; } } }
<p>Make TableSql from XML properties.</p>
@param pTableSql tableSql
@param pClazz entity class
@throws Exception - any exception