|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sf.hibernate.type.AbstractType
net.sf.hibernate.type.ObjectType
Handles "any" mappings and the old deprecated "object" type
| Nested Class Summary | |
static class |
ObjectType.ObjectTypeCacheEntry
|
| Constructor Summary | |
ObjectType()
|
|
ObjectType(Type metaType,
Type identifierType)
|
|
| Method Summary | |
Object |
assemble(Serializable cached,
SessionImplementor session,
Object owner)
Reconstruct the object from its cached "disassembled" state. |
Cascades.CascadeStyle |
cascade(int i)
|
Object |
deepCopy(Object value)
Return a deep copy of the persistent state, stopping at entities and at collections. |
Serializable |
disassemble(Object value,
SessionImplementor session)
Return a cacheable "disassembled" representation of the object. |
int |
enableJoinedFetch(int i)
|
boolean |
equals(Object object)
|
boolean |
equals(Object x,
Object y)
Compare two instances of the class mapped by this type for persistence "equality", ie. |
Object |
fromString(String xml)
Parse the XML representation of an instance. |
Class |
getAssociatedClass(SessionFactoryImplementor factory)
|
int |
getColumnSpan(Mapping session)
How many columns are used to persist this type. |
ForeignKeyDirection |
getForeignKeyDirection()
Get the foreign key directionality of this association |
Joinable |
getJoinable(SessionFactoryImplementor factory)
Get the "persister" for this association - a class or collection persister |
String |
getName()
Returns the abbreviated name of the type. |
String[] |
getPropertyNames()
|
Object |
getPropertyValue(Object component,
int i,
SessionImplementor session)
|
Object[] |
getPropertyValues(Object component)
Optional operation |
Object[] |
getPropertyValues(Object component,
SessionImplementor session)
|
String[] |
getReferencedColumns(SessionFactoryImplementor factory)
Get the columns referenced by this association. |
Class |
getReturnedClass()
The class returned by nullSafeGet() methods. |
Type[] |
getSubtypes()
|
int |
hashCode()
|
boolean |
hasNiceEquals()
Does this type implement a well-behaved equals() method. |
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 |
isAssociationType()
Return true if the implementation is castable to AssociationType. |
boolean |
isComponentType()
Is this type a component type. |
boolean |
isModified(Object old,
Object current,
SessionImplementor session)
Has the parent object been modified, compared to the current database state? |
boolean |
isMutable()
Are objects of this type mutable. |
boolean |
isObjectType()
Is this an "object" type. |
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. |
void |
nullSafeSet(PreparedStatement st,
Object value,
int index,
SessionImplementor session)
Write an instance of the mapped class to a prepared statement. |
Object |
resolveIdentifier(Object value,
SessionImplementor session,
Object owner)
Map identifiers to entities or collections. |
void |
setPropertyValues(Object component,
Object[] values)
Optional operation |
int[] |
sqlTypes(Mapping mapping)
Return the SQL type codes for the columns mapped by this type. |
String |
toString(Object value,
SessionFactoryImplementor factory)
A representation of the value to be embedded in an XML element. |
boolean |
usePrimaryKeyAsForeignKey()
Not really relevant to ObjectType, since it cannot by "joined"! |
| Methods inherited from class net.sf.hibernate.type.AbstractType |
copy, isDirty, isEntityType, isPersistentCollectionType |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.sf.hibernate.type.Type |
copy, isDirty, isEntityType, isPersistentCollectionType |
| Constructor Detail |
public ObjectType(Type metaType, Type identifierType)
public ObjectType()
| Method Detail |
public Object deepCopy(Object value) throws HibernateException
Type
value - generally a collection element or entity field
HibernateExceptionType.deepCopy(Object)public boolean equals(Object x, Object y) throws HibernateException
Type
x - y -
HibernateExceptionType.equals(Object, Object)public int getColumnSpan(Mapping session) throws MappingException
Type
getColumnSpan in interface TypeMappingExceptionType.getColumnSpan(Mapping)public String getName()
Type
Type.getName()public boolean hasNiceEquals()
Type
hasNiceEquals in interface TypeType.hasNiceEquals()public boolean isMutable()
Type
Type.isMutable()public Object nullSafeGet(ResultSet rs, String name, SessionImplementor session, Object owner) throws HibernateException, SQLException
Type
nullSafeGet in interface Typers - name - the column namesession - owner - the parent entity
SQLException
HibernateExceptionType.nullSafeGet(ResultSet, String, SessionImplementor, Object)public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException
Type
nullSafeGet in interface Typers - names - the column namessession - owner - the parent entity
HibernateException
SQLExceptionType.nullSafeGet(ResultSet, String[], SessionImplementor, Object)public Object hydrate(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException
Type
hydrate in interface Typehydrate in class AbstractTypeHibernateException
SQLExceptionpublic Object resolveIdentifier(Object value, SessionImplementor session, Object owner) throws HibernateException
Type
resolveIdentifier in interface TyperesolveIdentifier in class AbstractTypeHibernateExceptionpublic void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) throws HibernateException, SQLException
Type
nullSafeSet in interface Typest - value - the object to writeindex - statement parameter indexsession -
SQLException
HibernateExceptionType.nullSafeSet(PreparedStatement, Object, int, SessionImplementor)public Class getReturnedClass()
Type
getReturnedClass in interface TypeType.getReturnedClass()public int[] sqlTypes(Mapping mapping) throws MappingException
Type
MappingExceptionType.sqlTypes(Mapping)public String toString(Object value, SessionFactoryImplementor factory) throws HibernateException
Type
value - factory -
HibernateExceptionpublic Object fromString(String xml) throws HibernateException
Type
fromString in interface Typexml -
HibernateExceptionpublic Object assemble(Serializable cached, SessionImplementor session, Object owner) throws HibernateException
Type
assemble in interface Typeassemble in class AbstractTypepublic Serializable disassemble(Object value, SessionImplementor session) throws HibernateException
Type
disassemble in interface Typedisassemble in class AbstractTypeHibernateExceptionType.disassemble(Object, SessionImplementor)public boolean isObjectType()
Type
isObjectType in interface TypeisObjectType in class AbstractTypeType.isObjectType()public Cascades.CascadeStyle cascade(int i)
cascade in interface AbstractComponentTypepublic int enableJoinedFetch(int i)
enableJoinedFetch in interface AbstractComponentTypepublic String[] getPropertyNames()
getPropertyNames in interface AbstractComponentTypepublic Object getPropertyValue(Object component, int i, SessionImplementor session) throws HibernateException
getPropertyValue in interface AbstractComponentTypeHibernateExceptionpublic Object[] getPropertyValues(Object component, SessionImplementor session) throws HibernateException
getPropertyValues in interface AbstractComponentTypeHibernateExceptionpublic Type[] getSubtypes()
getSubtypes in interface AbstractComponentTypepublic void setPropertyValues(Object component, Object[] values) throws HibernateException
AbstractComponentType
setPropertyValues in interface AbstractComponentTypeHibernateExceptionpublic Object[] getPropertyValues(Object component)
AbstractComponentType
getPropertyValues in interface AbstractComponentTypepublic boolean isComponentType()
Type
isComponentType in interface TypeisComponentType in class AbstractTypepublic ForeignKeyDirection getForeignKeyDirection()
AssociationType
getForeignKeyDirection in interface AssociationTypepublic boolean isAssociationType()
Type
isAssociationType in interface TypeisAssociationType in class AbstractTypepublic boolean usePrimaryKeyAsForeignKey()
usePrimaryKeyAsForeignKey in interface AssociationTypepublic Joinable getJoinable(SessionFactoryImplementor factory)
AssociationType
getJoinable in interface AssociationTypepublic String[] getReferencedColumns(SessionFactoryImplementor factory) throws MappingException
AssociationType
getReferencedColumns in interface AssociationTypeMappingExceptionpublic boolean isModified(Object old, Object current, SessionImplementor session) throws HibernateException
Type
isModified in interface TypeisModified in class AbstractTypeHibernateExceptionpublic Class getAssociatedClass(SessionFactoryImplementor factory) throws MappingException
getAssociatedClass in interface AssociationTypeMappingExceptionpublic boolean equals(Object object)
equals in class AbstractTypepublic int hashCode()
hashCode in class AbstractType
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||