final class DirtyDmoStrategy
extends java.lang.Object
implements org.hibernate.CustomEntityDirtinessStrategy, java.io.Serializable
Constructor and Description |
---|
DirtyDmoStrategy() |
Modifier and Type | Method and Description |
---|---|
boolean |
canDirtyCheck(java.lang.Object entity,
org.hibernate.persister.entity.EntityPersister persister,
org.hibernate.Session session)
Indicate whether we can provide custom dirty checking for the given entity.
|
void |
findDirty(java.lang.Object entity,
org.hibernate.persister.entity.EntityPersister persister,
org.hibernate.Session session,
org.hibernate.CustomEntityDirtinessStrategy.DirtyCheckContext dirtyCheckContext)
Find the properties of the DMO which are dirty.
|
private ChangeBroker.SessionInterceptor |
getInterceptor(org.hibernate.Session session)
Convenience method to extract our custom interceptor from the Hibernate session.
|
boolean |
isDirty(java.lang.Object entity,
org.hibernate.persister.entity.EntityPersister persister,
org.hibernate.Session session)
Indicate whether we consider the given entity to require synchronization with the database.
|
void |
resetDirty(java.lang.Object entity,
org.hibernate.persister.entity.EntityPersister persister,
org.hibernate.Session session)
Called by Hibernate when dirty checking of the specified DMO is complete.
|
public boolean canDirtyCheck(java.lang.Object entity, org.hibernate.persister.entity.EntityPersister persister, org.hibernate.Session session)
canDirtyCheck
in interface org.hibernate.CustomEntityDirtinessStrategy
entity
- The DMO to be checked.persister
- Not used.session
- Not used.true
always.public boolean isDirty(java.lang.Object entity, org.hibernate.persister.entity.EntityPersister persister, org.hibernate.Session session)
true
return from this method.isDirty
in interface org.hibernate.CustomEntityDirtinessStrategy
entity
- The DMO to be checked.persister
- Not used.session
- Current Hibernate session. This provides a rather tenuous link back to our custom
Interceptor
implementation, in that it relies upon casting to the
Hibernate internal SessionImpl
interface.true
if the DMO is either definitely dirty or if it may be dirty (based on
our knowledge that a non-specific change (e.g., a bulk delete) has been made to
the backing table. If neither is the case, return false
.public void findDirty(java.lang.Object entity, org.hibernate.persister.entity.EntityPersister persister, org.hibernate.Session session, org.hibernate.CustomEntityDirtinessStrategy.DirtyCheckContext dirtyCheckContext)
This is currently a no-op, but may be implemented in the future.
findDirty
in interface org.hibernate.CustomEntityDirtinessStrategy
entity
- The DMO to be checked.persister
- Not used.session
- Not used.dirtyCheckContext
- Not used.public void resetDirty(java.lang.Object entity, org.hibernate.persister.entity.EntityPersister persister, org.hibernate.Session session)
resetDirty
in interface org.hibernate.CustomEntityDirtinessStrategy
entity
- The DMO which was checked.persister
- Not used.session
- Current Hibernate session. This provides a rather tenuous link back to our custom
Interceptor
implementation, in that it relies upon casting to the
Hibernate internal SessionImpl
interface.private ChangeBroker.SessionInterceptor getInterceptor(org.hibernate.Session session)
session
- Current Hibernate session. This provides a rather tenuous link back to our custom
Interceptor
implementation, in that it relies upon casting to the
Hibernate internal SessionImpl
interface.