net.sf.jso.query
Interface QueryProcessor

All Known Subinterfaces:
StorageManager
All Known Implementing Classes:
JSOQueryProcessor, JSOStorageManager, StorageManagerProxy

public interface QueryProcessor

Interface responsible for query processing operations.


Method Summary
 int count(Parameters params)
          Counts the number of objects according to parameters.
 int countPages(Parameters params)
          Counts the number of result pages according to parameters.
 java.util.List retrieve(Parameters params)
          Retrieves objects according to parameters.
 

Method Detail

count

public int count(Parameters params)
          throws StorageException,
                 ParameterException
Counts the number of objects according to parameters. Only variables and criteria are used from parameters. Current thread's transaction is used. If current thread has no transaction associated a new one is begun and committed.

Parameters:
params - Parameters to be used.
Returns:
The number of objects that match supplied criteira.
Throws:
StorageException - If any storage operation fails.
ParameterException - If any parameter is invalid.

countPages

public int countPages(Parameters params)
               throws StorageException,
                      ParameterException
Counts the number of result pages according to parameters. Only variables, criteria and page size are used from parameters. Current thread's transaction is used. If current thread has no transaction associated a new one is begun and committed.

Parameters:
params - Parameters to be used.
Returns:
The number of result pages that match supplied criteira according to supplied paging parameters. If supplied page size is lesser than 1 a negative count is returned.
Throws:
StorageException - If any storage operation fails.
ParameterException - If any parameter is invalid.

retrieve

public java.util.List retrieve(Parameters params)
                        throws StorageException,
                               ParameterException
Retrieves objects according to parameters. Current thread's transaction is used. If current thread has no transaction associated a new one is begun and committed.

Parameters:
params - Parameters to be used.
Returns:
A list of objects that match supplied criteira, in supplied order and within supplied paging limits.
Throws:
StorageException - If any storage operation fails.
ParameterException - If any parameter is invalid.