public class TypeResolver extends Object implements Serializable
BasicTypeRegistry
and TypeFactory
.Constructor and Description |
---|
TypeResolver() |
TypeResolver(BasicTypeRegistry basicTypeRegistry,
TypeFactory typeFactory) |
Modifier and Type | Method and Description |
---|---|
BasicType |
basic(String name)
Locate a Hibernate basic type given (one of) its registration names.
|
TypeFactory |
getTypeFactory() |
Type |
heuristicType(String typeName)
|
Type |
heuristicType(String typeName,
Properties parameters)
Uses heuristics to deduce the proper
Type given a string naming the type or Java class. |
void |
registerTypeOverride(BasicType type) |
void |
registerTypeOverride(CompositeUserType type,
String[] keys) |
void |
registerTypeOverride(UserType type,
String[] keys) |
TypeResolver |
scope(SessionFactoryImplementor factory) |
public TypeResolver()
public TypeResolver(BasicTypeRegistry basicTypeRegistry, TypeFactory typeFactory)
public TypeResolver scope(SessionFactoryImplementor factory)
public void registerTypeOverride(BasicType type)
public void registerTypeOverride(CompositeUserType type, String[] keys)
public TypeFactory getTypeFactory()
public BasicType basic(String name)
name
- The registration namepublic Type heuristicType(String typeName) throws MappingException
typeName
- The name (see heuristic algorithm discussion on heuristicType(String, Properties)
).MappingException
- Can be thrown from heuristicType(String, Properties)
public Type heuristicType(String typeName, Properties parameters) throws MappingException
Type
given a string naming the type or Java class.
The search goes as follows:Type
implementor, return an instanceCompositeUserType
or a UserType
, return an instance of class wrapped intot the appropriate Type
adapterLifecycle
, return the corresponding entity typeSerializable
, return the corresponding serializable typetypeName
- The name (see heuristic algorithm above).parameters
- Any parameters for the type. Only applied if built!MappingException
- Indicates a problem attempting to resolve 'typeName' as a Class
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.