Package railo.runtime.type

Examples of railo.runtime.type.QueryColumn


  }

  @Override
  public QueryColumn getColumn(Collection.Key key) throws DatabaseException {
    if(!isCloned) {
      QueryColumn column = (QueryColumn) _columns.get(key);
      if(column==null) {
        column=QueryCacheQueryColumn.getColumn(this,key);
        _columns.put(key, column);
      }
      return column;
View Full Code Here


  }

  @Override
  public QueryColumn getColumn(Collection.Key key, QueryColumn defaultValue) {
    if(!isCloned) {
      QueryColumn column = (QueryColumn) _columns.get(key);
      if(column==null) {
        column=QueryCacheQueryColumn.getColumn(this,key,defaultValue);
        if(column!=defaultValue)_columns.put(key, column);
      }
      return column;
View Full Code Here

   * @param key
   * @return
   * @throws DatabaseException
   */
  public static QueryColumn getColumn(QueryCacheQuery qcq, Key key) throws DatabaseException {
    QueryColumn _column = qcq.getQuery().getColumn(key);
    return new QueryCacheQueryColumn(qcq,_column,key);
  }
View Full Code Here

   * @param key
   * @param defaultValue
   * @return
   */
  public static QueryColumn getColumn(QueryCacheQuery qcq, Key key, QueryColumn defaultValue) {
    QueryColumn _column = qcq.getQuery().getColumn(key,null);
    if(_column==null) return defaultValue;
    return new QueryCacheQueryColumn(qcq,_column,key);
  }
View Full Code Here

      qry.rename(COLUMN_DEF,COLUMN_DEFAULT_VALUE);
    else if(qry.getColumn(COLUMN_DEFAULT,null) != null)
      qry.rename(COLUMN_DEFAULT,COLUMN_DEFAULT_VALUE);
   
    // make sure decimal digits exists
    QueryColumn col = qry.getColumn(DECIMAL_DIGITS,null);
    if(col==null){
      Array arr=new ArrayImpl();
      for(int i=1;i<=len;i++) {
        arr.append(railo.runtime.op.Constants.DOUBLE_ZERO);
      }
View Full Code Here

      if(qi !=null){
        railo.runtime.type.Query qryKeys = qi.getGeneratedKeys();
        if(qryKeys!=null){
          StringBuilder generatedKey=new StringBuilder(),sb;
          Collection.Key[] columnNames = qryKeys.getColumnNames();
          QueryColumn column;
          for(int c=0;c<columnNames.length;c++){
            column = qryKeys.getColumn(columnNames[c]);
            sb=new StringBuilder();
            int size=column.size();
            for(int row=1;row<=size;row++) {
              if(row>1)sb.append(',');
              sb.append(Caster.toString(column.get(row,null)));
            }
            if(sb.length()>0){
              sct.setEL(columnNames[c], sb.toString());
              if(generatedKey.length()>0)generatedKey.append(',');
              generatedKey.append(sb);
View Full Code Here

    Collection.Key trg=KeyImpl.getInstance(newColumnName);
   
    Query qp = Caster.toQuery(query,null);
    if(qp!=null) qp.rename(src, trg);
    else {
      QueryColumn qc = query.removeColumn(src);
      Array content=new ArrayImpl();
      int len=qc.size();
      for(int i=1;i<=len;i++){
        content.setE(i, qc.get(i,null));
      }
      query.addColumn(trg, content, qc.getType());
    }
    return null;
  }
View Full Code Here

  public static Array call(PageContext pc, Query query, String columnName) throws PageException {
    return call(pc, query, columnName, null);
  }
  public static Array call(PageContext pc, Query query, String columnName,  UDF udf) throws PageException {
    Array arr=new ArrayImpl();
    QueryColumn column = query.getColumn(KeyImpl.init(columnName));
      Iterator<Object> it = column.valueIterator();
      Object value;
    while(it.hasNext()) {
      value=it.next();
      if(!NullSupportHelper.full() && value==null) value="";
      if(udf!=null)arr.append(udf.call(pc, new Object[]{value}, true));
View Full Code Here

        return get(pc,coll,key,defaultValue);
    }
   
    public Object getCollection(PageContext pc, Object coll, Collection.Key key, Object defaultValue) {// FUTURE add to interface
        if(coll instanceof Query) {
          QueryColumn qc = ((Query)coll).getColumn(key,null);
          if(qc==null) return defaultValue;
          return qc;
        }
        return get(pc,coll,key,defaultValue);
    }
View Full Code Here

        if(Decision.isQuery(value)) {
            Query q = Caster.toQuery(value);
            int recorcount=q.getRecordcount();
            String[] strColumns = q.getColumns();
           
            QueryColumn col;
            int row;
            for(int i=0;i<strColumns.length;i++) {
                col=q.getColumn(strColumns[i]);
                for(row=1;row<=recorcount;row++) {
                    col.set(row,toCFML(col.get(row,null)));
                }
            }
            return q;
        }
    return value;
View Full Code Here

TOP

Related Classes of railo.runtime.type.QueryColumn

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.