类 SpecialOneToOneType
- java.lang.Object
-
- org.hibernate.type.AbstractType
-
- org.hibernate.type.EntityType
-
- org.hibernate.type.OneToOneType
-
- org.hibernate.type.SpecialOneToOneType
-
- 所有已实现的接口:
Serializable,AssociationType,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.- 作者:
- Gavin King
- 另请参阅:
- 序列化表格
-
-
字段概要
-
从类继承的字段 org.hibernate.type.EntityType
uniqueKeyPropertyName
-
从类继承的字段 org.hibernate.type.AbstractType
LEGACY_DEFAULT_SIZE, LEGACY_DICTATED_SIZE
-
-
构造器概要
构造器 构造器 说明 SpecialOneToOneType(SpecialOneToOneType original, String superTypeEntityName)SpecialOneToOneType(TypeFactory.TypeScope scope, String referencedEntityName, ForeignKeyDirection foreignKeyType, boolean referenceToPrimaryKey, String uniqueKeyPropertyName, boolean lazy, boolean unwrapProxy, String entityName, String propertyName)SpecialOneToOneType(TypeFactory.TypeScope scope, String referencedEntityName, ForeignKeyDirection foreignKeyType, boolean referenceToPrimaryKey, String uniqueKeyPropertyName, boolean lazy, boolean unwrapProxy, String entityName, String propertyName, boolean constrained)SpecialOneToOneType(TypeFactory.TypeScope scope, String referencedEntityName, ForeignKeyDirection foreignKeyType, String uniqueKeyPropertyName, boolean lazy, boolean unwrapProxy, String entityName, String propertyName)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Objectassemble(Serializable oid, SharedSessionContractImplementor session, Object owner)Reconstruct the object from its disassembled state.Size[]defaultSizes(Mapping mapping)Defines the column sizes to use according to this type if the user did not explicitly say (and if noType.dictatedSizes(org.hibernate.engine.spi.Mapping)were given).Size[]dictatedSizes(Mapping mapping)Return the column sizes dictated by this type.Serializabledisassemble(Object value, SharedSessionContractImplementor session, Object owner)Return a disassembled representation of the object.intgetColumnSpan(Mapping mapping)How many columns are used to persist this type.Objecthydrate(ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner)Extract a value from the JDBC result set.int[]sqlTypes(Mapping mapping)Return the JDBC types codes (perTypes) for the columns mapped by this type.booleanuseLHSPrimaryKey()Is the primary key of the owning entity table to be used in the join?-
从类继承的方法 org.hibernate.type.OneToOneType
getForeignKeyDirection, getPropertyName, isAlwaysDirtyChecked, isDirty, isDirty, isModified, isNull, isNullable, isOneToOne, nullSafeSet, toColumnNullness
-
从类继承的方法 org.hibernate.type.EntityType
compare, deepCopy, getAssociatedEntityName, getAssociatedEntityName, getAssociatedEntityPersister, getAssociatedJoinable, getHashCode, getIdentifier, getIdentifierOrUniqueKeyPropertyName, getIdentifierOrUniqueKeyType, getLHSPropertyName, getName, getOnCondition, getOnCondition, getReturnedClass, getRHSUniqueKeyPropertyName, getSemiResolvedType, isAssociationType, isEntityType, isEqual, isLogicalOneToOne, isMutable, isReferenceToPrimaryKey, isSame, loadByUniqueKey, nullSafeGet, nullSafeGet, nullSafeSet, replace, requireIdentifierOrUniqueKeyType, resolve, resolve, resolveIdentifier, resolveIdentifier, scope, toLoggableString, toString
-
从类继承的方法 org.hibernate.type.AbstractType
beforeAssemble, getHashCode, isAnyType, isCollectionType, isComponentType, isEqual, replace, semiResolve
-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
从接口继承的方法 org.hibernate.type.Type
beforeAssemble, getHashCode, isAnyType, isCollectionType, isComponentType, isEqual, replace, semiResolve
-
-
-
-
构造器详细资料
-
SpecialOneToOneType
@Deprecated public SpecialOneToOneType(TypeFactory.TypeScope scope, String referencedEntityName, ForeignKeyDirection foreignKeyType, String uniqueKeyPropertyName, boolean lazy, boolean unwrapProxy, String entityName, String propertyName)
-
SpecialOneToOneType
@Deprecated public SpecialOneToOneType(TypeFactory.TypeScope scope, String referencedEntityName, ForeignKeyDirection foreignKeyType, boolean referenceToPrimaryKey, String uniqueKeyPropertyName, boolean lazy, boolean unwrapProxy, String entityName, String propertyName)
-
SpecialOneToOneType
public SpecialOneToOneType(TypeFactory.TypeScope scope, String referencedEntityName, ForeignKeyDirection foreignKeyType, boolean referenceToPrimaryKey, String uniqueKeyPropertyName, boolean lazy, boolean unwrapProxy, String entityName, String propertyName, boolean constrained)
-
SpecialOneToOneType
public SpecialOneToOneType(SpecialOneToOneType original, String superTypeEntityName)
-
-
方法详细资料
-
getColumnSpan
public int getColumnSpan(Mapping mapping) throws MappingException
从接口复制的说明:TypeHow many columns are used to persist this type. Always the same assqlTypes(mapping).length- 指定者:
getColumnSpan在接口中Type- 覆盖:
getColumnSpan在类中OneToOneType- 参数:
mapping- The mapping object :/- 返回:
- The number of columns
- 抛出:
MappingException- Generally indicates an issue accessing the passed mapping object.
-
sqlTypes
public int[] sqlTypes(Mapping mapping) throws MappingException
从接口复制的说明:TypeReturn the JDBC types codes (perTypes) for the columns mapped by this type. NOTE: The number of elements in this array matches the return fromType.getColumnSpan(org.hibernate.engine.spi.Mapping).- 指定者:
sqlTypes在接口中Type- 覆盖:
sqlTypes在类中OneToOneType- 参数:
mapping- The mapping object :/- 返回:
- The JDBC type codes.
- 抛出:
MappingException- Generally indicates an issue accessing the passed mapping object.
-
dictatedSizes
public Size[] dictatedSizes(Mapping mapping) throws MappingException
从接口复制的说明:TypeReturn the column sizes dictated by this type. For example, the mapping for achar/Characterwould have a dictated length limit of 1; for a string-basedUUIDwould have a size limit of 36; etc. NOTE: The number of elements in this array matches the return fromType.getColumnSpan(org.hibernate.engine.spi.Mapping).- 指定者:
dictatedSizes在接口中Type- 覆盖:
dictatedSizes在类中OneToOneType- 参数:
mapping- The mapping object :/- 返回:
- The dictated sizes.
- 抛出:
MappingException- Generally indicates an issue accessing the passed mapping object.
-
defaultSizes
public Size[] defaultSizes(Mapping mapping) throws MappingException
从接口复制的说明:TypeDefines the column sizes to use according to this type if the user did not explicitly say (and if noType.dictatedSizes(org.hibernate.engine.spi.Mapping)were given). NOTE: The number of elements in this array matches the return fromType.getColumnSpan(org.hibernate.engine.spi.Mapping).- 指定者:
defaultSizes在接口中Type- 覆盖:
defaultSizes在类中OneToOneType- 参数:
mapping- The mapping object :/- 返回:
- The default sizes.
- 抛出:
MappingException- Generally indicates an issue accessing the passed mapping object.
-
useLHSPrimaryKey
public boolean useLHSPrimaryKey()
从接口复制的说明:AssociationTypeIs the primary key of the owning entity table to be used in the join?- 指定者:
useLHSPrimaryKey在接口中AssociationType- 覆盖:
useLHSPrimaryKey在类中OneToOneType
-
hydrate
public Object hydrate(ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner) throws HibernateException, SQLException
从接口复制的说明:TypeExtract a value from the JDBC result set. This is useful for 2-phase property initialization - the second phase is a call toType.resolve(java.lang.Object, org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object)This hydrated value will be either:- in the case of an entity or collection type, the key
- otherwise, the value itself
- 指定者:
hydrate在接口中Type- 覆盖:
hydrate在类中OneToOneType- 参数:
rs- The JDBC result setnames- the column names making up this type value (use to read from result set)session- The originating sessionowner- the parent entity- 返回:
- An entity or collection key, or an actual value.
- 抛出:
HibernateException- An error from HibernateSQLException- An error from the JDBC driver- 另请参阅:
Type.resolve(java.lang.Object, org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object)
-
disassemble
public Serializable disassemble(Object value, SharedSessionContractImplementor session, Object owner) throws HibernateException
从接口复制的说明:TypeReturn a disassembled representation of the object. This is the value Hibernate will use in second level caching, so care should be taken to break values down to their simplest forms; for entities especially, this means breaking them down into their constituent parts.- 指定者:
disassemble在接口中Type- 覆盖:
disassemble在类中OneToOneType- 参数:
value- the value to cachesession- the originating sessionowner- optional parent entity object (needed for collections)- 返回:
- the disassembled, deep cloned state
- 抛出:
HibernateException- An error from Hibernate
-
assemble
public Object assemble(Serializable oid, SharedSessionContractImplementor session, Object owner) throws HibernateException
从接口复制的说明:TypeReconstruct the object from its disassembled state. This method is the reciprocal ofType.disassemble(java.lang.Object, org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object)- 指定者:
assemble在接口中Type- 覆盖:
assemble在类中OneToOneType- 参数:
oid- the disassembled state from the cachesession- the originating sessionowner- the parent entity object- 返回:
- the (re)assembled object
- 抛出:
HibernateException- An error from Hibernate
-
-