/** * Convenience method that creates a selector name object using the supplied * string. * * @param name * the name of the selector; may not be null * @return the selector name; never null */ protected SelectorName selector(String name) { return new SelectorName(name.trim()); }
/** * Utility method that does all the work of the clear, but with a flag that * defines whether to clear the first query. This method is used by * {@link #clear()} as well as the {@link #union() many} {@link #intersect() * set} {@link #except() operations}. * * @param clearFirstQuery * true if the first query should be cleared, or false if the first * query should be retained * @return this builder object, for convenience in method chaining */ protected QueryBuilder clear(boolean clearFirstQuery) { source = new Selector(new SelectorName("__not:defined__")); constraint = null; columns = new LinkedList<Column>(); orderings = new LinkedList<Ordering>(); limit = Limit.NONE; distinct = false; if (clearFirstQuery) { this.firstQuery = null; } return this; }
/** * Add a table with the supplied name and column names. Each column will * be given a default type. The table will also overwrite any existing * table definition with the same name. * * @param name * the name of the new table * @param columnNames * the names of the columns. * @return this builder, for convenience in method chaining; never null */ public Builder addTable(String name, String... columnNames) { Validate.notEmpty(name, " name may not be empty"); Validate.notEmpty(columnNames, "columnNames may not be empty"); List<Column> columns = new ArrayList<Column>(); int i = 0; for (String columnName : columnNames) { Validate.notEmpty(columnName, "columnName[" + (i++) + "] may not be empty");; // TODO default type columns.add(new InMemoryColumn(columnName, PropertyType.STRING)); } InMemoryTable table = new InMemoryTable(new SelectorName(name), columns); tables.put(table.getName(), table); return this; }
final SelectorName name = new SelectorName(tableName);
columns.add(new InMemoryColumn(columnName, types[i])); InMemoryTable table = new InMemoryTable(new SelectorName(name), columns); tables.put(table.getName(), table); return this;
Validate.notEmpty(columnName, " columnName may not be empty"); Validate.notNull(type, " type may not be null"); SelectorName selector = new SelectorName(tableName); InMemoryTable existing = tables.get(selector); InMemoryTable table = null;
SelectorName selector = new SelectorName(tableName); InMemoryTable existing = tables.get(selector); InMemoryTable table = null;
public final SelectorName qualifier() throws RecognitionException { SelectorName res = null; String i = null; try { // org/xcmis/search/parser/CMISSQLTreeWalker.g:1075:3: ( ^( QUALIFIER i= id ) ) // org/xcmis/search/parser/CMISSQLTreeWalker.g:1076:3: ^( QUALIFIER i= id ) { match(input,QUALIFIER,FOLLOW_QUALIFIER_in_qualifier2524); match(input, Token.DOWN, null); pushFollow(FOLLOW_id_in_qualifier2528); i=id(); state._fsp--; match(input, Token.UP, null); res=new SelectorName(i); } } catch (RecognitionException e) { throw e; } finally { } return res; } // $ANTLR end "qualifier"
public final SelectorName correlationName() throws RecognitionException { SelectorName res = null; String i = null; try { // org/xcmis/search/parser/CMISSQLTreeWalker.g:1093:3: ( ^( CORRELATION_NAME i= id ) ) // org/xcmis/search/parser/CMISSQLTreeWalker.g:1094:3: ^( CORRELATION_NAME i= id ) { match(input,CORRELATION_NAME,FOLLOW_CORRELATION_NAME_in_correlationName2594); match(input, Token.DOWN, null); pushFollow(FOLLOW_id_in_correlationName2598); i=id(); state._fsp--; match(input, Token.UP, null); res=new SelectorName(i); } } catch (RecognitionException e) { throw e; } finally { } return res; } // $ANTLR end "correlationName"
public final SelectorName tableName() throws RecognitionException { SelectorName res = null; String i = null; try { // org/xcmis/search/parser/CMISSQLTreeWalker.g:1084:3: ( ^( TABLE_NAME i= id ) ) // org/xcmis/search/parser/CMISSQLTreeWalker.g:1085:3: ^( TABLE_NAME i= id ) { match(input,TABLE_NAME,FOLLOW_TABLE_NAME_in_tableName2559); match(input, Token.DOWN, null); pushFollow(FOLLOW_id_in_tableName2563); i=id(); state._fsp--; match(input, Token.UP, null); res=new SelectorName(i); } } catch (RecognitionException e) { throw e; } finally { } return res; } // $ANTLR end "tableName"