Code example for QueryException

0
	public Type toType(String propertyName) throws QueryException {
		if ( propertyName==null || "id".equals(propertyName) ) {
			return type;
		} 
		else { 
			throw new QueryException("cannot dereference scalar collection element: " + propertyName);
		} 
	} 
 
	public String[] toColumns(String alias, String propertyName) throws QueryException {
		if (propertyName==null || "id".equals(propertyName) ) {
			return StringHelper.qualify( alias, elementColumns );
		} 
		else { 
			throw new QueryException("cannot dereference scalar collection element: " + propertyName);
		} 
	} 
 
	/** 
	 * Given a property path, return the corresponding column name(s).