Package org.hibernate
Interface TypeHelper
-
public interface TypeHelper
Provides access to the variousType
instances associated with theSessionFactory
. This is intended for use by application developers.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Type
any(Type metaType, Type identifierType)
Retrieve the type representing an ANY mapping.BasicType
basic(java.lang.Class javaType)
Convenience form ofbasic(String)
.BasicType
basic(java.lang.String name)
Retrieve the basic type registered against the given name.Type
custom(java.lang.Class userTypeClass)
Retrieve the type for the given user-type class (UserType
orCompositeUserType
).Type
custom(java.lang.Class userTypeClass, java.util.Properties properties)
Retrieve the type for the given user-type class (UserType
orCompositeUserType
).Type
entity(java.lang.Class entityClass)
Retrieve a type representing the given entity.Type
entity(java.lang.String entityName)
Retrieve a type representing the given entity.Type
heuristicType(java.lang.String name)
Uses heuristics to deduce the properType
given a string naming the type or Java class.
-
-
-
Method Detail
-
basic
BasicType basic(java.lang.String name)
Retrieve the basic type registered against the given name.- Parameters:
name
- The name of the basic type to retrieve- Returns:
- The basic type, or null.
-
basic
BasicType basic(java.lang.Class javaType)
Convenience form ofbasic(String)
. The intended use of this is something likebasic(Integer.class)
orbasic(int.class)
- Parameters:
javaType
- The java type for which to retrieve the type instance.- Returns:
- The basic type, or null.
-
heuristicType
Type heuristicType(java.lang.String name)
Uses heuristics to deduce the properType
given a string naming the type or Java class. SeeTypeResolver.heuristicType(java.lang.String)
for a discussion of the heuristic algorithm.- Parameters:
name
- The name of the type or Java class- Returns:
- The deduced type, or null.
- See Also:
TypeResolver.heuristicType(java.lang.String)
-
entity
Type entity(java.lang.Class entityClass)
Retrieve a type representing the given entity.- Parameters:
entityClass
- The entity Java type.- Returns:
- The type, or null
-
entity
Type entity(java.lang.String entityName)
Retrieve a type representing the given entity.- Parameters:
entityName
- The entity name.- Returns:
- The type, or null
-
custom
Type custom(java.lang.Class userTypeClass)
Retrieve the type for the given user-type class (UserType
orCompositeUserType
).- Parameters:
userTypeClass
- The user type class- Returns:
- The type, or null
-
custom
Type custom(java.lang.Class userTypeClass, java.util.Properties properties)
Retrieve the type for the given user-type class (UserType
orCompositeUserType
).- Parameters:
userTypeClass
- The user type classproperties
- Configuration properties.- Returns:
- The type, or null
-
-