HHH-7919 : Miscellaneous bugfixes

This commit is contained in:
Strong Liu 2013-07-18 04:19:14 +08:00
parent da40234ab7
commit b1312381b1
4 changed files with 12 additions and 35 deletions

View File

@ -45,16 +45,12 @@ public class TypeLocatorImpl implements TypeHelper, Serializable {
this.typeResolver = typeResolver;
}
/**
* {@inheritDoc}
*/
@Override
public BasicType basic(String name) {
return typeResolver.basic( name );
}
/**
* {@inheritDoc}
*/
@Override
public BasicType basic(Class javaType) {
BasicType type = typeResolver.basic( javaType.getName() );
if ( type == null ) {
@ -134,39 +130,27 @@ public class TypeLocatorImpl implements TypeHelper, Serializable {
return null;
}
/**
* {@inheritDoc}
*/
@Override
public Type heuristicType(String name) {
return typeResolver.heuristicType( name );
}
/**
* {@inheritDoc}
*/
@Override
public Type entity(Class entityClass) {
return entity( entityClass.getName() );
}
/**
* {@inheritDoc}
*/
@Override
public Type entity(String entityName) {
return typeResolver.getTypeFactory().manyToOne( entityName );
}
/**
* {@inheritDoc}
*/
@SuppressWarnings({ "unchecked" })
@Override
public Type custom(Class userTypeClass) {
return custom( userTypeClass, null );
}
/**
* {@inheritDoc}
*/
@SuppressWarnings({ "unchecked" })
@Override
public Type custom(Class userTypeClass, Properties parameters) {
if ( CompositeUserType.class.isAssignableFrom( userTypeClass ) ) {
return typeResolver.getTypeFactory().customComponent( userTypeClass, parameters );
@ -176,9 +160,7 @@ public class TypeLocatorImpl implements TypeHelper, Serializable {
}
}
/**
* {@inheritDoc}
*/
@Override
public Type any(Type metaType, Type identifierType) {
return typeResolver.getTypeFactory().any( metaType, identifierType );
}

View File

@ -44,7 +44,7 @@ public class BasicTypeRegistry implements Serializable {
private static final CoreMessageLogger LOG = Logger.getMessageLogger(CoreMessageLogger.class, BasicTypeRegistry.class.getName());
// TODO : analyze these sizing params; unfortunately this seems to be the only way to give a "concurrencyLevel"
private Map<String,BasicType> registry = new ConcurrentHashMap<String, BasicType>( 100, .75f, 1 );
private final Map<String,BasicType> registry = new ConcurrentHashMap<String, BasicType>( 100, .75f, 1 );
private boolean locked = false;
public BasicTypeRegistry() {

View File

@ -40,11 +40,8 @@ import org.hibernate.usertype.UserType;
import org.jboss.logging.Logger;
/**
* Used internally to build instances of {@link Type}, specifically it builds instances of
*
*
* Used internally to obtain instances of <tt>Type</tt>. Applications should use static methods
* and constants on <tt>org.hibernate.Hibernate</tt>.
* Used internally to obtain instances of {@link Type}. Applications should use static methods
* and constants on {@link StandardBasicTypes}.
*
* @author Gavin King
* @author Steve Ebersole

View File

@ -142,9 +142,7 @@ public abstract class BaseCoreFunctionalTestCase extends BaseFunctionalTestCase
}
protected void rebuildSessionFactory() {
if ( sessionFactory == null ) {
return;
}
releaseSessionFactory();
buildSessionFactory();
}