system/src/sc/lang/sql/SQLFileModel.java
public boolean hasTableReference(SQLFileModel other) {
      TreeSet<String> tableRefs = new TreeSet<String>();
      if (sqlCommands != null && other.sqlCommands != null) {
         for (SQLCommand cmd:sqlCommands)
            cmd.addTableReferences(tableRefs);
         for (SQLCommand cmd:other.sqlCommands) {
            if (cmd instanceof CreateTable) {
               if (tableRefs.contains(((CreateTable) cmd).tableName.toString()))
                  return true;
            }
         }
      }
      return false;
   }
/* TODO: Currently we sort for each type using the table's columns references clauses. Within a type, tables are sorted
    * based on their role primary, auxiliary, multi, sequences, indexes, functions. Do we need a finer grained way to sort
    * like this?
   static class ReferenceContext {
      TreeSet<String> tableRefs = new TreeSet<String>();
      TreeSet<String> seqRefs = new TreeSet<String>();
      TreeSet<String> indexRefs = new TreeSet<String>();
      TreeSet<String> funcRefs = new TreeSet<String>();
   }
   */
Currently we sort for each type using the table's columns references clauses. Within a type, tables are sorted
based on their role primary, auxiliary, multi, sequences, indexes, functions. Do we need a finer grained way to sort
like this.
Currently we sort for each type using the table ' s columns references clauses . Within a type tables are sorted based on their role primary auxiliary multi sequences indexes functions . Do we need a finer grained way to sort like this .
public boolean hasTableReference(SQLFileModel other) {
      TreeSet<String> tableRefs = new TreeSet<String>();
      if (sqlCommands != null && other.sqlCommands != null) {
         for (SQLCommand cmd:sqlCommands)
            cmd.addTableReferences(tableRefs);
         for (SQLCommand cmd:other.sqlCommands) {
            if (cmd instanceof CreateTable) {
               if (tableRefs.contains(((CreateTable) cmd).tableName.toString()))
                  return true;
            }
         }
      }
      return false;
   }
public boolean hasTableReference ( SQLFileModel other ) { TreeSet < String > tableRefs = new TreeSet < String > ( ) ; if ( sqlCommands != null && other . sqlCommands != null ) { for ( SQLCommand cmd : sqlCommands ) cmd . addTableReferences ( tableRefs ) ; for ( SQLCommand cmd : other . sqlCommands ) { if ( cmd instanceof CreateTable ) { if ( tableRefs . contains ( ( ( CreateTable ) cmd ) . tableName . toString ( ) ) ) return true ; } } } return false ; }
TODO: Currently we sort for each type using the table's columns references clauses.
TODO : Currently we sort for each type using the table ' s columns references clauses .