org.prevayler
Interface TransactionWithQuery<P,R>

Type Parameters:
P - The type or any supertype of the Prevalent System you intend to perform the transaction and query upon.
R - The type of object which should be returned.
All Superinterfaces:
Serializable
All Known Subinterfaces:
SureTransactionWithQuery<P,R>
All Known Implementing Classes:
AddTask, AppendTransactionWithQuery, MementoManagerCommand, ProxyTransactionWithQuery

public interface TransactionWithQuery<P,R>
extends Serializable

A Transaction that also returns a result or throws an Exception after executing.

A "PersonCreation" Transaction, for example, may return the Person it created. Without this, to retrieve the newly created Person, the caller would have to issue a Query like: "What was the last Person I created?".

Looking at the Prevayler demos is by far the best way to learn how to use this class.

See Also:
Transaction

Method Summary
 R executeAndQuery(P prevalentSystem, Date executionTime)
          Performs the necessary modifications on the given prevalentSystem and also returns an object or throws an Exception.
 

Method Detail

executeAndQuery

R executeAndQuery(P prevalentSystem,
                  Date executionTime)
                  throws Exception
Performs the necessary modifications on the given prevalentSystem and also returns an object or throws an Exception. This method is called by Prevayler.execute(TransactionWithQuery) to execute this TransactionWithQuery on the given Prevalent System. See org.prevayler.demos for usage examples.

Parameters:
prevalentSystem - The system on which this TransactionWithQuery will execute.
executionTime - The time at which this TransactionWithQuery is being executed. Every Transaction executes completely within a single moment in time. Logically, a Prevalent System's time does not pass during the execution of a Transaction.
Throws:
Exception


Copyright © 2001-2013. All Rights Reserved.