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

SpecialOneToOneType (Hibernate API Documentation) - Hibernate 3.2.4 正式版 API 英文文档


org.hibernate.type
Class SpecialOneToOneType

java.lang.Object
  extended byorg.hibernate.type.AbstractType
      extended byorg.hibernate.type.EntityType
          extended byorg.hibernate.type.OneToOneType
              extended byorg.hibernate.type.SpecialOneToOneType
All Implemented Interfaces:
AssociationType, Serializable, Type

public class SpecialOneToOneType
extends OneToOneType

A one-to-one association that maps to specific formula(s) instead of the primary key column of the owning entity.

Author:
Gavin King
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.hibernate.type.EntityType
isEmbeddedInXML, uniqueKeyPropertyName
 
Constructor Summary
SpecialOneToOneType(String referencedEntityName, ForeignKeyDirection foreignKeyType, String uniqueKeyPropertyName, boolean lazy, boolean unwrapProxy, String entityName, String propertyName)
           
 
Method Summary
 Object assemble(Serializable oid, SessionImplementor session, Object owner)
          Reconstruct the object from its cached "disassembled" state.
 Serializable disassemble(Object value, SessionImplementor session, Object owner)
          Return a cacheable "disassembled" representation of the object.
 int getColumnSpan(Mapping mapping)
          How many columns are used to persist this type.
 Object hydrate(ResultSet rs, String[] names, SessionImplementor session, Object owner)
          Retrieve an instance of the mapped class, or the identifier of an entity or collection, from a JDBC resultset.
 int[] sqlTypes(Mapping mapping)
          Return the SQL type codes for the columns mapped by this type.
 boolean useLHSPrimaryKey()
          Is the primary key of the owning entity table to be used in the join?
 
Methods inherited from class org.hibernate.type.OneToOneType
getForeignKeyDirection, getPropertyName, isAlwaysDirtyChecked, isDirty, isDirty, isModified, isNull, isNullable, isOneToOne, nullSafeSet, nullSafeSet, toColumnNullness
 
Methods inherited from class org.hibernate.type.EntityType
compare, deepCopy, fromXMLNode, getAssociatedEntityName, getAssociatedEntityName, getAssociatedJoinable, getHashCode, getIdentifier, getIdentifierOrUniqueKeyPropertyName, getIdentifierOrUniqueKeyType, getLHSPropertyName, getName, getOnCondition, getReturnedClass, getRHSUniqueKeyPropertyName, getSemiResolvedType, isAssociationType, isEmbeddedInXML, isEntityType, isEqual, isMutable, isNotEmbedded, isReferenceToPrimaryKey, isSame, isXMLElement, loadByUniqueKey, nullSafeGet, nullSafeGet, replace, resolve, resolveIdentifier, setToXMLNode, toLoggableString, toString
 
Methods inherited from class org.hibernate.type.AbstractType
beforeAssemble, getHashCode, isAnyType, isCollectionType, isComponentType, isEqual, replace, replaceNode, semiResolve
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.hibernate.type.Type
beforeAssemble, getHashCode, isAnyType, isCollectionType, isComponentType, isEqual, replace, semiResolve
 

Constructor Detail

SpecialOneToOneType

public SpecialOneToOneType(String referencedEntityName,
                           ForeignKeyDirection foreignKeyType,
                           String uniqueKeyPropertyName,
                           boolean lazy,
                           boolean unwrapProxy,
                           String entityName,
                           String propertyName)
Method Detail

getColumnSpan

public int getColumnSpan(Mapping mapping)
                  throws MappingException
Description copied from interface: Type
How many columns are used to persist this type.

Specified by:
getColumnSpan in interface Type
Overrides:
getColumnSpan in class OneToOneType
Throws:
MappingException

sqlTypes

public int[] sqlTypes(Mapping mapping)
               throws MappingException
Description copied from interface: Type
Return the SQL type codes for the columns mapped by this type. The codes are defined on java.sql.Types.

Specified by:
sqlTypes in interface Type
Overrides:
sqlTypes in class OneToOneType
Throws:
MappingException

useLHSPrimaryKey

public boolean useLHSPrimaryKey()
Description copied from interface: AssociationType
Is the primary key of the owning entity table to be used in the join?

Specified by:
useLHSPrimaryKey in interface AssociationType
Overrides:
useLHSPrimaryKey in class OneToOneType

hydrate

public Object hydrate(ResultSet rs,
                      String[] names,
                      SessionImplementor session,
                      Object owner)
               throws HibernateException,
                      SQLException
Description copied from interface: Type
Retrieve an instance of the mapped class, or the identifier of an entity or collection, from a JDBC resultset. This is useful for 2-phase property initialization - the second phase is a call to resolveIdentifier().

Specified by:
hydrate in interface Type
Overrides:
hydrate in class OneToOneType
Throws:
HibernateException
SQLException

disassemble

public Serializable disassemble(Object value,
                                SessionImplementor session,
                                Object owner)
                         throws HibernateException
Description copied from interface: Type
Return a cacheable "disassembled" representation of the object.

Specified by:
disassemble in interface Type
Overrides:
disassemble in class OneToOneType
Throws:
HibernateException

assemble

public Object assemble(Serializable oid,
                       SessionImplementor session,
                       Object owner)
                throws HibernateException
Description copied from interface: Type
Reconstruct the object from its cached "disassembled" state.

Specified by:
assemble in interface Type
Overrides:
assemble in class OneToOneType
Throws:
HibernateException