Package org.hibernate.event.spi
Class FlushEntityEvent
- java.lang.Object
-
- org.hibernate.event.spi.AbstractEvent
-
- org.hibernate.event.spi.FlushEntityEvent
-
- All Implemented Interfaces:
Serializable
public class FlushEntityEvent extends AbstractEvent
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FlushEntityEvent(EventSource source, Object entity, EntityEntry entry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object[]
getDatabaseSnapshot()
int[]
getDirtyProperties()
Object
getEntity()
EntityEntry
getEntityEntry()
int
getInstanceGenerationId()
Object[]
getPropertyValues()
boolean
hasDatabaseSnapshot()
boolean
hasDirtyCollection()
boolean
hasDirtyProperties()
boolean
isAllowedToReuse()
boolean
isDirtyCheckHandledByInterceptor()
boolean
isDirtyCheckPossible()
void
resetAndReuseEventInstance(Object entity, EntityEntry entry)
This is a terrible anti-pattern, but particular circumstances call for being able to reuse the same event instance: this is otherwise allocated in hot loops and since each event is escaping the scope it's actually causing allocation issues.void
setAllowedToReuse(boolean allowedToReuse)
void
setDatabaseSnapshot(Object[] databaseSnapshot)
void
setDirtyCheckHandledByInterceptor(boolean dirtyCheckHandledByInterceptor)
void
setDirtyCheckPossible(boolean dirtyCheckPossible)
void
setDirtyProperties(int[] dirtyProperties)
void
setHasDirtyCollection(boolean hasDirtyCollection)
void
setInstanceGenerationId(int instanceGenerationId)
void
setPropertyValues(Object[] propertyValues)
-
Methods inherited from class org.hibernate.event.spi.AbstractEvent
getSession
-
-
-
-
Constructor Detail
-
FlushEntityEvent
public FlushEntityEvent(EventSource source, Object entity, EntityEntry entry)
-
-
Method Detail
-
getEntityEntry
public EntityEntry getEntityEntry()
-
getDatabaseSnapshot
public Object[] getDatabaseSnapshot()
-
setDatabaseSnapshot
public void setDatabaseSnapshot(Object[] databaseSnapshot)
-
hasDatabaseSnapshot
public boolean hasDatabaseSnapshot()
-
isDirtyCheckHandledByInterceptor
public boolean isDirtyCheckHandledByInterceptor()
-
setDirtyCheckHandledByInterceptor
public void setDirtyCheckHandledByInterceptor(boolean dirtyCheckHandledByInterceptor)
-
isDirtyCheckPossible
public boolean isDirtyCheckPossible()
-
setDirtyCheckPossible
public void setDirtyCheckPossible(boolean dirtyCheckPossible)
-
getDirtyProperties
public int[] getDirtyProperties()
-
setDirtyProperties
public void setDirtyProperties(int[] dirtyProperties)
-
hasDirtyProperties
public boolean hasDirtyProperties()
-
hasDirtyCollection
public boolean hasDirtyCollection()
-
setHasDirtyCollection
public void setHasDirtyCollection(boolean hasDirtyCollection)
-
getPropertyValues
public Object[] getPropertyValues()
-
setPropertyValues
public void setPropertyValues(Object[] propertyValues)
-
getEntity
public Object getEntity()
-
resetAndReuseEventInstance
public void resetAndReuseEventInstance(Object entity, EntityEntry entry)
This is a terrible anti-pattern, but particular circumstances call for being able to reuse the same event instance: this is otherwise allocated in hot loops and since each event is escaping the scope it's actually causing allocation issues. The flush event does not appear to be used recursively so this is currently safe to do, nevertheless we add an allowedToReuse flag to ensure only instances whose purpose has completed are being reused. N.B. two out of three parameters from the constructor are reset: the same EventSource is implied on reuse.- Parameters:
entity
- same as constructor parameterentry
- same as constructor parameter
-
isAllowedToReuse
public boolean isAllowedToReuse()
-
setAllowedToReuse
public void setAllowedToReuse(boolean allowedToReuse)
-
getInstanceGenerationId
public int getInstanceGenerationId()
-
setInstanceGenerationId
public void setInstanceGenerationId(int instanceGenerationId)
-
-