public class OneToOneType extends EntityType
isEmbeddedInXML, uniqueKeyPropertyName
Constructor and Description |
---|
OneToOneType(TypeFactory.TypeScope scope,
String referencedEntityName,
ForeignKeyDirection foreignKeyType,
String uniqueKeyPropertyName,
boolean lazy,
boolean unwrapProxy,
boolean isEmbeddedInXML,
String entityName,
String propertyName) |
Modifier and Type | Method and Description |
---|---|
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 session)
How many columns are used to persist this type.
|
ForeignKeyDirection |
getForeignKeyDirection()
Get the foreign key directionality of this association
|
String |
getPropertyName() |
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.
|
boolean |
isAlwaysDirtyChecked()
We don't need to dirty check one-to-one because of how
assemble/disassemble is implemented and because a one-to-one
association is never dirty
|
boolean |
isDirty(Object old,
Object current,
boolean[] checkable,
SessionImplementor session)
Should the parent be considered dirty, given both the old and current value?
|
boolean |
isDirty(Object old,
Object current,
SessionImplementor session)
Should the parent be considered dirty, given both the old and current value?
|
boolean |
isModified(Object old,
Object current,
boolean[] checkable,
SessionImplementor session)
Has the value been modified compared to the current database state? The difference between this
and the
Type.isDirty(java.lang.Object, java.lang.Object, org.hibernate.engine.SessionImplementor) methods is that here we need to account for "partially" built values. |
boolean |
isNull(Object owner,
SessionImplementor session) |
protected boolean |
isNullable() |
boolean |
isOneToOne()
Is the association modeled here defined as a 1-1 in the database (physical model)?
|
void |
nullSafeSet(PreparedStatement st,
Object value,
int index,
boolean[] settable,
SessionImplementor session)
Write an instance of the mapped class to a prepared statement, ignoring some columns.
|
void |
nullSafeSet(PreparedStatement st,
Object value,
int index,
SessionImplementor session)
Write an instance of the mapped class to a prepared statement.
|
int[] |
sqlTypes(Mapping session)
Return the JDBC types codes (per
Types ) for the columns mapped by this type. |
boolean[] |
toColumnNullness(Object value,
Mapping mapping)
Given an instance of the type, return an array of boolean, indicating
which mapped columns would be null.
|
boolean |
useLHSPrimaryKey()
Is the primary key of the owning entity table
to be used in the join?
|
compare, deepCopy, fromXMLNode, getAssociatedEntityName, getAssociatedEntityName, getAssociatedJoinable, getHashCode, getIdentifier, getIdentifierOrUniqueKeyPropertyName, getIdentifierOrUniqueKeyType, getLHSPropertyName, getName, getOnCondition, getReturnedClass, getRHSUniqueKeyPropertyName, getSemiResolvedType, isAssociationType, isEmbeddedInXML, isEntityType, isEqual, isLogicalOneToOne, isMutable, isNotEmbedded, isReferenceToPrimaryKey, isSame, isXMLElement, loadByUniqueKey, nullSafeGet, nullSafeGet, replace, resolve, resolveIdentifier, scope, setToXMLNode, toLoggableString, toString
beforeAssemble, getHashCode, isAnyType, isCollectionType, isComponentType, isEqual, replace, replaceNode, semiResolve
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
beforeAssemble, getHashCode, isAnyType, isCollectionType, isComponentType, isEqual, replace, semiResolve
public OneToOneType(TypeFactory.TypeScope scope, String referencedEntityName, ForeignKeyDirection foreignKeyType, String uniqueKeyPropertyName, boolean lazy, boolean unwrapProxy, boolean isEmbeddedInXML, String entityName, String propertyName)
public String getPropertyName()
getPropertyName
in class EntityType
public boolean isNull(Object owner, SessionImplementor session)
isNull
in class EntityType
public int getColumnSpan(Mapping session) throws MappingException
Type
sqlTypes(mapping).length
session
- The mapping object :/MappingException
- Generally indicates an issue accessing the passed mapping object.public int[] sqlTypes(Mapping session) throws MappingException
Type
Types
) for the columns mapped by this type.session
- The mapping object :/MappingException
- Generally indicates an issue accessing the passed mapping object.public boolean[] toColumnNullness(Object value, Mapping mapping)
Type
value
- an instance of the typepublic void nullSafeSet(PreparedStatement st, Object value, int index, boolean[] settable, SessionImplementor session)
Type
value
- the object to writeindex
- statement parameter indexsettable
- an array indicating which columns to ignorepublic void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session)
Type
value
- the object to writeindex
- statement parameter indexpublic boolean isOneToOne()
EntityType
isOneToOne
in class EntityType
public boolean isDirty(Object old, Object current, SessionImplementor session)
Type
isDirty
in interface Type
isDirty
in class AbstractType
old
- the old valuecurrent
- the current valuesession
- The session from which the request originated.public boolean isDirty(Object old, Object current, boolean[] checkable, SessionImplementor session)
Type
old
- the old valuecurrent
- the current valuecheckable
- An array of booleans indicating which columns making up the value are actually checkablesession
- The session from which the request originated.public boolean isModified(Object old, Object current, boolean[] checkable, SessionImplementor session)
Type
Type.isDirty(java.lang.Object, java.lang.Object, org.hibernate.engine.SessionImplementor)
methods is that here we need to account for "partially" built values. This is really
only an issue with association types. For most type implementations it is enough to simply delegate to
Type.isDirty(java.lang.Object, java.lang.Object, org.hibernate.engine.SessionImplementor)
here/isModified
in interface Type
isModified
in class AbstractType
old
- the database state, in a "hydrated" form, with identifiers unresolvedcurrent
- the current state of the objectcheckable
- which columns are actually updatablesession
- The session from which the request originated.public ForeignKeyDirection getForeignKeyDirection()
AssociationType
public Object hydrate(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException
Type
hydrate
in interface Type
hydrate
in class AbstractType
names
- the column namessession
- the sessionowner
- the parent entityHibernateException
SQLException
Type.resolve(Object, SessionImplementor, Object)
protected boolean isNullable()
isNullable
in class EntityType
public boolean useLHSPrimaryKey()
AssociationType
public Serializable disassemble(Object value, SessionImplementor session, Object owner) throws HibernateException
Type
disassemble
in interface Type
disassemble
in class AbstractType
value
- the value to cachesession
- the sessionowner
- optional parent entity object (needed for collections)HibernateException
public Object assemble(Serializable oid, SessionImplementor session, Object owner) throws HibernateException
Type
assemble
in interface Type
assemble
in class AbstractType
oid
- the disassembled state from the cachesession
- the sessionowner
- the parent entity objectHibernateException
public boolean isAlwaysDirtyChecked()
Copyright © 2002-2017 Red Hat Middleware, LLC. All Rights Reserved