gt: 		return new EntryIterator(this, keys());
context: /**
   *
   * Copyright (c) 2014, the Railo Company Ltd. All rights reserved.
   *
   * This library is free software; you can redistribute it and/or
   * modify it under the terms of the GNU Lesser General Public
   * License as published by the Free Software Foundation; either 
   * version 2.1 of the License, or (at your option) any later version.
   * 
   * This library is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   * Lesser General Public License for more details.
   * 
   * You should have received a copy of the GNU Lesser General Public 
   * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
   * 
   **/
  package lucee.runtime.type;
  
  import java.util.Date;
  import java.util.Iterator;
  import java.util.Map.Entry;
  
  import lucee.runtime.PageContext;
  import lucee.runtime.config.NullSupportHelper;
  import lucee.runtime.dump.DumpData;
  import lucee.runtime.dump.DumpProperties;
  import lucee.runtime.dump.DumpUtil;
  import lucee.runtime.engine.ThreadLocalPageContext;
  import lucee.runtime.exp.DatabaseException;
  import lucee.runtime.exp.PageException;
  import lucee.runtime.op.Caster;
  import lucee.runtime.op.Operator;
  import lucee.runtime.op.date.DateCaster;
  import lucee.runtime.type.dt.DateTime;
  import lucee.runtime.type.it.EntryIterator;
  import lucee.runtime.type.it.KeyIterator;
  import lucee.runtime.type.it.StringIterator;
  import lucee.runtime.type.util.CollectionUtil;
  import lucee.runtime.type.util.QueryUtil;
  
  /**
   * Recordcount Query Column
   */
  public final class QueryColumnRef implements QueryColumn,Sizeable {
      
      private Query query;
      private Collection.Key columnName;
      private int type;
  
      /**
       * Constructor of the class
       * @param query
       * @param columnName 
       * @param type 
       */
      public QueryColumnRef(Query query, Collection.Key columnName, int type) {
          this.query=query;
          this.columnName=columnName;
          this.type=type;
      }
  
      @Override
      public Object remove(int row) throws DatabaseException {
          throw new DatabaseException("can't remove "+columnName+" at row "+row+" value from Query",null,null,null);
      }
  
      @Override
      public Object removeEL(int row) {
          return query.getAt(columnName,row,null);
      }
  
      @Override
      public Object get(int row) throws PageException {
          return query.getAt(columnName,row);
      }
      
      /**
       * touch a value, means if key dosent exist, it will created
       * @param row
       * @return matching value or created value
       * @throws PageException
       */
      public Object touch(int row) throws PageException {
          Object o= query.getAt(columnName,row,NullSupportHelper.NULL());
          if(o!=NullSupportHelper.NULL()) return o;
          return query.setAt(columnName,row,new StructImpl());
      }
      
      public Object touchEL(int row) {
          Object o= query.getAt(columnName,row,NullSupportHelper.NULL());
          if(o!=NullSupportHelper.NULL()) return o;
          return query.setAtEL(columnName,row,new StructImpl());
      }
  
      @Override
      public Object get(int row, Object defaultValue) {
          return query.getAt(columnName,row,defaultValue);
      }
  
      @Override
      public Object set(int row, Object value) throws DatabaseException {
          throw new DatabaseException("can't change "+columnName+" value from Query",null,null,null);
      }
  
      @Override
      public Object setEL(int row, Object value) {
          return query.getAt(columnName,row,null);
      }
  
      @Override
      public void add(Object value) {}
  
      @Override
      public void addRow(int count) {}
  
      @Override
      public int getType() {
          return type;
      }
  
      @Override
      public String getTypeAsString() {
          return QueryImpl.getColumTypeName(getType());
      }
  
      @Override
      public void cutRowsTo(int maxrows) {}
  
  
      @Override
      public int size() {
          return query.size();
      }
  
      @Override
      public Collection.Key[] keys() {
      	Collection.Key[] k=new Collection.Key[size()];
          for(int i=1;i<=k.length;i++) {
              k[i-1]=KeyImpl.init(Caster.toString(i));
          }
          return k;
      }
  
  	@Override
  	public Object remove(Collection.Key key) throws PageException {
  		throw new DatabaseException("can't remove "+key+" from Query",null,null,null);
  	}
  
  	@Override
  	public Object removeEL(Collection.Key key) {
  		return get(key,null);
  	}
  
      @Override
      public void clear() {}
  
      @Override
      public Object get(String key) throws PageException {
          return get(Caster.toIntValue(key));
      }
  
  	@Override
  	public Object get(Collection.Key key) throws PageException {
  		return get(Caster.toIntValue(key.getString()));
  	}
  
      @Override
      public Object get(String key, Object defaultValue) {
          return get(Caster.toIntValue(key,query.getCurrentrow(ThreadLocalPageContext.get().getId())),defaultValue);
      }
  
  	@Override
  	public Object get(Collection.Key key, Object defaultValue) {
  		return get(Caster.toIntValue(key,query.getCurrentrow(ThreadLocalPageContext.get().getId())),defaultValue);
  	}
  
      @Override
      public Object set(String key, Object value) throws PageException {
          return set(Caster.toIntValue(key),value);
      }
  
  	@Override
  	public Object set(Collection.Key key, Object value) throws PageException {
  		return set(Caster.toIntValue(key),value);
  	}
  
      @Override
      public Object setEL(String key, Object value) {
          return setEL(Caster.toIntValue(key,query.getCurrentrow(ThreadLocalPageContext.get().getId())),value);
      }
  
  	@Override
  	public Object setEL(Collection.Key key, Object value) {
  		return setEL(Caster.toIntValue(key,query.getCurrentrow(ThreadLocalPageContext.get().getId())),value);
  	}
  
  	@Override
  	public Iterator<Collection.Key> keyIterator() {
          return new KeyIterator(keys());
      }
      
  	@Override
  	public Iterator<String> keysAsStringIterator() {
      	return new StringIterator(keys());
      }
  	
  	@Override
  	public Iterator<Entry<Key, Object>> entryIterator() {
  