public ManageableCollection getCollectionByQuery(Class collectionClass, Query query, boolean lazy) throws PersistenceBrokerException
    {
        ManageableCollection result;

        try
        {
            // BRJ: return empty Collection  for null query
            if (query == null)
            {
                result = (ManageableCollection)collectionClass.newInstance();
            }
            else
            {
                if (lazy)
                {
                    result = pb.getProxyFactory().createCollectionProxy(pb.getPBKey(), query, collectionClass);
                }
                else
                {
                    result = getCollectionByQuery(collectionClass, query.getSearchClass(), query);
                }
            }
            return result;
        }
        catch (Exception e)
        {
            if(e instanceof PersistenceBrokerException)
            {
                throw (PersistenceBrokerException) e;
            }
            else
            {
                throw new PersistenceBrokerException(e);
            }
        }
    }
public ManageableCollection getCollectionByQuery ( Class collectionClass , Query query , boolean lazy ) throws PersistenceBrokerException { ManageableCollection result ; try { if ( query == null ) { result = ( ManageableCollection ) collectionClass . newInstance ( ) ; } else { if ( lazy ) { result = pb . getProxyFactory ( ) . createCollectionProxy ( pb . getPBKey ( ) , query , collectionClass ) ; } else { result = getCollectionByQuery ( collectionClass , query . getSearchClass ( ) , query ) ; } } return result ; } catch ( Exception e ) { if ( e instanceof PersistenceBrokerException ) { throw ( PersistenceBrokerException ) e ; } else { throw new PersistenceBrokerException ( e ) ; } } }
retrieve a collection of type collectionClass matching the Query query
if lazy = true return a CollectionProxy

@param collectionClass
@param query
@param lazy
@return ManageableCollection
@throws PersistenceBrokerException