Package org.apache.ws.jaxme.sqls

Examples of org.apache.ws.jaxme.sqls.Expression


  public void testExpressions() {
    Table t = getBasicTable();
    SelectStatement st = t.getSelectStatement();
    SelectTableReference ref = st.getSelectTableReference();
    BooleanConstraint bc = st.getWhere().createGT();
    Expression e1 = bc.createSUM();
    e1.addPart(ref.newColumnReference("MyIndex"));
    e1.addPart(3);
    Expression e2 = bc.createSUM();
    e2.addPart(5);
        SQLGenerator gen = getSQLGenerator();
        String got = gen.getQuery(st);
    String expect = "SELECT MyIndex, MyName, MyDate FROM MySchema.MyTable WHERE (MyIndex+3)>5";
    assertEquals(expect, got);
  }
View Full Code Here


        add(pCase);
    }

  private Expression newExpression(Expression.Type pType) {
    Statement st = getStatement();
    Expression result = st.getSQLFactory().getObjectFactory().createExpression(st, pType);
    addPart(result);
    return result;
  }
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.sqls.Expression

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.