Methods Summary |
---|
public static void | clearDirty(java.lang.Object entity)
FieldInterceptor interceptor = extractFieldInterceptor( entity );
if ( interceptor != null ) {
interceptor.clearDirty();
}
|
public static FieldInterceptor | extractFieldInterceptor(java.lang.Object entity)
if ( entity == null ) {
return null;
}
Class[] definedInterfaces = entity.getClass().getInterfaces();
for ( int i = 0; i < definedInterfaces.length; i++ ) {
if ( "net.sf.cglib.transform.impl.InterceptFieldEnabled".equals( definedInterfaces[i].getName() ) ) {
// we have a CGLIB enhanced entity
return CGLIBHelper.extractFieldInterceptor( entity );
}
else if ( "org.hibernate.bytecode.javassist.FieldHandled".equals( definedInterfaces[i].getName() ) ) {
// we have a Javassist enhanced entity
return JavassistHelper.extractFieldInterceptor( entity );
}
}
return null;
|
public static FieldInterceptor | injectFieldInterceptor(java.lang.Object entity, java.lang.String entityName, java.util.Set uninitializedFieldNames, org.hibernate.engine.SessionImplementor session)
if ( entity != null ) {
Class[] definedInterfaces = entity.getClass().getInterfaces();
for ( int i = 0; i < definedInterfaces.length; i++ ) {
if ( "net.sf.cglib.transform.impl.InterceptFieldEnabled".equals( definedInterfaces[i].getName() ) ) {
// we have a CGLIB enhanced entity
return CGLIBHelper.injectFieldInterceptor( entity, entityName, uninitializedFieldNames, session );
}
else if ( "org.hibernate.bytecode.javassist.FieldHandled".equals( definedInterfaces[i].getName() ) ) {
// we have a Javassist enhanced entity
return JavassistHelper.injectFieldInterceptor( entity, entityName, uninitializedFieldNames, session );
}
}
}
return null;
|
public static boolean | isInstrumented(java.lang.Class entityClass)
Class[] definedInterfaces = entityClass.getInterfaces();
for ( int i = 0; i < definedInterfaces.length; i++ ) {
if ( "net.sf.cglib.transform.impl.InterceptFieldEnabled".equals( definedInterfaces[i].getName() )
|| "org.hibernate.bytecode.javassist.FieldHandled".equals( definedInterfaces[i].getName() ) ) {
return true;
}
}
return false;
|
public static boolean | isInstrumented(java.lang.Object entity)
return entity != null && isInstrumented( entity.getClass() );
|
public static void | markDirty(java.lang.Object entity)
FieldInterceptor interceptor = extractFieldInterceptor( entity );
if ( interceptor != null ) {
interceptor.dirty();
}
|