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.
uniqueKeyPropertyName
LEGACY_DEFAULT_SIZE, LEGACY_DICTATED_SIZE
Constructor and Description |
---|
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,
String uniqueKeyPropertyName,
boolean lazy,
boolean unwrapProxy,
String entityName,
String propertyName)
|
Modifier and Type | Method and Description |
---|---|
Object |
assemble(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 no
Type.dictatedSizes(org.hibernate.engine.spi.Mapping) were given). |
Size[] |
dictatedSizes(Mapping mapping)
Return the column sizes dictated by this type.
|
Serializable |
disassemble(Object value,
SharedSessionContractImplementor session,
Object owner)
Return a disassembled representation of the object.
|
int |
getColumnSpan(Mapping mapping)
How many columns are used to persist this type.
|
Object |
hydrate(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 (per
Types ) for the columns mapped by this type. |
boolean |
useLHSPrimaryKey()
Is the primary key of the owning entity table
to be used in the join?
|
getForeignKeyDirection, getPropertyName, isAlwaysDirtyChecked, isDirty, isDirty, isModified, isNull, isNullable, isOneToOne, nullSafeSet, toColumnNullness
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
beforeAssemble, getHashCode, isAnyType, isCollectionType, isComponentType, isEqual, replace, semiResolve
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
beforeAssemble, getHashCode, isAnyType, isCollectionType, isComponentType, isEqual, replace, semiResolve
@Deprecated public SpecialOneToOneType(TypeFactory.TypeScope scope, String referencedEntityName, ForeignKeyDirection foreignKeyType, String uniqueKeyPropertyName, boolean lazy, boolean unwrapProxy, String entityName, String propertyName)
public SpecialOneToOneType(TypeFactory.TypeScope scope, String referencedEntityName, ForeignKeyDirection foreignKeyType, boolean referenceToPrimaryKey, String uniqueKeyPropertyName, boolean lazy, boolean unwrapProxy, String entityName, String propertyName)
public SpecialOneToOneType(SpecialOneToOneType original, String superTypeEntityName)
public int getColumnSpan(Mapping mapping) throws MappingException
Type
How many columns are used to persist this type. Always the same as sqlTypes(mapping).length
getColumnSpan
in interface Type
getColumnSpan
in class OneToOneType
mapping
- The mapping object :/MappingException
- Generally indicates an issue accessing the passed mapping object.public int[] sqlTypes(Mapping mapping) throws MappingException
Type
Return the JDBC types codes (per Types
) for the columns mapped by this type.
<p/>
NOTE: The number of elements in this array matches the return from Type.getColumnSpan(org.hibernate.engine.spi.Mapping)
.
sqlTypes
in interface Type
sqlTypes
in class OneToOneType
mapping
- The mapping object :/MappingException
- Generally indicates an issue accessing the passed mapping object.public Size[] dictatedSizes(Mapping mapping) throws MappingException
Type
Return the column sizes dictated by this type. For example, the mapping for a char
/Character
would
have a dictated length limit of 1; for a string-based UUID
would have a size limit of 36; etc.
<p/>
NOTE: The number of elements in this array matches the return from Type.getColumnSpan(org.hibernate.engine.spi.Mapping)
.
dictatedSizes
in interface Type
dictatedSizes
in class OneToOneType
mapping
- The mapping object :/MappingException
- Generally indicates an issue accessing the passed mapping object.public Size[] defaultSizes(Mapping mapping) throws MappingException
Type
Defines the column sizes to use according to this type if the user did not explicitly say (and if no
Type.dictatedSizes(org.hibernate.engine.spi.Mapping)
were given).
<p/>
NOTE: The number of elements in this array matches the return from Type.getColumnSpan(org.hibernate.engine.spi.Mapping)
.
defaultSizes
in interface Type
defaultSizes
in class OneToOneType
mapping
- The mapping object :/MappingException
- Generally indicates an issue accessing the passed mapping object.public boolean useLHSPrimaryKey()
AssociationType
Is the primary key of the owning entity table to be used in the join?
useLHSPrimaryKey
in interface AssociationType
useLHSPrimaryKey
in class OneToOneType
public Object hydrate(ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner) throws HibernateException, SQLException
Type
Extract a value from the JDBC result set. This is useful for 2-phase property initialization - the second
phase is a call to Type.resolve(java.lang.Object, org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object)
This hydrated value will be either:<ul>
<li>in the case of an entity or collection type, the key</li>
<li>otherwise, the value itself</li>
</ul>
hydrate
in interface Type
hydrate
in class 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 entityHibernateException
- An error from HibernateSQLException
- An error from the JDBC driverType.resolve(java.lang.Object, org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object)
public Serializable disassemble(Object value, SharedSessionContractImplementor session, Object owner) throws HibernateException
Type
Return 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
in interface Type
disassemble
in class OneToOneType
value
- the value to cachesession
- the originating sessionowner
- optional parent entity object (needed for collections)HibernateException
- An error from Hibernatepublic Object assemble(Serializable oid, SharedSessionContractImplementor session, Object owner) throws HibernateException
Type
Reconstruct the object from its disassembled state. This method is the reciprocal of Type.disassemble(java.lang.Object, org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object)
assemble
in interface Type
assemble
in class OneToOneType
oid
- the disassembled state from the cachesession
- the originating sessionowner
- the parent entity objectHibernateException
- An error from HibernateCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.