Package com.draagon.meta.manager.db.defs

Examples of com.draagon.meta.manager.db.defs.BaseTableDef


    // Construct the SELECT query
    StringBuilder query = new StringBuilder();
    query.append("SELECT COUNT(*) FROM ");
       
    char prefix = 'A';
    BaseTableDef base = (BaseTableDef) omdb.getDBDef();
    while ( base != null ) {
      // Get the components of the SELECT query
      String tableStr = getProperName( base.getNameDef() );
      query.append(tableStr).append( ' ' ).append( prefix );
     
      if ( base instanceof TableDef ) {
       
        TableDef table = (TableDef) base;
        base = null;
       
        InheritenceDef idef = table.getInheritence();     
        if ( idef != null ) {
          base = idef.getRefTable();
          prefix++;
         
          query.append( " LEFT JOIN " );
          tableStr = getProperName( base.getNameDef() );
          query.append(tableStr).append( ' ' ).append( prefix );
          query.append( " ON " );
          query.append( prefix-- ).append( idef.getColumnName() )
            .append( "=" ).append( prefix ).append( idef.getRefColumn().getName() );
        }
View Full Code Here


    query.append(fieldStr);
   
    query.append(" FROM ");
   
    char prefix = 'A';
    BaseTableDef base = (BaseTableDef) omdb.getDBDef();
    while ( base != null ) {
      // Get the components of the SELECT query
      String tableStr = getProperName( base.getNameDef() );
      query.append(tableStr).append( ' ' ).append( prefix );
     
      if ( base instanceof TableDef ) {
       
        TableDef table = (TableDef) base;
        base = null;
       
        InheritenceDef idef = table.getInheritence();     
        if ( idef != null ) {
          base = idef.getRefTable();
          prefix++;
         
          query.append( " LEFT JOIN " );
          tableStr = getProperName( base.getNameDef() );
          query.append(tableStr).append( ' ' ).append( prefix );
          query.append( " ON " );
          query.append( prefix-- ).append( idef.getColumnName() )
            .append( "=" ).append( prefix ).append( idef.getRefColumn().getName() );
        }
View Full Code Here

TOP

Related Classes of com.draagon.meta.manager.db.defs.BaseTableDef

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.