formatting: use tabs
This commit is contained in:
parent
f5702548bb
commit
d382e70b65
|
@ -63,11 +63,11 @@ public interface ProxyFactory {
|
|||
*/
|
||||
public void postInstantiate(
|
||||
String entityName,
|
||||
Class persistentClass,
|
||||
Set interfaces,
|
||||
Method getIdentifierMethod,
|
||||
Method setIdentifierMethod,
|
||||
CompositeType componentIdType) throws HibernateException;
|
||||
Class persistentClass,
|
||||
Set interfaces,
|
||||
Method getIdentifierMethod,
|
||||
Method setIdentifierMethod,
|
||||
CompositeType componentIdType) throws HibernateException;
|
||||
|
||||
/**
|
||||
* Create a new proxy instance
|
||||
|
|
|
@ -29,7 +29,6 @@ import java.lang.reflect.Method;
|
|||
import org.hibernate.engine.spi.EntityKey;
|
||||
import org.hibernate.engine.spi.SessionImplementor;
|
||||
import org.hibernate.internal.util.MarkerObject;
|
||||
import org.hibernate.internal.util.ReflectHelper;
|
||||
import org.hibernate.proxy.AbstractLazyInitializer;
|
||||
import org.hibernate.type.CompositeType;
|
||||
|
||||
|
|
|
@ -48,8 +48,7 @@ import org.hibernate.type.CompositeType;
|
|||
*/
|
||||
public class JavassistLazyInitializer extends BasicLazyInitializer implements MethodHandler {
|
||||
|
||||
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class,
|
||||
JavassistLazyInitializer.class.getName());
|
||||
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, JavassistLazyInitializer.class.getName());
|
||||
|
||||
private static final MethodFilter FINALIZE_FILTER = new MethodFilter() {
|
||||
public boolean isHandled(Method m) {
|
||||
|
@ -63,39 +62,39 @@ public class JavassistLazyInitializer extends BasicLazyInitializer implements Me
|
|||
|
||||
private JavassistLazyInitializer(
|
||||
final String entityName,
|
||||
final Class persistentClass,
|
||||
final Class[] interfaces,
|
||||
final Serializable id,
|
||||
final Method getIdentifierMethod,
|
||||
final Method setIdentifierMethod,
|
||||
final CompositeType componentIdType,
|
||||
final SessionImplementor session,
|
||||
final boolean overridesEquals) {
|
||||
final Class persistentClass,
|
||||
final Class[] interfaces,
|
||||
final Serializable id,
|
||||
final Method getIdentifierMethod,
|
||||
final Method setIdentifierMethod,
|
||||
final CompositeType componentIdType,
|
||||
final SessionImplementor session,
|
||||
final boolean overridesEquals) {
|
||||
super( entityName, persistentClass, id, getIdentifierMethod, setIdentifierMethod, componentIdType, session, overridesEquals );
|
||||
this.interfaces = interfaces;
|
||||
}
|
||||
|
||||
public static HibernateProxy getProxy(
|
||||
final String entityName,
|
||||
final Class persistentClass,
|
||||
final Class[] interfaces,
|
||||
final Method getIdentifierMethod,
|
||||
final Method setIdentifierMethod,
|
||||
CompositeType componentIdType,
|
||||
final Serializable id,
|
||||
final SessionImplementor session) throws HibernateException {
|
||||
final Class persistentClass,
|
||||
final Class[] interfaces,
|
||||
final Method getIdentifierMethod,
|
||||
final Method setIdentifierMethod,
|
||||
CompositeType componentIdType,
|
||||
final Serializable id,
|
||||
final SessionImplementor session) throws HibernateException {
|
||||
// note: interface is assumed to already contain HibernateProxy.class
|
||||
try {
|
||||
final JavassistLazyInitializer instance = new JavassistLazyInitializer(
|
||||
entityName,
|
||||
persistentClass,
|
||||
interfaces,
|
||||
id,
|
||||
getIdentifierMethod,
|
||||
setIdentifierMethod,
|
||||
componentIdType,
|
||||
session,
|
||||
ReflectHelper.overridesEquals(persistentClass)
|
||||
persistentClass,
|
||||
interfaces,
|
||||
id,
|
||||
getIdentifierMethod,
|
||||
setIdentifierMethod,
|
||||
componentIdType,
|
||||
session,
|
||||
ReflectHelper.overridesEquals(persistentClass)
|
||||
);
|
||||
ProxyFactory factory = new ProxyFactory();
|
||||
factory.setSuperclass( interfaces.length == 1 ? persistentClass : null );
|
||||
|
@ -108,32 +107,32 @@ public class JavassistLazyInitializer extends BasicLazyInitializer implements Me
|
|||
return proxy;
|
||||
}
|
||||
catch ( Throwable t ) {
|
||||
LOG.error(LOG.javassistEnhancementFailed(entityName), t);
|
||||
throw new HibernateException(LOG.javassistEnhancementFailed(entityName), t);
|
||||
LOG.error(LOG.javassistEnhancementFailed(entityName), t);
|
||||
throw new HibernateException(LOG.javassistEnhancementFailed(entityName), t);
|
||||
}
|
||||
}
|
||||
|
||||
public static HibernateProxy getProxy(
|
||||
final Class factory,
|
||||
final String entityName,
|
||||
final Class persistentClass,
|
||||
final Class[] interfaces,
|
||||
final Method getIdentifierMethod,
|
||||
final Method setIdentifierMethod,
|
||||
final CompositeType componentIdType,
|
||||
final Serializable id,
|
||||
final SessionImplementor session,
|
||||
final boolean classOverridesEquals) throws HibernateException {
|
||||
final String entityName,
|
||||
final Class persistentClass,
|
||||
final Class[] interfaces,
|
||||
final Method getIdentifierMethod,
|
||||
final Method setIdentifierMethod,
|
||||
final CompositeType componentIdType,
|
||||
final Serializable id,
|
||||
final SessionImplementor session,
|
||||
final boolean classOverridesEquals) throws HibernateException {
|
||||
|
||||
final JavassistLazyInitializer instance = new JavassistLazyInitializer(
|
||||
entityName,
|
||||
persistentClass,
|
||||
interfaces, id,
|
||||
getIdentifierMethod,
|
||||
setIdentifierMethod,
|
||||
componentIdType,
|
||||
session,
|
||||
classOverridesEquals
|
||||
persistentClass,
|
||||
interfaces, id,
|
||||
getIdentifierMethod,
|
||||
setIdentifierMethod,
|
||||
componentIdType,
|
||||
session,
|
||||
classOverridesEquals
|
||||
);
|
||||
|
||||
final HibernateProxy proxy;
|
||||
|
@ -153,7 +152,7 @@ public class JavassistLazyInitializer extends BasicLazyInitializer implements Me
|
|||
|
||||
public static Class getProxyFactory(
|
||||
Class persistentClass,
|
||||
Class[] interfaces) throws HibernateException {
|
||||
Class[] interfaces) throws HibernateException {
|
||||
// note: interfaces is assumed to already contain HibernateProxy.class
|
||||
|
||||
try {
|
||||
|
@ -164,8 +163,8 @@ public class JavassistLazyInitializer extends BasicLazyInitializer implements Me
|
|||
return factory.createClass();
|
||||
}
|
||||
catch ( Throwable t ) {
|
||||
LOG.error(LOG.javassistEnhancementFailed(persistentClass.getName()), t);
|
||||
throw new HibernateException(LOG.javassistEnhancementFailed(persistentClass.getName()), t);
|
||||
LOG.error(LOG.javassistEnhancementFailed(persistentClass.getName()), t);
|
||||
throw new HibernateException(LOG.javassistEnhancementFailed(persistentClass.getName()), t);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -220,16 +219,16 @@ public class JavassistLazyInitializer extends BasicLazyInitializer implements Me
|
|||
}
|
||||
|
||||
@Override
|
||||
protected Object serializableProxy() {
|
||||
protected Object serializableProxy() {
|
||||
return new SerializableProxy(
|
||||
getEntityName(),
|
||||
persistentClass,
|
||||
interfaces,
|
||||
getIdentifier(),
|
||||
( isReadOnlySettingAvailable() ? Boolean.valueOf( isReadOnly() ) : isReadOnlyBeforeAttachedToSession() ),
|
||||
getIdentifierMethod,
|
||||
setIdentifierMethod,
|
||||
componentIdType
|
||||
persistentClass,
|
||||
interfaces,
|
||||
getIdentifier(),
|
||||
( isReadOnlySettingAvailable() ? Boolean.valueOf( isReadOnly() ) : isReadOnlyBeforeAttachedToSession() ),
|
||||
getIdentifierMethod,
|
||||
setIdentifierMethod,
|
||||
componentIdType
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,9 +53,9 @@ public class JavassistProxyFactory implements ProxyFactory, Serializable {
|
|||
public void postInstantiate(
|
||||
final String entityName,
|
||||
final Class persistentClass,
|
||||
final Set interfaces,
|
||||
final Set interfaces,
|
||||
final Method getIdentifierMethod,
|
||||
final Method setIdentifierMethod,
|
||||
final Method setIdentifierMethod,
|
||||
CompositeType componentIdType) throws HibernateException {
|
||||
this.entityName = entityName;
|
||||
this.persistentClass = persistentClass;
|
||||
|
@ -69,18 +69,18 @@ public class JavassistProxyFactory implements ProxyFactory, Serializable {
|
|||
|
||||
public HibernateProxy getProxy(
|
||||
Serializable id,
|
||||
SessionImplementor session) throws HibernateException {
|
||||
SessionImplementor session) throws HibernateException {
|
||||
return JavassistLazyInitializer.getProxy(
|
||||
factory,
|
||||
entityName,
|
||||
entityName,
|
||||
persistentClass,
|
||||
interfaces,
|
||||
getIdentifierMethod,
|
||||
interfaces,
|
||||
getIdentifierMethod,
|
||||
setIdentifierMethod,
|
||||
componentIdType,
|
||||
id,
|
||||
session,
|
||||
overridesEquals
|
||||
componentIdType,
|
||||
id,
|
||||
session,
|
||||
overridesEquals
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue