Code example for QueryException

0
	/** 
	 * Locate the collection persister by the collection role, requiring that 
	 * such a persister exist. 
	 * 
	 * @param role The collection role name. 
	 * @return The defined CollectionPersister for this collection role. 
	 * @throws QueryException Indicates that the collection persister could not be found. 
	 */ 
	public QueryableCollection requireQueryableCollection(String role) throws QueryException { 
		try { 
			QueryableCollection queryableCollection = ( QueryableCollection ) sfi.getCollectionPersister( role ); 
			if ( queryableCollection != null ) { 
				collectionPropertyMappingByRole.put( role, new CollectionPropertyMapping( queryableCollection ) ); 
			} 
			return queryableCollection; 
		} 
		catch ( ClassCastException cce ) { 
			throw new QueryException( "collection role is not queryable: " + role ); 
		} 
		catch ( Exception e ) {