code: public static Query toQuery(Object o, boolean duplicate, Query defaultValue) {
  	try {
  	    return toQuery(o, duplicate);
  	}
  	catch (PageException e) {
  	    return defaultValue;
  	}
      }
docs: cast a Object to a Query Object
  
  @param o Object to cast
  @param duplicate duplicate the object or not
  @param defaultValue
  @return casted Query Object