Package railo.runtime.sql.exp

Examples of railo.runtime.sql.exp.Column


    do {
      raw.removeSpace();
      //print.out(raw.getCurrent());
      exp=expression(raw);
      if(!(exp instanceof Column)) throw new SQLParserException("invalid order by part of query");
      Column col=(Column) exp;
     
      raw.removeSpace();
      if(raw.forwardIfCurrent("desc")) col.setDirectionBackward(true);
      if(raw.forwardIfCurrent("asc"))  col.setDirectionBackward(false);
      selects.addOrderByExpression(col);
      raw.removeSpace();
    }
    while(raw.forwardIfCurrent(','));
    raw.removeSpace();
View Full Code Here


    do {
      raw.removeSpace();
      //print.out(raw.getCurrent());
      exp=expression(raw);
      if(!(exp instanceof Column)) throw new SQLParserException("invalid group by part of query");
      Column col=(Column) exp;
     
      select.addGroupByExpression(col);
      raw.removeSpace();
    }
    while(raw.forwardIfCurrent(','));
View Full Code Here

    while(raw.forwardIfCurrent(','));
    raw.removeSpace();
  }
 
  private void tableList(ParserString raw, Select select) throws SQLParserException {
    Column column=null;
    Expression exp=null;
    do {
      raw.removeSpace();
     
      exp=column(raw);
      if(!(exp instanceof Column)) throw new SQLParserException("invalid table definition");
      column=(Column) exp;
      raw.removeSpace();
      if(raw.forwardIfCurrent("as ")) {
        String alias=identifier(raw,new RefBooleanImpl(false));
        if(alias==null) throw new SQLParserException("missing alias in select part");
        column.setAlias(alias);
      }
      else {
        int start=raw.getPos();
        RefBoolean hasBracked = new RefBooleanImpl(false);
        String alias=identifier(raw,hasBracked);//TODO having usw
        if(!hasBracked.toBooleanValue()) {
          if("where".equalsIgnoreCase(alias)) raw.setPos(start);
          else if("group".equalsIgnoreCase(alias)) raw.setPos(start);
          else if("having".equalsIgnoreCase(alias)) raw.setPos(start);
          else if("union".equalsIgnoreCase(alias)) raw.setPos(start);
          else if("order".equalsIgnoreCase(alias)) raw.setPos(start);
          else if("limit".equalsIgnoreCase(alias)) raw.setPos(start);
          else if(alias!=null) column.setAlias(alias);
        }
        else {
          if(alias!=null) column.setAlias(alias);
        }
       
      }
      select.addFromExpression(column);
      raw.removeSpace();
View Full Code Here

  }
   


    private static void order(Query qry, Column[] columns) throws PageException {
      Column col;
      for(int i=columns.length-1;i>=0;i--) {
      col = columns[i];
      qry.sort(col.getColumn(),col.isDirectionBackward()?Query.ORDER_DESC:Query.ORDER_ASC);
    }
  }
View Full Code Here

TOP

Related Classes of railo.runtime.sql.exp.Column

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.