站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Hibernate 2.1.8 正式版 API 英文文档

TypeFactory (Hibernate API Documentation) - Hibernate 2.1.8 正式版 API 英文文档


net.sf.hibernate.type
Class TypeFactory

java.lang.Object
  extended bynet.sf.hibernate.type.TypeFactory

public final class TypeFactory
extends Object

Used internally to obtain instances of Type. Applications should use static methods and constants on net.sf.hibernate.Hibernate.

Author:
Gavin King
See Also:
Hibernate

Method Summary
static PersistentCollectionType array(String role, Class elementClass)
           
static Object[] assemble(Serializable[] row, Type[] types, SessionImplementor session, Object owner)
           
static PersistentCollectionType bag(String role)
           
static Type basic(String name)
          Given the name of a Hibernate basic type, return an instance of net.sf.hibernate.type.Type.
static Object[] copy(Object[] original, Object[] target, Type[] types, SessionImplementor session, Object owner, Map copiedAlready)
           
static void deepCopy(Object[] values, Type[] types, boolean[] copy, Object[] target)
          Deep copy values in the first array into the second
static Serializable[] disassemble(Object[] row, Type[] types, SessionImplementor session)
           
static int[] findDirty(Type[] types, Object[] x, Object[] y, boolean[] check, SessionImplementor session)
          Determine if any of the given field values are dirty, returning an array containing indexes of the dirty fields or null if no fields are dirty.
static int[] findModified(Type[] types, Object[] old, Object[] current, boolean[] check, SessionImplementor session)
          Determine if any of the given field values are modified, returning an array containing indexes of the dirty fields or null if no fields are dirty.
static Type heuristicType(String typeName)
          Uses heuristics to deduce a Hibernate type given a string naming the type or Java class.
static PersistentCollectionType idbag(String role)
           
static PersistentCollectionType list(String role)
           
static Type manyToOne(Class persistentClass)
          A many-to-one association type for the given class
static Type manyToOne(Class persistentClass, String uniqueKeyPropertyName)
          A many-to-one association type for the given class
static PersistentCollectionType map(String role)
           
static Type oneToOne(Class persistentClass, ForeignKeyDirection foreignKeyType)
          A one-to-one association type for the given class
static Type oneToOne(Class persistentClass, ForeignKeyDirection foreignKeyType, String uniqueKeyPropertyName)
          A one-to-one association type for the given class
static PersistentCollectionType set(String role)
           
static PersistentCollectionType sortedMap(String role, Comparator comparator)
           
static PersistentCollectionType sortedSet(String role, Comparator comparator)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

oneToOne

public static Type oneToOne(Class persistentClass,
                            ForeignKeyDirection foreignKeyType)
A one-to-one association type for the given class


oneToOne

public static Type oneToOne(Class persistentClass,
                            ForeignKeyDirection foreignKeyType,
                            String uniqueKeyPropertyName)
A one-to-one association type for the given class


manyToOne

public static Type manyToOne(Class persistentClass)
A many-to-one association type for the given class


manyToOne

public static Type manyToOne(Class persistentClass,
                             String uniqueKeyPropertyName)
A many-to-one association type for the given class


basic

public static Type basic(String name)
Given the name of a Hibernate basic type, return an instance of net.sf.hibernate.type.Type.


heuristicType

public static Type heuristicType(String typeName)
                          throws MappingException
Uses heuristics to deduce a Hibernate type given a string naming the type or Java class. Return an instance of net.sf.hibernate.type.Type.

Throws:
MappingException

array

public static PersistentCollectionType array(String role,
                                             Class elementClass)

list

public static PersistentCollectionType list(String role)

bag

public static PersistentCollectionType bag(String role)

idbag

public static PersistentCollectionType idbag(String role)

map

public static PersistentCollectionType map(String role)

set

public static PersistentCollectionType set(String role)

sortedMap

public static PersistentCollectionType sortedMap(String role,
                                                 Comparator comparator)

sortedSet

public static PersistentCollectionType sortedSet(String role,
                                                 Comparator comparator)

deepCopy

public static void deepCopy(Object[] values,
                            Type[] types,
                            boolean[] copy,
                            Object[] target)
                     throws HibernateException
Deep copy values in the first array into the second

Throws:
HibernateException

findDirty

public static int[] findDirty(Type[] types,
                              Object[] x,
                              Object[] y,
                              boolean[] check,
                              SessionImplementor session)
                       throws HibernateException
Determine if any of the given field values are dirty, returning an array containing indexes of the dirty fields or null if no fields are dirty.

Throws:
HibernateException

findModified

public static int[] findModified(Type[] types,
                                 Object[] old,
                                 Object[] current,
                                 boolean[] check,
                                 SessionImplementor session)
                          throws HibernateException
Determine if any of the given field values are modified, returning an array containing indexes of the dirty fields or null if no fields are dirty.

Throws:
HibernateException

assemble

public static Object[] assemble(Serializable[] row,
                                Type[] types,
                                SessionImplementor session,
                                Object owner)
                         throws HibernateException
Throws:
HibernateException

disassemble

public static Serializable[] disassemble(Object[] row,
                                         Type[] types,
                                         SessionImplementor session)
                                  throws HibernateException
Throws:
HibernateException

copy

public static Object[] copy(Object[] original,
                            Object[] target,
                            Type[] types,
                            SessionImplementor session,
                            Object owner,
                            Map copiedAlready)
                     throws HibernateException
Throws:
HibernateException