Package io.ebean.event
Class BeanPersistAdapter
- java.lang.Object
-
- io.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
DatabaseConfig.add(BeanPersistController)
orDatabaseConfig.setPersistControllers(java.util.List)
.
-
-
Constructor Summary
Constructors Constructor Description BeanPersistAdapter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description 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
postSoftDelete(BeanPersistRequest<?> request)
Does nothing by default.void
postUpdate(BeanPersistRequest<?> request)
Does nothing by default.void
preDelete(BeanDeleteIdRequest 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
preSoftDelete(BeanPersistRequest<?> request)
Returns true indicating normal processing should continue.boolean
preUpdate(BeanPersistRequest<?> request)
Returns true indicating normal processing should continue.
-
-
-
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 interfaceBeanPersistController
-
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 interfaceBeanPersistController
- 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 interfaceBeanPersistController
-
preInsert
public boolean preInsert(BeanPersistRequest<?> request)
Returns true indicating normal processing should continue.- Specified by:
preInsert
in interfaceBeanPersistController
-
preUpdate
public boolean preUpdate(BeanPersistRequest<?> request)
Returns true indicating normal processing should continue.- Specified by:
preUpdate
in interfaceBeanPersistController
-
preSoftDelete
public boolean preSoftDelete(BeanPersistRequest<?> request)
Returns true indicating normal processing should continue.- Specified by:
preSoftDelete
in interfaceBeanPersistController
-
postDelete
public void postDelete(BeanPersistRequest<?> request)
Does nothing by default.- Specified by:
postDelete
in interfaceBeanPersistController
-
postInsert
public void postInsert(BeanPersistRequest<?> request)
Does nothing by default.- Specified by:
postInsert
in interfaceBeanPersistController
-
postUpdate
public void postUpdate(BeanPersistRequest<?> request)
Does nothing by default.- Specified by:
postUpdate
in interfaceBeanPersistController
-
postSoftDelete
public void postSoftDelete(BeanPersistRequest<?> request)
Does nothing by default.- Specified by:
postSoftDelete
in interfaceBeanPersistController
-
preDelete
public void preDelete(BeanDeleteIdRequest request)
Does nothing by default.- Specified by:
preDelete
in interfaceBeanPersistController
-
-