Prevayler™
The Free Software
Prevalence Layer

org.prevayler
Interface TransactionWithQuery

All Superinterfaces:
java.io.Serializable

public interface TransactionWithQuery
extends java.io.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
 java.lang.Object executeAndQuery(java.lang.Object prevalentSystem, java.util.Date executionTime)
          Performs the necessary modifications on the given prevalentSystem and also returns an Object or throws an Exception.
 

Method Detail

executeAndQuery

public java.lang.Object executeAndQuery(java.lang.Object prevalentSystem,
                                        java.util.Date executionTime)
                                 throws java.lang.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:
java.lang.Exception


'Prevayler' is a trademark of Klaus Wuestefeld.
Copyleft 2001-2004 Klaus Wuestefeld.