anchor.diff:  			case Query.ACTION_COUNT:
   			case Query.ACTION_SELECT:
   			default:
  -				var columns_stmnt = this.getColumnsClause(conn);
  +				QueryStatement columns_stmnt = this.getColumnsClause(conn);
   				stmnt.addIdentifiers(columns_stmnt.getIdentifiers());
   				stmnt.addParams(columns_stmnt.getParams());
   				qry_s.write('SELECT ${columns_stmnt.getString()}\nFROM ');
   				break;
   		}
   
  -		var table_stmnt = this.getTablesClause(conn);
  +		QueryStatement table_stmnt = this.getTablesClause(conn);
   		stmnt.addIdentifiers(table_stmnt.getIdentifiers());
   		stmnt.addParams(table_stmnt.getParams());
   		qry_s.write(table_stmnt.getString());
   
   		if (null != _joins && !this._joins.isEmpty) {
  -			var join_stmnt;
  +			QueryStatement join_stmnt;
   			for (QueryJoin join in this._joins) {
   				join_stmnt = join.getQueryStatement(conn);
   				qry_s.write("\n\t");
  -				qry_s.write(join_stmnt.string);
  -				stmnt.addParams(join_stmnt.params);
  -				stmnt.addIdentifiers(join_stmnt.identifiers);
  +				qry_s.write(join_stmnt.getString());
  +				stmnt.addParams(join_stmnt.getParams());
  +				stmnt.addIdentifiers(join_stmnt.getIdentifiers());
   			}
   		}
   
  
positive.code: 		}
  
  		if (null != _groups && !this._groups.isEmpty) {
  			var clause = this.getGroupByClause();
  			stmnt.addIdentifiers(clause.getIdentifiers());
  			stmnt.addParams(clause.getParams());
  			qry_s.write(clause.getString());
  
negative.code: 			throw new Exception('No table specified.');
  		}
  
  		QueryStatement statement = new QueryStatement(conn);
  		String alias = this.getAlias();
  
  		QueryStatement table_statement;
  		String table_string;
  
  		// if table is a Query, get its QueryStatement
  