Java 类org.hibernate.CustomEntityDirtinessStrategy 实例源码

项目:lams    文件:EntityEntry.java   
@SuppressWarnings( {"SimplifiableIfStatement"})
private boolean isUnequivocallyNonDirty(Object entity) {

    if(entity instanceof SelfDirtinessTracker)
        return ((SelfDirtinessTracker) entity).$$_hibernate_hasDirtyAttributes();

    final CustomEntityDirtinessStrategy customEntityDirtinessStrategy =
            persistenceContext.getSession().getFactory().getCustomEntityDirtinessStrategy();
    if ( customEntityDirtinessStrategy.canDirtyCheck( entity, getPersister(), (Session) persistenceContext.getSession() ) ) {
        return ! customEntityDirtinessStrategy.isDirty( entity, getPersister(), (Session) persistenceContext.getSession() );
    }

    if ( getPersister().hasMutableProperties() ) {
        return false;
    }

    if ( getPersister().getInstrumentationMetadata().isInstrumented() ) {
        // the entity must be instrumented (otherwise we cant check dirty flag) and the dirty flag is false
        return ! getPersister().getInstrumentationMetadata().extractInterceptor( entity ).isDirty();
    }

    return false;
}
项目:lams    文件:DefaultFlushEntityEventListener.java   
public int[] visitAttributes(CustomEntityDirtinessStrategy.AttributeChecker attributeChecker) {
    databaseSnapshot = null;
    index = 0;

    final int[] indexes = new int[numberOfAttributes];
    int count = 0;
    for (; index < numberOfAttributes; index++ ) {
        if ( attributeChecker.isDirty( this ) ) {
            indexes[count++] = index;
        }
    }
    return Arrays.copyOf( indexes, count );
}
项目:lemon    文件:SessionFactoryWrapper.java   
public CustomEntityDirtinessStrategy getCustomEntityDirtinessStrategy() {
    return sessionFactoryImplementor.getCustomEntityDirtinessStrategy();
}
项目:lams    文件:SessionFactoryImpl.java   
@Override
public CustomEntityDirtinessStrategy getCustomEntityDirtinessStrategy() {
    return customEntityDirtinessStrategy;
}
项目:hibernate-dynamic-dialects    文件:SessionFactoryImpl.java   
@Override
public CustomEntityDirtinessStrategy getCustomEntityDirtinessStrategy() {
    return customEntityDirtinessStrategy;
}
项目:lams    文件:SessionFactoryImplementor.java   
public CustomEntityDirtinessStrategy getCustomEntityDirtinessStrategy();