Package org.araneaframework.backend.list

Examples of org.araneaframework.backend.list.SqlExpression


              .convert(value.getValue());
        }
        return value.getValue();
      }
    });
    SqlExpression sqlExpr = builder.buildSqlExpression(expr);
    String sqlString = sqlExpr.toSqlString();
    Object[] values = sqlExpr.getValues();
    log.info("SQL string: " + sqlString);
    log.info("SQL values: " + Arrays.asList(values));
  }
View Full Code Here


  }
 
  public void testValueTranslator() {
    log.debug("Testing ValueTranslator");
    Expression expr = null;
    SqlExpression tmp = null;
    try {
      expr = new ValueExpression(this.testValue);     
    }
    catch (Exception e) {
      fail("Constructing ValueExpression failed");
View Full Code Here

              .convert(value.getValue());
        }
        return value.getValue();
      }
    });
    SqlExpression sqlExpr = builder.buildSqlExpression(expr);
    String sqlString = sqlExpr.toSqlString();
    Object[] values = sqlExpr.getValues();
    log.info("SQL string: " + sqlString);
    log.info("SQL values: " + Arrays.asList(values));
  }
View Full Code Here

   * Returns the database fields list seperated by commas, which can be used in "SELECT" clause.
   *
   * @return the database fields list seperated by commas, which can be used in "SELECT" clause.
   */
  public String getDatabaseFields() {
    SqlExpression expr = this.getFieldsSqlExpression();
    return expr != null ? expr.toSqlString() : "";
  }
View Full Code Here

   * Returns the filter database condition, which can be used in "WHERE" clause.
   *
   * @return the filter database condition, which can be used in "WHERE" clause.
   */
  public String getDatabaseFilter() {
    SqlExpression expr = this.getFilterSqlExpression();
    return expr != null ? expr.toSqlString() : "";
  }
View Full Code Here

   *
   * @return the <code>List</code> of parameters that should be set in the <code>PreparedStatement</code> that
   *         belong to the filter database conditions.
   */
  public List getDatabaseFilterParams() {
    SqlExpression expr = this.getFilterSqlExpression();
    return expr != null ? Arrays.asList(expr.getValues()) : new ArrayList();
  }
View Full Code Here

   * Returns the order database representation, which can be used in "ORDER BY" clause.
   *
   * @return the order database representation, which can be used in "ORDER BY" clause.
   */
  public String getDatabaseOrder() {
    SqlExpression expr = this.getOrderSqlExpression();
    return expr != null ? expr.toSqlString() : "";
  }
View Full Code Here

   *
   * @return the <code>List</code> of parameters that should be set in the <code>PreparedStatement</code> that
   *         belong to the order database representation.
   */
  public List getDatabaseOrderParams() {
    SqlExpression expr = this.getOrderSqlExpression();
    return expr != null ? Arrays.asList(expr.getValues()) : new ArrayList();
  }
View Full Code Here

public class SqlAndExpression extends SqlMultiExpression {
  public String toSqlString() {
    StringBuffer sb = new StringBuffer();
    for (Iterator i = this.children.iterator(); i.hasNext();) {
      SqlExpression expr = (SqlExpression) i.next();
      // sb.append("(").append(expr.toSqlString()).append(")");
      sb.append(expr.toSqlString());
      if (i.hasNext()) {
        sb.append(" AND ");
      }
    }
    return sb.toString();
View Full Code Here

public class SqlOrExpression extends SqlMultiExpression {
  public String toSqlString() {
    StringBuffer sb = new StringBuffer();
    for (Iterator i = this.children.iterator(); i.hasNext();) {
      SqlExpression expr = (SqlExpression) i.next();
      // sb.append("(").append(expr.toSqlString()).append(")");
      sb.append(expr.toSqlString());
      if (i.hasNext()) {
        sb.append(" OR ");
      }
    }
    return sb.toString();
View Full Code Here

TOP

Related Classes of org.araneaframework.backend.list.SqlExpression

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.