Examples of SqlAscendingExpression


Examples of org.araneaframework.backend.list.sqlexpr.order.SqlAscendingExpression

  public void testSqlAscendingExpression() {
    log.debug("Testing SqlAscendingExpression");
    // constructing
    try {
      new SqlAscendingExpression(null);
      fail("Constructing of SqlAscendingExpression with NULL as SqlExpression argument should fail");
    } catch (Exception e) {
      // normal
    }

    // SQL String
    assertEquals("SqlAscendingExpression must return \" ASC\"",
        new SqlAscendingExpression(new MockSqlStringExpression(""))
            .toSqlString(), " ASC");
    assertEquals("SqlAscendingExpression must return \"a ASC\"",
        new SqlAscendingExpression(new MockSqlStringExpression("a"))
            .toSqlString(), "a ASC");

    // SQL arguments
    assertTrue("SqlAscendingExpression must return an empty array", Arrays
        .equals(new SqlAscendingExpression(new MockSqlStringExpression(""))
            .getValues(), new Object[0]));
    assertTrue("SqlAscendingExpression must return an empty array", Arrays
        .equals(new SqlAscendingExpression(new MockSqlStringExpression(
            new Object[0])).getValues(), new Object[0]));
    assertTrue("SqlAscendingExpression must return (\"a\") as values", Arrays
        .equals(new SqlAscendingExpression(new MockSqlStringExpression(
            new Object[] { "a" })).getValues(),
            new Object[] { "a" }));
  }
View Full Code Here

Examples of org.araneaframework.backend.list.sqlexpr.order.SqlAscendingExpression

 
  class VariableComparatorTranslator implements CompExprToSqlExprTranslator {
    public SqlExpression translate(ComparatorExpression expr, CompExprToSqlExprBuilder builder) {
      log.debug("Translating VariableComparatorExpression");
      VariableComparatorExpression compExpr = (VariableComparatorExpression) expr;
      return new SqlAscendingExpression(translateVariableComparatorInternal(compExpr));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.