SPT Object Database API

com.sptci.prevayler.query
Class FetchByIndex<P extends Collection<PrevalentObject>,S extends PrevalentSystem>

java.lang.Object
  extended by com.sptci.prevayler.query.AbstractQuery<P,S>
      extended by com.sptci.prevayler.query.FetchByIndex<P,S>
All Implemented Interfaces:
Query

public class FetchByIndex<P extends Collection<PrevalentObject>,S extends PrevalentSystem>
extends AbstractQuery<P,S>

A query used to fetch prevalent objects that are indexed by the specified field.

© Copyright 2008 Sans Pareil Technologies, Inc.

Version:
$Id: FetchByIndex.java 22 2008-11-24 19:04:25Z sptrakesh $
Author:
Rakesh Vidyadharan 2008-07-13

Field Summary
private  String field
          The name of the indexed field in the prevalent objects to query.
private  Class type
          The type of the prevalent object that is to be queried.
private  Object value
          The value of the indexed field to use to query the system.
 
Constructor Summary
FetchByIndex(Class type, String field, Object value)
          Create a new instance of the query with the specified values.
 
Method Summary
protected  P query(S system, Date timestamp)
          Execute the query on the prevalent system and return the collection of
 
Methods inherited from class com.sptci.prevayler.query.AbstractQuery
query
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

private final Class type
The type of the prevalent object that is to be queried.


field

private final String field
The name of the indexed field in the prevalent objects to query.


value

private final Object value
The value of the indexed field to use to query the system.

Constructor Detail

FetchByIndex

public FetchByIndex(Class type,
                    String field,
                    Object value)
Create a new instance of the query with the specified values.

Parameters:
type - The type to use for the query.
field - The field to use for the query.
value - The value to use for the query.
Method Detail

query

protected P query(S system,
                  Date timestamp)
                                               throws PrevalentException
Execute the query on the prevalent system and return the collection of

Specified by:
query in class AbstractQuery<P extends Collection<PrevalentObject>,S extends PrevalentSystem>
Parameters:
system - The prevalent system that is to be acted upon.
timestamp - The timestamp for the query.
Returns:
The collection of prevalent objects matching the specified indexed field.
Throws:
PrevalentException - If errors are encountered while querying the system.

SPT Object Database API