org.hibernate.type
Class TypeFactory

java.lang.Object
  extended by org.hibernate.type.TypeFactory
All Implemented Interfaces:
Serializable

public final class TypeFactory
extends Object
implements Serializable

Used internally to build instances of Type, specifically it builds instances of Used internally to obtain instances of Type. Applications should use static methods and constants on org.hibernate.Hibernate.

See Also:
Serialized Form

Nested Class Summary
static interface TypeFactory.TypeScope
           
 
Constructor Summary
TypeFactory()
           
 
Method Summary
 Type any(Type metaType, Type identifierType)
           
 CollectionType array(String role, String propertyRef, boolean embedded, Class elementClass)
           
 CollectionType bag(String role, String propertyRef, boolean embedded)
           
 Type byClass(Class clazz, Properties parameters)
           
 ComponentType component(ComponentMetamodel metamodel)
           
 CustomType custom(Class<UserType> typeClass, Properties parameters)
           
static CustomType custom(Class<UserType> typeClass, Properties parameters, TypeFactory.TypeScope scope)
          Deprecated. Only for use temporary use by Hibernate
 CollectionType customCollection(String typeName, Properties typeParameters, String role, String propertyRef, boolean embedded)
           
 CompositeCustomType customComponent(Class<CompositeUserType> typeClass, Properties parameters)
           
static CompositeCustomType customComponent(Class<CompositeUserType> typeClass, Properties parameters, TypeFactory.TypeScope scope)
          Deprecated. Only for use temporary use by Hibernate
 EmbeddedComponentType embeddedComponent(ComponentMetamodel metamodel)
           
 CollectionType idbag(String role, String propertyRef, boolean embedded)
           
static void injectParameters(Object type, Properties parameters)
           
 void injectSessionFactory(SessionFactoryImplementor factory)
           
 CollectionType list(String role, String propertyRef, boolean embedded)
           
 EntityType manyToOne(String persistentClass)
           
 EntityType manyToOne(String persistentClass, boolean lazy)
           
 EntityType manyToOne(String persistentClass, String uniqueKeyPropertyName, boolean lazy, boolean unwrapProxy, boolean isEmbeddedInXML, boolean ignoreNotFound, boolean isLogicalOneToOne)
           
 CollectionType map(String role, String propertyRef, boolean embedded)
           
 EntityType oneToOne(String persistentClass, ForeignKeyDirection foreignKeyType, String uniqueKeyPropertyName, boolean lazy, boolean unwrapProxy, boolean isEmbeddedInXML, String entityName, String propertyName)
           
 CollectionType orderedMap(String role, String propertyRef, boolean embedded)
           
 CollectionType orderedSet(String role, String propertyRef, boolean embedded)
           
 SessionFactoryImplementor resolveSessionFactory()
           
static
<T extends Serializable>
SerializableType<T>
serializable(Class<T> serializableClass)
          Build a SerializableType from the given Serializable class.
 CollectionType set(String role, String propertyRef, boolean embedded)
           
 CollectionType sortedMap(String role, String propertyRef, boolean embedded, Comparator comparator)
           
 CollectionType sortedSet(String role, String propertyRef, boolean embedded, Comparator comparator)
           
 EntityType specialOneToOne(String persistentClass, ForeignKeyDirection foreignKeyType, String uniqueKeyPropertyName, boolean lazy, boolean unwrapProxy, String entityName, String propertyName)
           
 Type type(Class<Type> typeClass, Properties parameters)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeFactory

public TypeFactory()
Method Detail

injectSessionFactory

public void injectSessionFactory(SessionFactoryImplementor factory)

resolveSessionFactory

public SessionFactoryImplementor resolveSessionFactory()

byClass

public Type byClass(Class clazz,
                    Properties parameters)

type

public Type type(Class<Type> typeClass,
                 Properties parameters)

injectParameters

public static void injectParameters(Object type,
                                    Properties parameters)

customComponent

public CompositeCustomType customComponent(Class<CompositeUserType> typeClass,
                                           Properties parameters)

customComponent

@Deprecated
public static CompositeCustomType customComponent(Class<CompositeUserType> typeClass,
                                                             Properties parameters,
                                                             TypeFactory.TypeScope scope)
Deprecated. Only for use temporary use by Hibernate


customCollection

public CollectionType customCollection(String typeName,
                                       Properties typeParameters,
                                       String role,
                                       String propertyRef,
                                       boolean embedded)

custom

public CustomType custom(Class<UserType> typeClass,
                         Properties parameters)

custom

@Deprecated
public static CustomType custom(Class<UserType> typeClass,
                                           Properties parameters,
                                           TypeFactory.TypeScope scope)
Deprecated. Only for use temporary use by Hibernate


serializable

public static <T extends Serializable> SerializableType<T> serializable(Class<T> serializableClass)
Build a SerializableType from the given Serializable class.

Type Parameters:
T - The actual class type (extends Serializable)
Parameters:
serializableClass - The Serializable class.
Returns:
The built SerializableType

oneToOne

public EntityType oneToOne(String persistentClass,
                           ForeignKeyDirection foreignKeyType,
                           String uniqueKeyPropertyName,
                           boolean lazy,
                           boolean unwrapProxy,
                           boolean isEmbeddedInXML,
                           String entityName,
                           String propertyName)

specialOneToOne

public EntityType specialOneToOne(String persistentClass,
                                  ForeignKeyDirection foreignKeyType,
                                  String uniqueKeyPropertyName,
                                  boolean lazy,
                                  boolean unwrapProxy,
                                  String entityName,
                                  String propertyName)

manyToOne

public EntityType manyToOne(String persistentClass)

manyToOne

public EntityType manyToOne(String persistentClass,
                            boolean lazy)

manyToOne

public EntityType manyToOne(String persistentClass,
                            String uniqueKeyPropertyName,
                            boolean lazy,
                            boolean unwrapProxy,
                            boolean isEmbeddedInXML,
                            boolean ignoreNotFound,
                            boolean isLogicalOneToOne)

array

public CollectionType array(String role,
                            String propertyRef,
                            boolean embedded,
                            Class elementClass)

list

public CollectionType list(String role,
                           String propertyRef,
                           boolean embedded)

bag

public CollectionType bag(String role,
                          String propertyRef,
                          boolean embedded)

idbag

public CollectionType idbag(String role,
                            String propertyRef,
                            boolean embedded)

map

public CollectionType map(String role,
                          String propertyRef,
                          boolean embedded)

orderedMap

public CollectionType orderedMap(String role,
                                 String propertyRef,
                                 boolean embedded)

sortedMap

public CollectionType sortedMap(String role,
                                String propertyRef,
                                boolean embedded,
                                Comparator comparator)

set

public CollectionType set(String role,
                          String propertyRef,
                          boolean embedded)

orderedSet

public CollectionType orderedSet(String role,
                                 String propertyRef,
                                 boolean embedded)

sortedSet

public CollectionType sortedSet(String role,
                                String propertyRef,
                                boolean embedded,
                                Comparator comparator)

component

public ComponentType component(ComponentMetamodel metamodel)

embeddedComponent

public EmbeddedComponentType embeddedComponent(ComponentMetamodel metamodel)

any

public Type any(Type metaType,
                Type identifierType)


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.