|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hibernate.type.AbstractType
org.hibernate.type.EntityType
org.hibernate.type.ManyToOneType
public class ManyToOneType
A many-to-one association to an entity.
Field Summary |
---|
Fields inherited from class org.hibernate.type.EntityType |
---|
isEmbeddedInXML, uniqueKeyPropertyName |
Constructor Summary | |
---|---|
ManyToOneType(java.lang.String className)
|
|
ManyToOneType(java.lang.String className,
boolean lazy)
|
|
ManyToOneType(java.lang.String entityName,
java.lang.String uniqueKeyPropertyName,
boolean lazy,
boolean unwrapProxy,
boolean isEmbeddedInXML,
boolean ignoreNotFound)
|
Method Summary | |
---|---|
java.lang.Object |
assemble(java.io.Serializable oid,
SessionImplementor session,
java.lang.Object owner)
Reconstruct the object from its cached "disassembled" state. |
void |
beforeAssemble(java.io.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. |
java.io.Serializable |
disassemble(java.lang.Object value,
SessionImplementor session,
java.lang.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 |
java.lang.Object |
hydrate(java.sql.ResultSet rs,
java.lang.String[] names,
SessionImplementor session,
java.lang.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(java.lang.Object old,
java.lang.Object current,
boolean[] checkable,
SessionImplementor session)
Should the parent be considered dirty, given both the old and current field or element value? |
boolean |
isDirty(java.lang.Object old,
java.lang.Object current,
SessionImplementor session)
Should the parent be considered dirty, given both the old and current field or element value? |
boolean |
isModified(java.lang.Object old,
java.lang.Object current,
boolean[] checkable,
SessionImplementor session)
Has the parent object been modified, compared to the current database state? |
protected boolean |
isNullable()
|
boolean |
isOneToOne()
|
void |
nullSafeSet(java.sql.PreparedStatement st,
java.lang.Object value,
int index,
boolean[] settable,
SessionImplementor session)
Write an instance of the mapped class to a prepared statement, ignoring some columns. |
void |
nullSafeSet(java.sql.PreparedStatement st,
java.lang.Object value,
int index,
SessionImplementor session)
Write an instance of the mapped class to a prepared statement. |
int[] |
sqlTypes(Mapping mapping)
Return the SQL type codes for the columns mapped by this type. |
boolean[] |
toColumnNullness(java.lang.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? |
Methods inherited from class org.hibernate.type.AbstractType |
---|
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 |
---|
getHashCode, isAnyType, isCollectionType, isComponentType, isEqual, replace, semiResolve |
Constructor Detail |
---|
public ManyToOneType(java.lang.String className)
public ManyToOneType(java.lang.String className, boolean lazy)
public ManyToOneType(java.lang.String entityName, java.lang.String uniqueKeyPropertyName, boolean lazy, boolean unwrapProxy, boolean isEmbeddedInXML, boolean ignoreNotFound)
Method Detail |
---|
protected boolean isNullable()
isNullable
in class EntityType
public boolean isAlwaysDirtyChecked()
AssociationType
public boolean isOneToOne()
isOneToOne
in class EntityType
public int getColumnSpan(Mapping mapping) throws MappingException
Type
MappingException
public int[] sqlTypes(Mapping mapping) throws MappingException
Type
MappingException
Types
public void nullSafeSet(java.sql.PreparedStatement st, java.lang.Object value, int index, boolean[] settable, SessionImplementor session) throws HibernateException, java.sql.SQLException
Type
value
- the object to writeindex
- statement parameter indexsettable
- an array indicating which columns to ignore
HibernateException
java.sql.SQLException
public void nullSafeSet(java.sql.PreparedStatement st, java.lang.Object value, int index, SessionImplementor session) throws HibernateException, java.sql.SQLException
Type
value
- the object to writeindex
- statement parameter index
HibernateException
java.sql.SQLException
public ForeignKeyDirection getForeignKeyDirection()
AssociationType
public java.lang.Object hydrate(java.sql.ResultSet rs, java.lang.String[] names, SessionImplementor session, java.lang.Object owner) throws HibernateException, java.sql.SQLException
Type
hydrate
in interface Type
hydrate
in class AbstractType
names
- the column namessession
- the sessionowner
- the parent entity
HibernateException
java.sql.SQLException
Type.resolve(Object, SessionImplementor, Object)
public boolean useLHSPrimaryKey()
AssociationType
public boolean isModified(java.lang.Object old, java.lang.Object current, boolean[] checkable, SessionImplementor session) throws HibernateException
Type
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 updatable
HibernateException
public java.io.Serializable disassemble(java.lang.Object value, SessionImplementor session, java.lang.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 java.lang.Object assemble(java.io.Serializable oid, SessionImplementor session, java.lang.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 object
HibernateException
public void beforeAssemble(java.io.Serializable oid, SessionImplementor session)
Type
beforeAssemble
in interface Type
beforeAssemble
in class AbstractType
public boolean[] toColumnNullness(java.lang.Object value, Mapping mapping)
Type
value
- an instance of the typepublic boolean isDirty(java.lang.Object old, java.lang.Object current, SessionImplementor session) throws HibernateException
Type
isDirty
in interface Type
isDirty
in class AbstractType
old
- the old valuecurrent
- the current value
HibernateException
public boolean isDirty(java.lang.Object old, java.lang.Object current, boolean[] checkable, SessionImplementor session) throws HibernateException
Type
old
- the old valuecurrent
- the current valuecheckable
- which columns are actually updatable
HibernateException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |