public class ManyToOneType extends EntityType
isEmbeddedInXML, uniqueKeyPropertyName| Constructor and Description |
|---|
ManyToOneType(TypeFactory.TypeScope scope,
String referencedEntityName)
Creates a many-to-one association type with the given referenced entity.
|
ManyToOneType(TypeFactory.TypeScope scope,
String referencedEntityName,
boolean lazy)
Creates a many-to-one association type with the given referenced entity and the
given laziness characteristic
|
ManyToOneType(TypeFactory.TypeScope scope,
String referencedEntityName,
String uniqueKeyPropertyName,
boolean lazy,
boolean unwrapProxy,
boolean isEmbeddedInXML,
boolean ignoreNotFound,
boolean isLogicalOneToOne) |
| Modifier and Type | Method and Description |
|---|---|
Object |
assemble(Serializable oid,
SessionImplementor session,
Object owner)
Reconstruct the object from its cached "disassembled" state.
|
void |
beforeAssemble(Serializable oid,
SessionImplementor session)
Called before assembling a query result set from the query cache, to allow batch fetching
of entities missing from the second-level cache.
|
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.
|
ForeignKeyDirection |
getForeignKeyDirection()
Get the foreign key directionality of this association
|
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()
Do we dirty check this association, even when there are
no columns to be updated?
|
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 |
isLogicalOneToOne()
Is the association modeled here a 1-1 according to the logical moidel?
|
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. |
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 mapping)
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, getPropertyName, getReturnedClass, getRHSUniqueKeyPropertyName, getSemiResolvedType, isAssociationType, isEmbeddedInXML, isEntityType, isEqual, isMutable, isNotEmbedded, isNull, isReferenceToPrimaryKey, isSame, isXMLElement, loadByUniqueKey, nullSafeGet, nullSafeGet, replace, resolve, resolveIdentifier, scope, setToXMLNode, toLoggableString, toStringgetHashCode, isAnyType, isCollectionType, isComponentType, isEqual, replace, replaceNode, semiResolveclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetHashCode, isAnyType, isCollectionType, isComponentType, isEqual, replace, semiResolvepublic ManyToOneType(TypeFactory.TypeScope scope, String referencedEntityName)
scope - The scope for this instance.referencedEntityName - The name iof the referenced entitypublic ManyToOneType(TypeFactory.TypeScope scope, String referencedEntityName, boolean lazy)
scope - The scope for this instance.referencedEntityName - The name iof the referenced entitylazy - Should the association be handled lazilypublic ManyToOneType(TypeFactory.TypeScope scope, String referencedEntityName, String uniqueKeyPropertyName, boolean lazy, boolean unwrapProxy, boolean isEmbeddedInXML, boolean ignoreNotFound, boolean isLogicalOneToOne)
protected boolean isNullable()
isNullable in class EntityTypepublic boolean isAlwaysDirtyChecked()
AssociationTypepublic boolean isOneToOne()
EntityTypeisOneToOne in class EntityTypepublic boolean isLogicalOneToOne()
EntityTypeisLogicalOneToOne in class EntityTypepublic int getColumnSpan(Mapping mapping) throws MappingException
TypesqlTypes(mapping).lengthmapping - The mapping object :/MappingException - Generally indicates an issue accessing the passed mapping object.public int[] sqlTypes(Mapping mapping) throws MappingException
TypeTypes) for the columns mapped by this type.mapping - The mapping object :/MappingException - Generally indicates an issue accessing the passed mapping object.public void nullSafeSet(PreparedStatement st, Object value, int index, boolean[] settable, SessionImplementor session) throws HibernateException, SQLException
Typevalue - the object to writeindex - statement parameter indexsettable - an array indicating which columns to ignoreHibernateExceptionSQLExceptionpublic void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) throws HibernateException, SQLException
Typevalue - the object to writeindex - statement parameter indexHibernateExceptionSQLExceptionpublic ForeignKeyDirection getForeignKeyDirection()
AssociationTypepublic Object hydrate(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException
Typehydrate in interface Typehydrate in class AbstractTypenames - the column namessession - the sessionowner - the parent entityHibernateExceptionSQLExceptionType.resolve(Object, SessionImplementor, Object)public boolean useLHSPrimaryKey()
AssociationTypepublic boolean isModified(Object old, Object current, boolean[] checkable, SessionImplementor session) throws HibernateException
TypeType.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 TypeisModified in class AbstractTypeold - 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.HibernateException - A problem occurred performing the checkingpublic Serializable disassemble(Object value, SessionImplementor session, Object owner) throws HibernateException
Typedisassemble in interface Typedisassemble in class AbstractTypevalue - the value to cachesession - the sessionowner - optional parent entity object (needed for collections)HibernateExceptionpublic Object assemble(Serializable oid, SessionImplementor session, Object owner) throws HibernateException
Typeassemble in interface Typeassemble in class AbstractTypeoid - the disassembled state from the cachesession - the sessionowner - the parent entity objectHibernateExceptionpublic void beforeAssemble(Serializable oid, SessionImplementor session)
TypebeforeAssemble in interface TypebeforeAssemble in class AbstractTypepublic boolean[] toColumnNullness(Object value, Mapping mapping)
Typevalue - an instance of the typepublic boolean isDirty(Object old, Object current, SessionImplementor session) throws HibernateException
TypeisDirty in interface TypeisDirty in class AbstractTypeold - the old valuecurrent - the current valuesession - The session from which the request originated.HibernateException - A problem occurred performing the checkingpublic boolean isDirty(Object old, Object current, boolean[] checkable, SessionImplementor session) throws HibernateException
Typeold - 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.HibernateException - A problem occurred performing the checkingCopyright © 2002-2017 Red Hat Middleware, LLC. All Rights Reserved