SPT Object Database API

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

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

public class Fetch<P extends PrevalentObject,S extends PrevalentSystem>
extends AbstractQuery<P,S>

The query for retrieving a prevalent object from the system identified by its PrevalentObject.objectId field.

Version:
$Id: Fetch.java 22 2008-11-24 19:04:25Z sptrakesh $
Author:
Rakesh Vidyadharan 2008-05-27
See Also:

© Copyright 2008 Sans Pareil Technologies, Inc.


Field Summary
private  Class cls
          The type of object that is to be retrieved.
private  Object objectId
          The PrevalentObject.objectId to use to fetch the prevalent object instance.
 
Constructor Summary
Fetch(Class cls, Object objectId)
          Create a new instance of the query for fetching a prevalent object the specified object id.
 
Method Summary
protected  P query(S system, Date timestamp)
          Execute the query on the prevalent system and return the prevalent object uniquely identified by the specified objectId.
 
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

cls

private final Class cls
The type of object that is to be retrieved.


objectId

private final Object objectId
The PrevalentObject.objectId to use to fetch the prevalent object instance.

Constructor Detail

Fetch

public Fetch(Class cls,
             Object objectId)
Create a new instance of the query for fetching a prevalent object the specified object id.

Parameters:
cls - The cls to use.
objectId - The objectId to use.
Method Detail

query

protected P query(S system,
                  Date timestamp)
                                   throws PrevalentException
Execute the query on the prevalent system and return the prevalent object uniquely identified by the specified objectId.

Specified by:
query in class AbstractQuery<P extends PrevalentObject,S extends PrevalentSystem>
Parameters:
system - The prevalent system that is to be acted upon.
timestamp - The timestamp for the query.
Returns:
The required prevalent object or null if no object with the specified objectId exists in the prevalent system.
Throws:
PrevalentException - If errors are encountered while fetching the required prevalent object.

SPT Object Database API