public class AutoTimestampEventListener extends AbstractPersistenceEventListener implements MappingContextListener
An event listener that adds support for GORM-style auto-timestamping
| Modifiers | Name | Description |
|---|---|---|
static java.lang.String |
DATE_CREATED_PROPERTY |
|
static java.lang.String |
LAST_UPDATED_PROPERTY |
|
protected java.util.Map<java.lang.String, java.lang.Boolean> |
entitiesWithDateCreated |
|
protected java.util.Map<java.lang.String, java.lang.Boolean> |
entitiesWithLastUpdated |
|
protected java.util.Collection<java.lang.String> |
uninitializedEntities |
| Fields inherited from class | Fields |
|---|---|
class AbstractPersistenceEventListener |
datastore |
| Constructor and description |
|---|
AutoTimestampEventListener
(Datastore datastore) |
protected AutoTimestampEventListener
(MappingContext mappingContext) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public boolean |
beforeInsert(PersistentEntity entity, EntityAccess ea) |
|
public boolean |
beforeUpdate(PersistentEntity entity, EntityAccess ea) |
|
public TimestampProvider |
getTimestampProvider() |
|
protected boolean |
hasDateCreated(PersistentEntity entity)Here for binary compatibility. |
|
protected boolean |
hasDateCreated(java.lang.String n) |
|
protected boolean |
hasLastUpdated(PersistentEntity entity)Here for binary compatibility. |
|
protected boolean |
hasLastUpdated(java.lang.String n) |
|
protected void |
initForMappingContext(MappingContext mappingContext) |
|
protected void |
onPersistenceEvent(AbstractPersistenceEvent event) |
|
public void |
persistentEntityAdded(PersistentEntity entity) |
|
public void |
run() |
|
public void |
run() |
|
public void |
run() |
|
public void |
setTimestampProvider(TimestampProvider timestampProvider) |
|
protected void |
storeDateCreatedAndLastUpdatedInfo(PersistentEntity persistentEntity) |
|
protected void |
storeTimestampAvailability(java.util.Map<java.lang.String, java.lang.Boolean> timestampAvailabilityMap, PersistentEntity persistentEntity, PersistentProperty<?> property) |
|
public boolean |
supportsEventType(java.lang.Class<? extends org.springframework.context.ApplicationEvent> eventType) |
|
public void |
withoutDateCreated(java.lang.Runnable runnable)Temporarily disables the date created processing during the execution of the runnable |
|
public void |
withoutDateCreated(java.util.List<java.lang.Class> classes, java.lang.Runnable runnable)Temporarily disables the date created processing only on the provided classes during the execution of the runnable |
|
public void |
withoutDateCreated(java.lang.Class clazz, java.lang.Runnable runnable)Temporarily disables the date created processing only on the provided class during the execution of the runnable |
|
public void |
withoutLastUpdated(java.lang.Runnable runnable)Temporarily disables the last updated processing during the execution of the runnable |
|
public void |
withoutLastUpdated(java.util.List<java.lang.Class> classes, java.lang.Runnable runnable)Temporarily disables the last updated processing only on the provided classes during the execution of the runnable |
|
public void |
withoutLastUpdated(java.lang.Class clazz, java.lang.Runnable runnable)Temporarily disables the last updated processing only on the provided class during the execution of the runnable |
|
public void |
withoutTimestamps(java.lang.Runnable runnable)Temporarily disables the timestamp processing during the execution of the runnable |
|
public void |
withoutTimestamps(java.util.List<java.lang.Class> classes, java.lang.Runnable runnable)Temporarily disables the timestamp processing only on the provided classes during the execution of the runnable |
|
public void |
withoutTimestamps(java.lang.Class clazz, java.lang.Runnable runnable)Temporarily disables the timestamp processing during the execution of the runnable |
| Methods inherited from class | Name |
|---|---|
class AbstractPersistenceEventListener |
getOrder, isValidSource, onApplicationEvent, onPersistenceEvent, supportsSourceType |
Here for binary compatibility. Deprecated.
Here for binary compatibility. Deprecated.
Temporarily disables the date created processing during the execution of the runnable
runnable - The code to execute while the date created listener is disabledTemporarily disables the date created processing only on the provided classes during the execution of the runnable
classes - Which classes to disable the date created processing forrunnable - The code to execute while the date created listener is disabledTemporarily disables the date created processing only on the provided class during the execution of the runnable
clazz - Which class to disable the date created processing forrunnable - The code to execute while the date created listener is disabledTemporarily disables the last updated processing during the execution of the runnable
runnable - The code to execute while the last updated listener is disabledTemporarily disables the last updated processing only on the provided classes during the execution of the runnable
classes - Which classes to disable the last updated processing forrunnable - The code to execute while the last updated listener is disabledTemporarily disables the last updated processing only on the provided class during the execution of the runnable
clazz - Which class to disable the last updated processing forrunnable - The code to execute while the last updated listener is disabledTemporarily disables the timestamp processing during the execution of the runnable
runnable - The code to execute while the timestamp listeners are disabledTemporarily disables the timestamp processing only on the provided classes during the execution of the runnable
classes - Which classes to disable the timestamp processing forrunnable - The code to execute while the timestamp listeners are disabledTemporarily disables the timestamp processing during the execution of the runnable
clazz - Which class to disable the timestamp processing forrunnable - The code to execute while the timestamp listeners are disabled