net.sf.jso.query
Class JSOQueryProcessor

java.lang.Object
  extended bynet.sf.jso.query.JSOQueryProcessor
All Implemented Interfaces:
QueryProcessor

public class JSOQueryProcessor
extends java.lang.Object
implements QueryProcessor

Class responsible for query processing operations.


Constructor Summary
JSOQueryProcessor(StorageManager aManager, SchemaProxy aSchema)
          Constructs query processor.
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSOQueryProcessor

public JSOQueryProcessor(StorageManager aManager,
                         SchemaProxy aSchema)
Constructs query processor.

Method Detail

count

public int count(Parameters params)
          throws StorageException
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.

Specified by:
count in interface QueryProcessor
Parameters:
params - Parameters to be used.
Returns:
The number of objects that match supplied criteira.
Throws:
StorageException - If any storage operation fails.

countPages

public int countPages(Parameters params)
               throws StorageException
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.

Specified by:
countPages in interface QueryProcessor
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.

retrieve

public java.util.List retrieve(Parameters params)
                        throws StorageException
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.

Specified by:
retrieve in interface QueryProcessor
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.