|
|||||||||||
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
A reference to an entity class
Field Summary | |
protected boolean |
isEmbeddedInXML
|
protected String |
uniqueKeyPropertyName
|
Constructor Summary | |
protected |
EntityType(String entityName,
String uniqueKeyPropertyName,
boolean eager,
boolean isEmbeddedInXML,
boolean unwrapProxy)
|
Method Summary | |
int |
compare(Object x,
Object y,
EntityMode entityMode)
compare two instances of the type |
Object |
deepCopy(Object value,
EntityMode entityMode,
SessionFactoryImplementor factory)
Return a deep copy of the persistent state, stopping at entities and at collections. |
Object |
fromXMLNode(org.dom4j.Node xml,
Mapping factory)
Parse the XML representation of an instance. |
String |
getAssociatedEntityName()
|
String |
getAssociatedEntityName(SessionFactoryImplementor factory)
Get the entity name of the associated entity |
Joinable |
getAssociatedJoinable(SessionFactoryImplementor factory)
Get the "persister" for this association - a class or collection persister |
int |
getHashCode(Object x,
EntityMode entityMode,
SessionFactoryImplementor factory)
Get a hashcode, consistent with persistence "equality" |
protected Object |
getIdentifier(Object value,
SessionImplementor session)
|
String |
getIdentifierOrUniqueKeyPropertyName(Mapping factory)
|
Type |
getIdentifierOrUniqueKeyType(Mapping factory)
|
String |
getLHSPropertyName()
Get the name of a property in the owning entity that provides the join key (null if the identifier) |
String |
getName()
Returns the abbreviated name of the type. |
String |
getOnCondition(String alias,
SessionFactoryImplementor factory,
Map enabledFilters)
Get the "filtering" SQL fragment that is applied in the SQL on clause, in addition to the usual join condition |
String |
getPropertyName()
|
Class |
getReturnedClass()
This returns the wrong class for an entity with a proxy, or for a named entity. |
String |
getRHSUniqueKeyPropertyName()
The name of a unique property of the associated entity that provides the join key (null if the identifier of an entity, or key of a collection) |
Type |
getSemiResolvedType(SessionFactoryImplementor factory)
Get the type of a semi-resolved value. |
boolean |
isAssociationType()
Return true if the implementation is castable to AssociationType. |
boolean |
isEmbeddedInXML()
|
boolean |
isEntityType()
Is this type an entity type? |
boolean |
isEqual(Object x,
Object y,
EntityMode entityMode,
SessionFactoryImplementor factory)
Compare two instances of the class mapped by this type for persistence "equality" - equality of persistent state. |
boolean |
isMutable()
Are objects of this type mutable. |
protected boolean |
isNotEmbedded(SessionImplementor session)
|
protected boolean |
isNull(Object owner,
SessionImplementor session)
|
protected abstract boolean |
isNullable()
|
abstract boolean |
isOneToOne()
|
boolean |
isReferenceToPrimaryKey()
Does this association foreign key reference the primary key of the other table? |
boolean |
isSame(Object x,
Object y,
EntityMode entityMode)
Compare two instances of the class mapped by this type for persistence "equality" - equality of persistent state - taking a shortcut for entity references. |
boolean |
isXMLElement()
|
Object |
loadByUniqueKey(String entityName,
String uniqueKeyPropertyName,
Object key,
SessionImplementor session)
Load an instance by a unique key that is not the primary key. |
Object |
nullSafeGet(ResultSet rs,
String[] names,
SessionImplementor session,
Object owner)
Retrieve an instance of the mapped class from a JDBC resultset. |
Object |
nullSafeGet(ResultSet rs,
String name,
SessionImplementor session,
Object owner)
Retrieve an instance of the mapped class from a JDBC resultset. |
Object |
replace(Object original,
Object target,
SessionImplementor session,
Object owner,
Map copyCache)
During merge, replace the existing (target) value in the entity we are merging to with a new (original) value from the detached entity we are merging. |
Object |
resolve(Object value,
SessionImplementor session,
Object owner)
Resolve an identifier or unique key value |
protected Object |
resolveIdentifier(Serializable id,
SessionImplementor session)
Resolve an identifier |
void |
setToXMLNode(org.dom4j.Node node,
Object value,
SessionFactoryImplementor factory)
A representation of the value to be embedded in an XML element. |
String |
toLoggableString(Object value,
SessionFactoryImplementor factory)
A representation of the value to be embedded in a log file. |
String |
toString()
|
Methods inherited from class org.hibernate.type.AbstractType |
assemble, beforeAssemble, disassemble, getHashCode, hydrate, isAnyType, isCollectionType, isComponentType, isDirty, isEqual, isModified, 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.AssociationType |
getForeignKeyDirection, isAlwaysDirtyChecked, useLHSPrimaryKey |
Methods inherited from interface org.hibernate.type.Type |
assemble, beforeAssemble, disassemble, getColumnSpan, getHashCode, hydrate, isAnyType, isCollectionType, isComponentType, isDirty, isDirty, isEqual, isModified, nullSafeSet, nullSafeSet, replace, semiResolve, sqlTypes, toColumnNullness |
Field Detail |
protected final String uniqueKeyPropertyName
protected final boolean isEmbeddedInXML
Constructor Detail |
protected EntityType(String entityName, String uniqueKeyPropertyName, boolean eager, boolean isEmbeddedInXML, boolean unwrapProxy)
Method Detail |
public boolean isEmbeddedInXML()
isEmbeddedInXML
in interface AssociationType
public final boolean isEntityType()
Type
isEntityType
in interface Type
isEntityType
in class AbstractType
public String getPropertyName()
public final String getAssociatedEntityName()
public final boolean isSame(Object x, Object y, EntityMode entityMode)
Type
isSame
in interface Type
isSame
in class AbstractType
public int compare(Object x, Object y, EntityMode entityMode)
Type
compare
in interface Type
compare
in class AbstractType
public Object nullSafeGet(ResultSet rs, String name, SessionImplementor session, Object owner) throws HibernateException, SQLException
Type
nullSafeGet
in interface Type
rs
- name
- the column namesession
- owner
- the parent entity
SQLException
HibernateException
public final Class getReturnedClass()
getReturnedClass
in interface Type
protected final Object getIdentifier(Object value, SessionImplementor session) throws HibernateException
HibernateException
protected boolean isNotEmbedded(SessionImplementor session)
public String toLoggableString(Object value, SessionFactoryImplementor factory) throws HibernateException
Type
toLoggableString
in interface Type
value
- factory
-
HibernateException
public String getName()
Type
getName
in interface Type
public Object deepCopy(Object value, EntityMode entityMode, SessionFactoryImplementor factory)
Type
deepCopy
in interface Type
value
- generally a collection element or entity fieldentityMode
- factory
-
public boolean isMutable()
Type
isMutable
in interface Type
public abstract boolean isOneToOne()
public Object replace(Object original, Object target, SessionImplementor session, Object owner, Map copyCache) throws HibernateException
Type
replace
in interface Type
original
- the value from the detached entity being mergedtarget
- the value in the managed entity
HibernateException
public boolean isAssociationType()
Type
isAssociationType
in interface Type
isAssociationType
in class AbstractType
public final Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException
Type
nullSafeGet
in interface Type
rs
- names
- the column namessession
- owner
- the parent entity
HibernateException
SQLException
alternative, 2-phase property initialization
public Joinable getAssociatedJoinable(SessionFactoryImplementor factory) throws MappingException
AssociationType
getAssociatedJoinable
in interface AssociationType
MappingException
public final Type getIdentifierOrUniqueKeyType(Mapping factory) throws MappingException
MappingException
public final String getIdentifierOrUniqueKeyPropertyName(Mapping factory) throws MappingException
MappingException
protected abstract boolean isNullable()
protected final Object resolveIdentifier(Serializable id, SessionImplementor session) throws HibernateException
HibernateException
protected boolean isNull(Object owner, SessionImplementor session)
public Object resolve(Object value, SessionImplementor session, Object owner) throws HibernateException
resolve
in interface Type
resolve
in class AbstractType
HibernateException
public String getAssociatedEntityName(SessionFactoryImplementor factory)
AssociationType
getAssociatedEntityName
in interface AssociationType
public boolean isReferenceToPrimaryKey()
public String getRHSUniqueKeyPropertyName()
AssociationType
getRHSUniqueKeyPropertyName
in interface AssociationType
public String toString()
public Object loadByUniqueKey(String entityName, String uniqueKeyPropertyName, Object key, SessionImplementor session) throws HibernateException
HibernateException
public String getLHSPropertyName()
AssociationType
getLHSPropertyName
in interface AssociationType
public String getOnCondition(String alias, SessionFactoryImplementor factory, Map enabledFilters) throws MappingException
AssociationType
getOnCondition
in interface AssociationType
MappingException
public Type getSemiResolvedType(SessionFactoryImplementor factory)
Type
getSemiResolvedType
in interface Type
getSemiResolvedType
in class AbstractType
public int getHashCode(Object x, EntityMode entityMode, SessionFactoryImplementor factory)
Type
getHashCode
in interface Type
getHashCode
in class AbstractType
public boolean isEqual(Object x, Object y, EntityMode entityMode, SessionFactoryImplementor factory)
Type
isEqual
in interface Type
isEqual
in class AbstractType
public boolean isXMLElement()
isXMLElement
in interface Type
isXMLElement
in class AbstractType
public Object fromXMLNode(org.dom4j.Node xml, Mapping factory) throws HibernateException
Type
fromXMLNode
in interface Type
xml
- factory
-
HibernateException
public void setToXMLNode(org.dom4j.Node node, Object value, SessionFactoryImplementor factory) throws HibernateException
Type
setToXMLNode
in interface Type
value
- factory
-
HibernateException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |