Package org.fto.jthink.lang

Examples of org.fto.jthink.lang.ObjectBuffered


    }
    this.type = type;
    this.sql = sql;
    //this.values = values==null?new Object[0]:values;
    if(values!=null){
      this.values = new ObjectBuffered(1).append(values);
    }
  }
View Full Code Here


    }
    this.type = type;
    this.sql = sql;
    //this.values = values==null?new Object[0]:values;
    if(values!=null){
      this.values = new ObjectBuffered(1).append(values);
      //this.values.add(values);
    }
    this.rowStartIndex = rowStartIndex;
    this.rowLength = rowLength;
  }
View Full Code Here

   * 返回所有条件表达式的值缓冲
   *
   * @return ObjectBuffered类型的条件值缓冲对象
   */
  public ObjectBuffered getValueBuffered(){
    ObjectBuffered values = new ObjectBuffered(conditions.size());
    int len = conditions.size();
    for(int i=0;i<len;i++){
      Object[] CondiItem = (Object[])conditions.get(i);
      if (CondiItem[1] instanceof ConditionItem) {
        ConditionItem item = (ConditionItem) CondiItem[1];
        ObjectBuffered sqlValues = item.getSQLValues();
        if(sqlValues!=null){
          values.append(sqlValues);
        }else{
          Object[] condValues = item.getValues();
          if(condValues!=null){
            values.append(condValues);
          }
        }
      }else{
        Condition condition = (Condition) CondiItem[1];
        ObjectBuffered condValues = condition.getValueBuffered();
        if(condValues!=null){
          values.append(condValues);
        }
      }
    }
View Full Code Here

      throw new JThinkRuntimeException("rowLen不能小于0!");
    }

    StringBuffered sqlStr = new StringBuffered(17)
      .append("SELECT ");
    ObjectBuffered values = null;//new ObjectBuffered();
   
    /* 生成limit串 */
    if (rowLen != -1) {
      sqlStr.append(" LIMIT ").append(startIndex).append(" ").append(rowLen).append(" ");
    }
   
    /* 生成DISTINCT串 */
    if (distinct) {
      sqlStr.append(" DISTINCT ");
    }
   
    /* 生成返回列的串 */
    if (columns != null && columns.length != 0) {
      SQL columnSQL = constructSelectedColumn(columns);
      sqlStr.append(columnSQL.getSQLStatement());
      values = columnSQL.getValueBuffered();
    }else{
      sqlStr.append("*");
    }

    /* 生成FROM子串, 如果tableName为空,将不构建FROM子句 */
    if (tableName != null && tableName.length() != 0) {
      sqlStr.append(" FROM ").append(tableName);
    }
   
    /* 生成查询条件串 */
    if (condition != null && condition.size() != 0) {
      sqlStr.append(" WHERE ").append(condition.getConditionStatement());
      ObjectBuffered objBuff = condition.getValueBuffered();
      if(values!=null){
        values.append(objBuff);
      }else{
        values = objBuff;
      }
View Full Code Here

TOP

Related Classes of org.fto.jthink.lang.ObjectBuffered

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.