com.avaje.ebean.event
Class BeanPersistAdapter

java.lang.Object
  extended by com.avaje.ebean.event.BeanPersistAdapter
All Implemented Interfaces:
BeanPersistController

public abstract class BeanPersistAdapter
extends Object

    
implements BeanPersistController

    

A no operation implementation of BeanPersistController. Objects extending this need to only override the methods they want to.

A BeanPersistAdapter is either found automatically via class path search or can be added programmatically via ServerConfig.add(BeanPersistController) or ServerConfig.setPersistControllers(java.util.List).


Constructor Summary
BeanPersistAdapter()
           
 
Method Summary
 int getExecutionOrder()
          Returns 10 - override this to control the order in which BeanPersistController's are executed when there is multiple of them registered for a given entity type (class).
abstract  boolean isRegisterFor(Class<?> cls)
          Return true if this BeanPersistController should be registered for events on this entity type.
 void postDelete(BeanPersistRequest<?> request)
          Does nothing by default.
 void postInsert(BeanPersistRequest<?> request)
          Does nothing by default.
 void postLoad(Object bean, Set<String> includedProperties)
          Does nothing by default.
 void postUpdate(BeanPersistRequest<?> request)
          Does nothing by default.
 boolean preDelete(BeanPersistRequest<?> request)
          Returns true indicating normal processing should continue.
 boolean preInsert(BeanPersistRequest<?> request)
          Returns true indicating normal processing should continue.
 boolean preUpdate(BeanPersistRequest<?> request)
          Returns true indicating normal processing should continue.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanPersistAdapter

public BeanPersistAdapter()
Method Detail

isRegisterFor

public abstract boolean isRegisterFor(Class<?> cls)
Description copied from interface: BeanPersistController
Return true if this BeanPersistController should be registered for events on this entity type.

Specified by:
isRegisterFor in interface BeanPersistController

getExecutionOrder

public int getExecutionOrder()
Returns 10 - override this to control the order in which BeanPersistController's are executed when there is multiple of them registered for a given entity type (class).

Specified by:
getExecutionOrder in interface BeanPersistController
Returns:
an int used to control the order BeanPersistController's are executed

preDelete

public boolean preDelete(BeanPersistRequest<?> request)
Returns true indicating normal processing should continue.

Specified by:
preDelete in interface BeanPersistController

preInsert

public boolean preInsert(BeanPersistRequest<?> request)
Returns true indicating normal processing should continue.

Specified by:
preInsert in interface BeanPersistController

preUpdate

public boolean preUpdate(BeanPersistRequest<?> request)
Returns true indicating normal processing should continue.

Specified by:
preUpdate in interface BeanPersistController

postDelete

public void postDelete(BeanPersistRequest<?> request)
Does nothing by default.

Specified by:
postDelete in interface BeanPersistController

postInsert

public void postInsert(BeanPersistRequest<?> request)
Does nothing by default.

Specified by:
postInsert in interface BeanPersistController

postUpdate

public void postUpdate(BeanPersistRequest<?> request)
Does nothing by default.

Specified by:
postUpdate in interface BeanPersistController

postLoad

public void postLoad(Object bean,
                     Set<String> includedProperties)
Does nothing by default.

Specified by:
postLoad in interface BeanPersistController


Copyright © 2010. All Rights Reserved.