public abstract class PersistenceVisitor extends ReflectiveVisitor implements Serializable
Visitors can be registered at a Db and are only valid within a single transaction.
If present, the visitors will be consulted before each persistence operation such as
ModificationLog.INSERT, ModificationLog.UPDATE or ModificationLog.DELETE, whether
the operation is allowed or should be silently skipped.
The methods are invoked in the following order:
visit(org.tentackle.db.DbObject, Character) which in turn invokes the type-specific visit methodisPersistenceOperationAllowed(org.tentackle.db.DbObject, char)PersistenceException if the operation must not continue.
The effective visit method for the concrete persistence class is determined by reflection. The most specific method will be used, which allows to use a method for a class hierarchy.
Notice that the visit method must use a Character instead of char to be found by the method dispatcher.
| Constructor and Description |
|---|
PersistenceVisitor() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isPersistenceOperationAllowed(AbstractDbObject<?> object,
char modType)
Checks if the persistence operation is allowed.
|
findVisitMethod, handleException, isImplementedClass, visitpublic boolean isPersistenceOperationAllowed(AbstractDbObject<?> object, char modType)
object - the persistable objectmodType - the modification typeCopyright © 2016 Krake Softwaretechnik. All rights reserved.