Top Fields Constructors Methods
org.hibernate.event.spi

public Class FlushEntityEvent

extends AbstractEvent
Class Inheritance
Imports
org.hibernate.engine.spi.EntityEntry

Author
Gavin King

Field Summary

Modifier and TypeField and Description
private boolean
private Object[]
private boolean
private boolean
private int[]
private Object
private EntityEntry
private boolean
private int
private Object[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object[]
public int[]
public Object
public EntityEntry
public int
public Object[]
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public void
resetAndReuseEventInstance(Object
same as constructor parameter
entity
,
EntityEntry
same as constructor parameter
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.

public void
setAllowedToReuse(final boolean allowedToReuse)

public void
setDatabaseSnapshot(Object[] databaseSnapshot)

public void
setDirtyCheckHandledByInterceptor(boolean dirtyCheckHandledByInterceptor)

public void
setDirtyCheckPossible(boolean dirtyCheckPossible)

public void
setDirtyProperties(int[] dirtyProperties)

public void
setHasDirtyCollection(boolean hasDirtyCollection)

public void
setInstanceGenerationId(final int instanceGenerationId)

public void
setPropertyValues(Object[] propertyValues)

Inherited from org.hibernate.event.spi.AbstractEvent:
getSession

Field Detail

allowedToReuseback to summary
private boolean allowedToReuse
databaseSnapshotback to summary
private Object[] databaseSnapshot
dirtyCheckHandledByInterceptorback to summary
private boolean dirtyCheckHandledByInterceptor
dirtyCheckPossibleback to summary
private boolean dirtyCheckPossible
dirtyPropertiesback to summary
private int[] dirtyProperties
entityback to summary
private Object entity
entityEntryback to summary
private EntityEntry entityEntry
hasDirtyCollectionback to summary
private boolean hasDirtyCollection
instanceGenerationIdback to summary
private int instanceGenerationId
propertyValuesback to summary
private Object[] propertyValues

Constructor Detail

FlushEntityEventback to summary
public FlushEntityEvent(EventSource source, Object entity, EntityEntry entry)

Method Detail

getDatabaseSnapshotback to summary
public Object[] getDatabaseSnapshot()
getDirtyPropertiesback to summary
public int[] getDirtyProperties()
getEntityback to summary
public Object getEntity()
getEntityEntryback to summary
public EntityEntry getEntityEntry()
getInstanceGenerationIdback to summary
public int getInstanceGenerationId()
getPropertyValuesback to summary
public Object[] getPropertyValues()
hasDatabaseSnapshotback to summary
public boolean hasDatabaseSnapshot()
hasDirtyCollectionback to summary
public boolean hasDirtyCollection()
hasDirtyPropertiesback to summary
public boolean hasDirtyProperties()
isAllowedToReuseback to summary
public boolean isAllowedToReuse()
isDirtyCheckHandledByInterceptorback to summary
public boolean isDirtyCheckHandledByInterceptor()
isDirtyCheckPossibleback to summary
public boolean isDirtyCheckPossible()
resetAndReuseEventInstanceback to summary
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:Object

same as constructor parameter

entry:EntityEntry

same as constructor parameter

setAllowedToReuseback to summary
public void setAllowedToReuse(final boolean allowedToReuse)
setDatabaseSnapshotback to summary
public void setDatabaseSnapshot(Object[] databaseSnapshot)
setDirtyCheckHandledByInterceptorback to summary
public void setDirtyCheckHandledByInterceptor(boolean dirtyCheckHandledByInterceptor)
setDirtyCheckPossibleback to summary
public void setDirtyCheckPossible(boolean dirtyCheckPossible)
setDirtyPropertiesback to summary
public void setDirtyProperties(int[] dirtyProperties)
setHasDirtyCollectionback to summary
public void setHasDirtyCollection(boolean hasDirtyCollection)
setInstanceGenerationIdback to summary
public void setInstanceGenerationId(final int instanceGenerationId)
setPropertyValuesback to summary
public void setPropertyValues(Object[] propertyValues)