SPT Object Database API

Package com.sptci.prevayler.query

Queries defined for the prevalent system.

See:
          Description

Class Summary
AbstractQuery<T,S extends PrevalentSystem> A base class for all simple queries against the prevalent system.
Count<S extends PrevalentSystem> The query for retrieving the total number of objects of the specified type in the prevalent system.
Fetch<P extends PrevalentObject,S extends PrevalentSystem> The query for retrieving a prevalent object from the system identified by its PrevalentObject.objectId field.
FetchByIndex<P extends Collection<PrevalentObject>,S extends PrevalentSystem> A query used to fetch prevalent objects that are indexed by the specified field.
FetchByIndices<P extends Collection<PrevalentObject>,S extends PrevalentSystem> A query used to fetch prevalent instances by the specified indexed fields.
FetchRange<P extends PrevalentObject,S extends PrevalentSystem> The query used to retrieve prevalent objects of the specified type in the range specified.
Search<P extends Collection<PrevalentObject>,S extends PrevalentSystem> The query for retrieving a collection of prevalent objects that match the specified query and optional filter.
 

Enum Summary
FetchByIndices.AggregationType An enumeration used to indicate whether the query results should represent a union or intersection.
 

Package com.sptci.prevayler.query Description

Queries defined for the prevalent system. Attempts to provide the most common queries likely to be required of a database engine.

The following shows sample use of a query:

    import com.sptci.prevayler.PrevalentObject;
    import com.sptci.prevayler.PrevalentSystemFactory;
    import com.sptci.prevayler.query.Count;

      final Prevayler prevayler = PrevalentSystemFactory.getPrevayler();
      ...
      ... public class MyObject extends PrevalentObject { ... }
      final int count = (Integer) prevayler.execute( new Count( MyObject.class ) );
  

Please note that even though the queries in this package are genericised, you have to cast the returned values to the appropriate types. This is mandated due to the fact that Prevayler is not genericised.


SPT Object Database API