@Override public LazyAttributeLoadingInterceptor injectInterceptor( Object entity, SharedSessionContractImplementor session) throws NotInstrumentedException { throw new NotInstrumentedException( errorMsg ); }
@Override public LazyAttributeLoadingInterceptor extractInterceptor(Object entity) throws NotInstrumentedException { throw new NotInstrumentedException( errorMsg ); }
@Override public LazyAttributeLoadingInterceptor extractInterceptor(Object entity) throws NotInstrumentedException { if ( !enhancedForLazyLoading ) { throw new NotInstrumentedException( "Entity class [" + entityClass.getName() + "] is not enhanced for lazy loading" ); } if ( !entityClass.isInstance( entity ) ) { throw new IllegalArgumentException( String.format( "Passed entity instance [%s] is not of expected type [%s]", entity, getEntityName() ) ); } final PersistentAttributeInterceptor interceptor = ( (PersistentAttributeInterceptable) entity ).$$_hibernate_getInterceptor(); if ( interceptor == null ) { return null; } return (LazyAttributeLoadingInterceptor) interceptor; }
@Override public LazyAttributeLoadingInterceptor injectInterceptor(Object entity, SharedSessionContractImplementor session) { if ( !enhancedForLazyLoading ) { throw new NotInstrumentedException( "Entity class [" + entityClass.getName() + "] is not enhanced for lazy loading" ); } if ( !entityClass.isInstance( entity ) ) { throw new IllegalArgumentException( String.format( "Passed entity instance [%s] is not of expected type [%s]", entity, getEntityName() ) ); } final LazyAttributeLoadingInterceptor interceptor = new LazyAttributeLoadingInterceptor( getEntityName(), lazyAttributesMetadata.getLazyAttributeNames(), session ); ( (PersistentAttributeInterceptable) entity ).$$_hibernate_setInterceptor( interceptor ); return interceptor; } }
@Override public FieldInterceptor injectInterceptor( Object entity, String entityName, Set uninitializedFieldNames, SessionImplementor session) throws NotInstrumentedException { throw new NotInstrumentedException( errorMsg ); } }
@Override public FieldInterceptor injectInterceptor( Object entity, String entityName, Set uninitializedFieldNames, SessionImplementor session) throws NotInstrumentedException { throw new NotInstrumentedException( errorMsg ); } }
@Override public LazyAttributeLoadingInterceptor extractInterceptor(Object entity) throws NotInstrumentedException { throw new NotInstrumentedException( errorMsg ); }
@Override public FieldInterceptor extractInterceptor(Object entity) throws NotInstrumentedException { throw new NotInstrumentedException( errorMsg ); }
@Override public FieldInterceptor extractInterceptor(Object entity) throws NotInstrumentedException { throw new NotInstrumentedException( errorMsg ); }
@Override public LazyAttributeLoadingInterceptor injectInterceptor( Object entity, SharedSessionContractImplementor session) throws NotInstrumentedException { throw new NotInstrumentedException( errorMsg ); }
@Override public LazyAttributeLoadingInterceptor extractInterceptor(Object entity) throws NotInstrumentedException { if ( !enhancedForLazyLoading ) { throw new NotInstrumentedException( "Entity class [" + entityClass.getName() + "] is not enhanced for lazy loading" ); } if ( !entityClass.isInstance( entity ) ) { throw new IllegalArgumentException( String.format( "Passed entity instance [%s] is not of expected type [%s]", entity, getEntityName() ) ); } final PersistentAttributeInterceptor interceptor = ( (PersistentAttributeInterceptable) entity ).$$_hibernate_getInterceptor(); if ( interceptor == null ) { return null; } return (LazyAttributeLoadingInterceptor) interceptor; }
@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 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 LazyAttributeLoadingInterceptor injectInterceptor(Object entity, SharedSessionContractImplementor session) { if ( !enhancedForLazyLoading ) { throw new NotInstrumentedException( "Entity class [" + entityClass.getName() + "] is not enhanced for lazy loading" ); } if ( !entityClass.isInstance( entity ) ) { throw new IllegalArgumentException( String.format( "Passed entity instance [%s] is not of expected type [%s]", entity, getEntityName() ) ); } final LazyAttributeLoadingInterceptor interceptor = new LazyAttributeLoadingInterceptor( getEntityName(), lazyAttributesMetadata.getLazyAttributeNames(), session ); ( (PersistentAttributeInterceptable) entity ).$$_hibernate_setInterceptor( interceptor ); return interceptor; } }