Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.hibernate.type.AbstractType
org.hibernate.type.EntityType
Field Summary | |
protected boolean | |
protected String |
Constructor Summary | |
|
Method Summary | |
int |
|
Object |
|
Object |
|
String |
|
String |
|
Joinable |
|
int |
|
protected Object |
|
String |
|
Type |
|
String | |
String |
|
String |
|
String | |
String | |
Class |
|
Type |
|
boolean |
|
boolean | |
boolean |
|
boolean |
|
boolean | |
protected boolean |
|
protected boolean |
|
protected abstract boolean | |
abstract boolean | |
boolean |
|
boolean |
|
boolean | |
Object |
|
Object |
|
Object |
|
Object |
|
Object |
|
protected Object |
|
void |
|
String |
|
String |
|
Methods inherited from class org.hibernate.type.AbstractType | |
assemble , beforeAssemble , compare , disassemble , getHashCode , getHashCode , getSemiResolvedType , hydrate , isAnyType , isAssociationType , isCollectionType , isComponentType , isDirty , isEntityType , isEqual , isEqual , isModified , isSame , isXMLElement , replace , replaceNode , resolve , semiResolve |
protected final boolean isEmbeddedInXML
protected final String uniqueKeyPropertyName
protected EntityType(String entityName, String uniqueKeyPropertyName, boolean eager, boolean isEmbeddedInXML, boolean unwrapProxy)
Constructs the requested entity type mapping.
- Parameters:
entityName
- The name of the associated entity.uniqueKeyPropertyName
- The property-ref name, or null if we reference the PK of the associated entity.eager
- Is eager fetching enabled.isEmbeddedInXML
- Should values of this mapping be embedded in XML modes?unwrapProxy
- Is unwrapping of proxies allowed for this association; unwrapping says to return the "implementation target" of lazy prooxies; typically only possible with lazy="no-proxy".
public int compare(Object x, Object y, EntityMode entityMode)
- Overrides:
- compare in interface AbstractType
public Object deepCopy(Object value, EntityMode entityMode, SessionFactoryImplementor factory)
public Object fromXMLNode(Node xml, Mapping factory) throws HibernateException
- Specified by:
- fromXMLNode in interface Type
public final String getAssociatedEntityName()
The name of the associated entity.
- Returns:
- The associated entity name.
public String getAssociatedEntityName(SessionFactoryImplementor factory)
The name of the associated entity.
- Specified by:
- getAssociatedEntityName in interface AssociationType
- Parameters:
factory
- The session factory, for resolution.
- Returns:
- The associated entity name.
public Joinable getAssociatedJoinable(SessionFactoryImplementor factory) throws MappingException
Retrieves theJoinable
defining the associated entity.
- Specified by:
- getAssociatedJoinable in interface AssociationType
- Parameters:
factory
- The session factory.
- Returns:
- The associated joinable
- Throws:
MappingException
- Generally indicates an invalid entity name.
public int getHashCode(Object x, EntityMode entityMode, SessionFactoryImplementor factory)
- Specified by:
- getHashCode in interface Type
- Overrides:
- getHashCode in interface AbstractType
protected final Object getIdentifier(Object value, SessionImplementor session) throws HibernateException
public final String getIdentifierOrUniqueKeyPropertyName(Mapping factory) throws MappingException
The name of the property on the associated entity to which our FK refers
- Parameters:
factory
- The mappings...
- Returns:
- The appropriate property name.
- Throws:
MappingException
- Generally, if unable to resolve the associated entity name
public final Type getIdentifierOrUniqueKeyType(Mapping factory) throws MappingException
Determine the type of either (1) the identifier if we reference the associated entity's PK or (2) the unique key to which we refer (i.e. the property-ref).
- Parameters:
factory
- The mappings...
- Returns:
- The appropriate type.
- Throws:
MappingException
- Generally, if unable to resolve the associated entity name or unique key property name.
public String getLHSPropertyName()
- Specified by:
- getLHSPropertyName in interface AssociationType
public String getName()
For entity types, the name correlates to the associated entity name.
public String getOnCondition(String alias, SessionFactoryImplementor factory, Map enabledFilters) throws MappingException
- Specified by:
- getOnCondition in interface AssociationType
public String getPropertyName()
public String getRHSUniqueKeyPropertyName()
- Specified by:
- getRHSUniqueKeyPropertyName in interface AssociationType
public final Class getReturnedClass()
This returns the wrong class for an entity with a proxy, or for a named entity. Theoretically it should return the proxy class, but it doesn't. The problem here is that we do not necessarily have a ref to the associated entity persister (nor to the session factory, to look it up) which is really needed to "do the right thing" here...
- Specified by:
- getReturnedClass in interface Type
- Returns:
- The entiyt class.
public Type getSemiResolvedType(SessionFactoryImplementor factory)
Get the type of a semi-resolved value.
- Specified by:
- getSemiResolvedType in interface Type
- Overrides:
- getSemiResolvedType in interface AbstractType
public boolean isAssociationType()
An entity type is a type of association type
- Specified by:
- isAssociationType in interface Type
- Overrides:
- isAssociationType in interface AbstractType
- Returns:
- True.
public boolean isEmbeddedInXML()
- Specified by:
- isEmbeddedInXML in interface AssociationType
public final boolean isEntityType()
Explicitly, an entity type is an entity type ;)
- Specified by:
- isEntityType in interface Type
- Overrides:
- isEntityType in interface AbstractType
- Returns:
- True.
public boolean isEqual(Object x, Object y, EntityMode entityMode, SessionFactoryImplementor factory)
- Overrides:
- isEqual in interface AbstractType
protected abstract boolean isNullable()
public abstract boolean isOneToOne()
public boolean isReferenceToPrimaryKey()
Does this association foreign key reference the primary key of the other table? Otherwise, it references a property-ref.
- Returns:
- True if this association reference the PK of the associated entity.
public final boolean isSame(Object x, Object y, EntityMode entityMode)
Two entities are considered the same when their instances are the same.
- Overrides:
- isSame in interface AbstractType
- Parameters:
x
- One entity instancey
- Another entity instanceentityMode
- The entity mode.
- Returns:
- True if x == y; false otherwise.
public boolean isXMLElement()
- Specified by:
- isXMLElement in interface Type
- Overrides:
- isXMLElement in interface AbstractType
public Object loadByUniqueKey(String entityName, String uniqueKeyPropertyName, Object key, SessionImplementor session) throws HibernateException
Load an instance by a unique key that is not the primary key.
- Parameters:
entityName
- The name of the entity to loaduniqueKeyPropertyName
- The name of the property defining the uniqie key.key
- The unique key property value.session
- The originating session.
- Returns:
- The loaded entity
- Throws:
HibernateException
- generally indicates problems performing the load.
public Object nullSafeGet(ResultSet rs, String name, SessionImplementor session, Object owner) throws HibernateException, SQLException
- Specified by:
- nullSafeGet in interface Type
public final Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException
- Specified by:
- nullSafeGet in interface Type
public Object replace(Object original, Object target, SessionImplementor session, Object owner, Map copyCache) throws HibernateException
public Object resolve(Object value, SessionImplementor session, Object owner) throws HibernateException
Resolve an identifier or unique key value
- Overrides:
- resolve in interface AbstractType
protected final Object resolveIdentifier(Serializable id, SessionImplementor session) throws HibernateException
Resolve an identifier via a load.
- Parameters:
id
- The entity id to resolvesession
- The orginating session.
- Returns:
- The resolved identifier (i.e., loaded entity).
- Throws:
HibernateException
- Indicates problems performing the load.
public void setToXMLNode(Node node, Object value, SessionFactoryImplementor factory) throws HibernateException
- Specified by:
- setToXMLNode in interface Type
public String toLoggableString(Object value, SessionFactoryImplementor factory)
Generate a loggable representation of an instance of the value mapped by this type.
- Specified by:
- toLoggableString in interface Type
- Parameters:
value
- The instance to be logged.factory
- The session factory.
- Returns:
- The loggable string.
public String toString()
Generates a string representation of this type.
- Returns:
- string rep