SPT Object Database API

Package com.sptci.prevayler.transaction

Note: Users do not normally need to directly use these classes.

See:
          Description

Class Summary
Delete<P extends PrevalentObject> The transaction object for deleting a prevalent object from the prevalent system.
Save<P extends PrevalentObject> A transaction for adding a new prevalent object instance to the prevalent system.
Transaction<P> A general purpose transaction used to execute transactional methods on the prevalent system.
Transaction.Parameter A mapping object used to capture the class type and instance of a parameter to a method defined on the prevalent system.
 

Package com.sptci.prevayler.transaction Description

Note: Users do not normally need to directly use these classes. It is better to use the higher level interface exposed by PrevalentManager.

Transactions defined for the prevalent system. Attempts to provide the most common transactions likely to be required of a database engine. All provided transactions are sub-classes of the general purpose prevayler.annotation.Transaction class that may be used to execute any transactional method defined in PrevalentSystem or is sub-classes.

The following shows sample use of a transaction:

    import com.sptci.prevayler.PrevalentObject;
    import com.sptci.prevayler.PrevalentSystemFactory;
    import com.sptci.prevayler.transaction.Save;

      final Prevayler prevayler = PrevalentSystemFactory.getPrevayler();
      ...
      ... public class MyObject extends PrevalentObject { ... }
      final MyObject obj = new MyObject();
      obj.setXXX(...)...
      final MyObject newobj = prevayler.execut( new Save<MyObject>( obj ) );
  

Please note that even though the transactions 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