public static org.teiid.query.sql.lang.GroupBy helpExample() { List<ElementSymbol> symbols = new ArrayList<ElementSymbol>(); symbols.add(TestElementImpl.helpExample("vm1.g1", "e1")); //$NON-NLS-1$ //$NON-NLS-2$ symbols.add(TestElementImpl.helpExample("vm1.g1", "e2")); //$NON-NLS-1$ //$NON-NLS-2$ symbols.add(TestElementImpl.helpExample("vm1.g1", "e3")); //$NON-NLS-1$ //$NON-NLS-2$ symbols.add(TestElementImpl.helpExample("vm1.g1", "e4")); //$NON-NLS-1$ //$NON-NLS-2$ return new org.teiid.query.sql.lang.GroupBy(symbols); }
public static org.teiid.query.sql.lang.Select helpExampleSelect(boolean distinct) { ArrayList<ElementSymbol> symbols = new ArrayList<ElementSymbol>(); symbols.add(TestElementImpl.helpExample("vm1.g1", "e1")); //$NON-NLS-1$ //$NON-NLS-2$ symbols.add(TestElementImpl.helpExample("vm1.g1", "e2")); //$NON-NLS-1$ //$NON-NLS-2$ symbols.add(TestElementImpl.helpExample("vm1.g1", "e3")); //$NON-NLS-1$ //$NON-NLS-2$ symbols.add(TestElementImpl.helpExample("vm1.g1", "e4")); //$NON-NLS-1$ //$NON-NLS-2$ org.teiid.query.sql.lang.Select sel = new org.teiid.query.sql.lang.Select(symbols); sel.setDistinct(distinct); return sel; }
public static org.teiid.query.sql.lang.OrderBy helpExample() { ArrayList<ElementSymbol> elements = new ArrayList<ElementSymbol>(); elements.add(TestElementImpl.helpExample("vm1.g1", "e1")); //$NON-NLS-1$ //$NON-NLS-2$ elements.add(TestElementImpl.helpExample("vm1.g1", "e2")); //$NON-NLS-1$ //$NON-NLS-2$ elements.add(TestElementImpl.helpExample("vm1.g1", "e3")); //$NON-NLS-1$ //$NON-NLS-2$ elements.add(TestElementImpl.helpExample("vm1.g1", "e4")); //$NON-NLS-1$ //$NON-NLS-2$ ArrayList<Boolean> types = new ArrayList<Boolean>(); types.add(Boolean.TRUE); types.add(Boolean.FALSE); types.add(Boolean.TRUE); types.add(Boolean.FALSE); return new org.teiid.query.sql.lang.OrderBy(elements, types); }
public static ColumnReference example(String groupName, String elementName, Object metadataID) throws Exception { return TstLanguageBridgeFactory.factory.translate(helpExample(groupName, elementName, metadataID)); }
public static ColumnReference example(String groupName, String elementName) throws Exception { return TstLanguageBridgeFactory.factory.translate(helpExample(groupName, elementName)); }
public static org.teiid.query.sql.lang.GroupBy helpExampleWithFunctions() { List<Expression> symbols = new ArrayList<Expression>(); ElementSymbol e1 = TestElementImpl.helpExample("vm1.g1", "e1");//$NON-NLS-1$ //$NON-NLS-2$ Function f = new Function("length", new Expression[] { e1 } );//$NON-NLS-1$ symbols.add(e1); symbols.add(f); return new org.teiid.query.sql.lang.GroupBy(symbols); }
public static org.teiid.query.sql.lang.Insert helpExample(String groupName) { GroupSymbol group = TestGroupImpl.helpExample(groupName); ArrayList<ElementSymbol> elements = new ArrayList<ElementSymbol>(); elements.add(TestElementImpl.helpExample(groupName, "e1")); //$NON-NLS-1$ elements.add(TestElementImpl.helpExample(groupName, "e2")); //$NON-NLS-1$ elements.add(TestElementImpl.helpExample(groupName, "e3")); //$NON-NLS-1$ elements.add(TestElementImpl.helpExample(groupName, "e4")); //$NON-NLS-1$ ArrayList<Constant> values = new ArrayList<Constant>(); values.add(TestLiteralImpl.helpExample(1)); values.add(TestLiteralImpl.helpExample(2)); values.add(TestLiteralImpl.helpExample(3)); values.add(TestLiteralImpl.helpExample(4)); return new org.teiid.query.sql.lang.Insert(group, elements, values); }
public static List getWhenCriteria(int criteria) { ArrayList list = new ArrayList(); ElementSymbol x = TestElementImpl.helpExample("vm1.g1", "e1"); //$NON-NLS-1$ //$NON-NLS-2$ for (int i = 0; i < criteria; i++) { list.add(new CompareCriteria(x, CompareCriteria.EQ, new Constant(new Integer(i)))); } return list; }
public static org.teiid.query.sql.lang.Insert helpExample2(String groupName) { GroupSymbol group = TestGroupImpl.helpExample(groupName); ArrayList<ElementSymbol> elements = new ArrayList<ElementSymbol>(); elements.add(TestElementImpl.helpExample(groupName, "e1")); //$NON-NLS-1$ ArrayList<org.teiid.query.sql.symbol.Expression> values = new ArrayList<org.teiid.query.sql.symbol.Expression>(); values.add(TestSearchedCaseExpressionImpl.helpExample()); return new org.teiid.query.sql.lang.Insert(group, elements, values); }
public static SubqueryCompareCriteria helpExample() { ElementSymbol element = TestElementImpl.helpExample("g1", "e1"); //$NON-NLS-1$ //$NON-NLS-2$ Query query = TestQueryImpl.helpExample(true); SubqueryCompareCriteria scc = new SubqueryCompareCriteria(element, query, AbstractCompareCriteria.GT, SubqueryCompareCriteria.ANY); return scc; }
public static IsNullCriteria helpExample(boolean negated) { IsNullCriteria crit = new IsNullCriteria(TestElementImpl.helpExample("vm1.g1", "e1")); //$NON-NLS-1$ //$NON-NLS-2$ crit.setNegated(negated); return crit; }
public static org.teiid.query.sql.lang.Update helpExample() { GroupSymbol group = TestGroupImpl.helpExample("vm1.g1"); //$NON-NLS-1$ org.teiid.query.sql.lang.Update result = new org.teiid.query.sql.lang.Update(); result.setGroup(group); result.addChange(TestElementImpl.helpExample("vm1.g1", "e1"), new Constant(new Integer(1))); result.addChange(TestElementImpl.helpExample("vm1.g1", "e2"), new Constant(new Integer(1))); result.addChange(TestElementImpl.helpExample("vm1.g1", "e3"), new Constant(new Integer(1))); result.addChange(TestElementImpl.helpExample("vm1.g1", "e4"), new Constant(new Integer(1))); result.setCriteria(new CompareCriteria(new Constant(new Integer(1)), CompareCriteria.EQ, new Constant(new Integer(1)))); return result; }
public static SubquerySetCriteria helpExample() { ElementSymbol element = TestElementImpl.helpExample("g1", "e1"); //$NON-NLS-1$ //$NON-NLS-2$ Query query = TestQueryImpl.helpExample(true); SubquerySetCriteria ssc = new SubquerySetCriteria(element, query); ssc.setNegated(true); return ssc; }
public static JoinPredicate helpExample(JoinType type) { ElementSymbol e1 = TestElementImpl.helpExample("vm1.g1", "e1"); //$NON-NLS-1$ //$NON-NLS-2$ ElementSymbol e2 = TestElementImpl.helpExample("vm1.g2", "e1"); //$NON-NLS-1$ //$NON-NLS-2$ ArrayList criteria = new ArrayList(); criteria.add(new CompareCriteria(e1, CompareCriteria.EQ, e2)); return new JoinPredicate(new UnaryFromClause(e1.getGroupSymbol()), new UnaryFromClause(e2.getGroupSymbol()), type, criteria); }
public static MatchCriteria helpExample(String right, char escape, boolean negated) { ElementSymbol e1 = TestElementImpl.helpExample("vm1.g1", "e1"); //$NON-NLS-1$ //$NON-NLS-2$ MatchCriteria match = new MatchCriteria(e1, new Constant(right), escape); match.setNegated(negated); return match; }