Class NiceByteBuddyInterceptor
java.lang.Object
org.hibernate.proxy.AbstractLazyInitializer
org.hibernate.proxy.pojo.BasicLazyInitializer
org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor
ch.tocco.nice2.persist.core.impl.hibernate.proxy.NiceByteBuddyInterceptor
- All Implemented Interfaces:
org.hibernate.proxy.LazyInitializer
,org.hibernate.proxy.ProxyConfiguration.Interceptor
public class NiceByteBuddyInterceptor
extends org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor
A custom
LazyInitializer
that is aware of the Entity
interface.
It only initializes the proxy if the entity data is required and prevents initialization of the proxy
when methods like Entity.getModel()
are called.-
Field Summary
Fields inherited from class org.hibernate.proxy.pojo.BasicLazyInitializer
componentIdType, getIdentifierMethod, INVOKE_IMPLEMENTATION, overridesEquals, persistentClass, setIdentifierMethod
-
Constructor Summary
ConstructorDescriptionNiceByteBuddyInterceptor
(DataModel dataModel, Context context, String entityName, Class persistentClass, Class[] interfaces, Serializable id, Method getIdentifierMethod, Method setIdentifierMethod, org.hibernate.type.CompositeType componentIdType, org.hibernate.engine.spi.SharedSessionContractImplementor session, boolean overridesEquals) -
Method Summary
Methods inherited from class org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor
serializableProxy
Methods inherited from class org.hibernate.proxy.pojo.BasicLazyInitializer
getImplementationClass, getPersistentClass, invoke
Methods inherited from class org.hibernate.proxy.AbstractLazyInitializer
getEntityName, getIdentifier, getImplementation, getImplementation, getImplementationEntityName, getInternalIdentifier, getSession, getSessionFactoryName, getSessionFactoryUuid, getTarget, initialize, initializeWithoutLoadIfPossible, isAllowLoadOutsideTransaction, isConnectedToSession, isReadOnly, isReadOnlyBeforeAttachedToSession, isReadOnlySettingAvailable, isUninitialized, isUnwrap, permissiveInitialization, prepareForPossibleLoadingOutsideTransaction, setIdentifier, setImplementation, setReadOnly, setSession, setUnwrap, unsetSession
-
Constructor Details
-
Method Details
-
intercept
- Specified by:
intercept
in interfaceorg.hibernate.proxy.ProxyConfiguration.Interceptor
- Overrides:
intercept
in classorg.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor
- Throws:
Throwable
-