@Override public FieldInterceptor injectInterceptor( Object entity, String entityName, Set uninitializedFieldNames, SessionImplementor session) throws NotInstrumentedException { if ( !entityClass.isInstance( entity ) ) { throw new IllegalArgumentException( String.format( "Passed entity instance [%s] is not of expected type [%s]", entity, getEntityName() ) ); } if ( ! isInstrumented() ) { throw new NotInstrumentedException( String.format( "Entity class [%s] is not instrumented", getEntityName() ) ); } return JavassistHelper.injectFieldInterceptor( entity, entityName, uninitializedFieldNames, session ); } }
@Override public FieldInterceptor injectInterceptor( Object entity, String entityName, Set uninitializedFieldNames, SessionImplementor session) throws NotInstrumentedException { if ( !entityClass.isInstance( entity ) ) { throw new IllegalArgumentException( String.format( "Passed entity instance [%s] is not of expected type [%s]", entity, getEntityName() ) ); } if ( ! isInstrumented() ) { throw new NotInstrumentedException( String.format( "Entity class [%s] is not instrumented", getEntityName() ) ); } return JavassistHelper.injectFieldInterceptor( entity, entityName, uninitializedFieldNames, session ); } }
@Override public FieldInterceptor extractInterceptor(Object entity) throws NotInstrumentedException { if ( !entityClass.isInstance( entity ) ) { throw new IllegalArgumentException( String.format( "Passed entity instance [%s] is not of expected type [%s]", entity, getEntityName() ) ); } if ( ! isInstrumented() ) { throw new NotInstrumentedException( String.format( "Entity class [%s] is not instrumented", getEntityName() ) ); } return JavassistHelper.extractFieldInterceptor( entity ); }
@Override public FieldInterceptor extractInterceptor(Object entity) throws NotInstrumentedException { if ( !entityClass.isInstance( entity ) ) { throw new IllegalArgumentException( String.format( "Passed entity instance [%s] is not of expected type [%s]", entity, getEntityName() ) ); } if ( ! isInstrumented() ) { throw new NotInstrumentedException( String.format( "Entity class [%s] is not instrumented", getEntityName() ) ); } return JavassistHelper.extractFieldInterceptor( entity ); }
@Override public EntityInstrumentationMetadata getEntityInstrumentationMetadata(Class entityClass) { return new EntityInstrumentationMetadataImpl( entityClass ); }
@Override public EntityInstrumentationMetadata getEntityInstrumentationMetadata(Class entityClass) { return new EntityInstrumentationMetadataImpl( entityClass ); }