HHH-7380 bug when initialize MULTI_TENANT_IDENTIFIER_RESOLVER and CUSTOM_ENTITY_DIRTINESS_STRATEGY

This commit is contained in:
Strong Liu 2012-06-11 17:46:54 +08:00
parent 7cda27b6aa
commit aac6510098
1 changed files with 12 additions and 12 deletions

View File

@ -589,7 +589,7 @@ public final class SessionFactoryImpl
}
Class<CustomEntityDirtinessStrategy> customEntityDirtinessStrategyClass;
if ( Class.class.isInstance( value ) ) {
customEntityDirtinessStrategyClass = Class.class.cast( customEntityDirtinessStrategy );
customEntityDirtinessStrategyClass = Class.class.cast( value );
}
else {
try {
@ -663,7 +663,7 @@ public final class SessionFactoryImpl
Class<CurrentTenantIdentifierResolver> implClass;
if ( Class.class.isInstance( value ) ) {
implClass = Class.class.cast( customEntityDirtinessStrategy );
implClass = Class.class.cast( value );
}
else {
try {
@ -677,17 +677,17 @@ public final class SessionFactoryImpl
return null;
}
}
try {
return implClass.newInstance();
if ( implClass != null ) {
try {
return implClass.newInstance();
}
catch ( Exception e ) {
LOG.debugf(
"Unable to instantiate CurrentTenantIdentifierResolver class %s",
implClass.getName()
);
}
}
catch (Exception e) {
LOG.debugf(
"Unable to instantiate CurrentTenantIdentifierResolver class %s",
implClass.getName()
);
}
return null;
}