Class TableRowAlreadyManagedEvent
java.lang.Object
io.hypersistence.optimizer.core.event.AbstractEvent
io.hypersistence.optimizer.hibernate.event.session.SessionEvent
io.hypersistence.optimizer.hibernate.event.session.ManagedEntityEvent
io.hypersistence.optimizer.hibernate.event.session.TableRowAlreadyManagedEvent
- All Implemented Interfaces:
Event,Serializable
The
TableRowAlreadyManagedEvent indicates that a given database tabe row
is already managed by an entity bound to the current Persistence Context.
When having multiple entities mapped to the same database table, it's important to load at most one entity that managed that record. Otherwise, you could end up having to entity objects with different state synchronizing the same table record at flush time.
- Since:
- 2.8.0
- Author:
- Vlad Mihalcea
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.hypersistence.optimizer.core.event.Event
Event.Priority -
Constructor Summary
ConstructorsConstructorDescriptionTableRowAlreadyManagedEvent(Class entityClass, Object entityIdentifier, Class managedEntityClass) Instantiate the event using the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionGet the existing entity class that already manages the table row that theManagedEntityEvent.getEntityClass()wants to manage as well.Get theEvent.Priorityof thisEventMethods inherited from class io.hypersistence.optimizer.hibernate.event.session.ManagedEntityEvent
getEntityClass, getEntityIdentifier, getEntityNameMethods inherited from class io.hypersistence.optimizer.core.event.AbstractEvent
getInfoUrl
-
Constructor Details
-
TableRowAlreadyManagedEvent
public TableRowAlreadyManagedEvent(Class entityClass, Object entityIdentifier, Class managedEntityClass) Instantiate the event using the provided parameters.- Parameters:
entityClass- entity classentityIdentifier- entity identifiermanagedEntityClass- the entity class already managing the same table row
-
-
Method Details
-
getManagedEntityClass
Get the existing entity class that already manages the table row that theManagedEntityEvent.getEntityClass()wants to manage as well.- Returns:
- entity class that already manages the table row
-
getPriority
Get theEvent.Priorityof thisEvent- Returns:
- the
Event.Priorityof thisEvent
-
getDescription
-