Package org.araneaframework.backend.list

Examples of org.araneaframework.backend.list.SqlExpression


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


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

    return this;
  }
  public Object[] getValues() {
    List values = new ArrayList();
    for (Iterator i = this.children.iterator(); i.hasNext();) {     
      SqlExpression expr = (SqlExpression) i.next();
      Object[] childValues = expr.getValues();
      if (childValues != null) {
        values.addAll(Arrays.asList(childValues));       
      }
    }
    return values.toArray();
View Full Code Here

 
  // logical
 
  class AndTranslator extends CompositeExprToSqlExprTranslator {
    protected SqlExpression translateParent(Expression expr, SqlExpression[] sqlChildren) {
      SqlExpression temp = new SqlAndExpression().setChildren(sqlChildren);
      return sqlChildren.length > 1 ? new SqlBracketsExpression(temp) : temp;
    }
View Full Code Here

    }
  }
 
  class OrTranslator extends CompositeExprToSqlExprTranslator {
    protected SqlExpression translateParent(Expression expr, SqlExpression[] sqlChildren) {
      SqlExpression temp = new SqlOrExpression().setChildren(sqlChildren);
      return sqlChildren.length > 1 ? new SqlBracketsExpression(temp) : temp;
    }
View Full Code Here

  // String 
 
  class LikeTranslator extends CompositeExprToSqlExprTranslator {
    protected SqlExpression translateParent(Expression expr, SqlExpression[] sqlChildren) {
      LikeExpression like = (LikeExpression) expr;     
      SqlExpression var = sqlChildren[0];
      SqlExpression mask = new SqlValueExpression(
          "%" + convertValue(like.getMask()) + "%");
      if (like.getIgnoreCase()) {
        var = new SqlUpperExpression(var);
        mask = new SqlUpperExpression(mask);
      }
View Full Code Here

  public String toSqlString() {
    StringBuffer sb = new StringBuffer();
    sb.append(this.name).append("(");
    for (Iterator i = this.children.iterator(); i.hasNext();) {
      SqlExpression expr = (SqlExpression) i.next();
      sb.append(expr.toSqlString());
      if (i.hasNext()) {
        sb.append(", ");
      }
    }
    sb.append(")");
View Full Code Here

      return new SqlDescendingExpression(translateVariableComparatorInternal(compExpr));
    }
  }
 
  SqlExpression translateVariableComparatorInternal(VariableComparatorExpression compExpr) {
    SqlExpression temp = new SqlStringExpression(resolveVariable(compExpr));
    Comparator comparator = compExpr.getComparator();
    if (comparator instanceof NullComparator) {
      comparator = ((NullComparator) comparator).getNotNullComparator();
    }
    log.debug("Comparator: " + comparator);
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.