Package org.hibernate.bytecode.instrumentation.spi

Examples of org.hibernate.bytecode.instrumentation.spi.FieldInterceptor


    }
    return interceptor;
  }

  public static void clearDirty(Object entity) {
    FieldInterceptor interceptor = extractFieldInterceptor( entity );
    if ( interceptor != null ) {
      interceptor.clearDirty();
    }
  }
View Full Code Here


      interceptor.clearDirty();
    }
  }

  public static void markDirty(Object entity) {
    FieldInterceptor interceptor = extractFieldInterceptor( entity );
    if ( interceptor != null ) {
      interceptor.dirty();
    }
  }
View Full Code Here

//  }

  public void afterReassociate(Object entity, SessionImplementor session) {
    //if ( hasLazyProperties() ) {
    if ( FieldInterceptionHelper.isInstrumented( entity ) ) {
      FieldInterceptor interceptor = FieldInterceptionHelper.extractFieldInterceptor( entity );
      if ( interceptor != null ) {
        interceptor.setSession( session );
      }
      else {
        FieldInterceptor fieldInterceptor = FieldInterceptionHelper.injectFieldInterceptor(
            entity,
            getEntityName(),
            null,
            session
        );
        fieldInterceptor.dirty();
      }
    }
  }
View Full Code Here

   * {@inheritDoc}
   */
  @Override
    public boolean hasUninitializedLazyProperties(Object entity) {
    if ( getEntityMetamodel().hasLazyProperties() ) {
      FieldInterceptor callback = FieldInterceptionHelper.extractFieldInterceptor( entity );
      return callback != null && !callback.isInitialized();
    }
    else {
      return false;
    }
  }
View Full Code Here

   * {@inheritDoc}
   */
  @Override
    public boolean hasUninitializedLazyProperties(Object entity) {
    if ( getEntityMetamodel().hasLazyProperties() ) {
      FieldInterceptor callback = FieldInterceptionHelper.extractFieldInterceptor( entity );
      return callback != null && !callback.isInitialized();
    }
    else {
      return false;
    }
  }
View Full Code Here

//  }

  public void afterReassociate(Object entity, SessionImplementor session) {
    //if ( hasLazyProperties() ) {
    if ( FieldInterceptionHelper.isInstrumented( entity ) ) {
      FieldInterceptor interceptor = FieldInterceptionHelper.extractFieldInterceptor( entity );
      if ( interceptor != null ) {
        interceptor.setSession( session );
      }
      else {
        FieldInterceptor fieldInterceptor = FieldInterceptionHelper.injectFieldInterceptor(
            entity,
            getEntityName(),
            null,
            session
        );
        fieldInterceptor.dirty();
      }
    }
  }
View Full Code Here

//    }
//  }

  public void afterReassociate(Object entity, SessionImplementor session) {
    if ( getEntityMetamodel().getInstrumentationMetadata().isInstrumented() ) {
      FieldInterceptor interceptor = getEntityMetamodel().getInstrumentationMetadata().extractInterceptor( entity );
      if ( interceptor != null ) {
        interceptor.setSession( session );
      }
      else {
        FieldInterceptor fieldInterceptor = getEntityMetamodel().getInstrumentationMetadata().injectInterceptor(
            entity,
            getEntityName(),
            null,
            session
        );
        fieldInterceptor.dirty();
      }
    }

    handleNaturalIdReattachment( entity, session );
  }
View Full Code Here

//  }

  public void afterReassociate(Object entity, SessionImplementor session) {
    //if ( hasLazyProperties() ) {
    if ( FieldInterceptionHelper.isInstrumented( entity ) ) {
      FieldInterceptor interceptor = FieldInterceptionHelper.extractFieldInterceptor( entity );
      if ( interceptor != null ) {
        interceptor.setSession( session );
      }
      else {
        FieldInterceptor fieldInterceptor = FieldInterceptionHelper.injectFieldInterceptor(
            entity,
            getEntityName(),
            null,
            session
        );
        fieldInterceptor.dirty();
      }
    }
  }
View Full Code Here

   * {@inheritDoc}
   */
  @Override
    public boolean hasUninitializedLazyProperties(Object entity) {
    if ( getEntityMetamodel().hasLazyProperties() ) {
      FieldInterceptor callback = FieldInterceptionHelper.extractFieldInterceptor( entity );
      return callback != null && !callback.isInitialized();
    }
    else {
      return false;
    }
  }
View Full Code Here

      this.version = nextVersion;
      getPersister().setPropertyValue( entity, getPersister().getVersionProperty(), nextVersion );
    }

    if ( getPersister().getInstrumentationMetadata().isInstrumented() ) {
      final FieldInterceptor interceptor = getPersister().getInstrumentationMetadata().extractInterceptor( entity );
      if ( interceptor != null ) {
        interceptor.clearDirty();
      }
    }
        if( entity instanceof SelfDirtinessTracker)
            ((SelfDirtinessTracker) entity).$$_hibernate_clearDirtyAttributes();
View Full Code Here

TOP

Related Classes of org.hibernate.bytecode.instrumentation.spi.FieldInterceptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.