com.samskivert.jdbc.depot
Class Modifier

java.lang.Object
  extended by com.samskivert.jdbc.depot.Modifier
Direct Known Subclasses:
DepotMarshaller.SimpleModifier, EntityMigration, Modifier.CachingModifier, Modifier.Simple

public abstract class Modifier
extends Object

Encapsulates a modification of persistent objects.


Nested Class Summary
static class Modifier.CachingModifier<T extends PersistentRecord>
          A convenience modifier that can perform cache updates in addition to invalidation: - Before #invoke(Connection), the CacheInvalidator is run, if given
static class Modifier.Simple
          A simple modifier that executes a single SQL statement.
 
Field Summary
protected  CacheInvalidator _invalidator
           
 
Constructor Summary
Modifier()
          Constructs a Modifier without a cache invalidator.
Modifier(CacheInvalidator invalidator)
          Constructs a Modifier with the given cache invalidator.
 
Method Summary
 void cacheInvalidation(PersistenceContext ctx)
          Do any cache invalidation needed for this modification.
 void cacheUpdate(PersistenceContext ctx)
          Do any cache updates needed for this modification.
abstract  int invoke(Connection conn, DatabaseLiaison liaison)
          Overriden to perform the actual database modifications represented by this object; should return the number of modified rows.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_invalidator

protected CacheInvalidator _invalidator
Constructor Detail

Modifier

public Modifier()
Constructs a Modifier without a cache invalidator.


Modifier

public Modifier(CacheInvalidator invalidator)
Constructs a Modifier with the given cache invalidator.

Method Detail

invoke

public abstract int invoke(Connection conn,
                           DatabaseLiaison liaison)
                    throws SQLException
Overriden to perform the actual database modifications represented by this object; should return the number of modified rows.

Throws:
SQLException

cacheInvalidation

public void cacheInvalidation(PersistenceContext ctx)
Do any cache invalidation needed for this modification. This method is called just before the database statement is executed.


cacheUpdate

public void cacheUpdate(PersistenceContext ctx)
Do any cache updates needed for this modification. This method is called just after the successful execution of the database statement.



Copyright © 2000-2008 Michael Bayne. All Rights Reserved.