|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Defines a mapping from a Java type to an JDBC datatype. This interface is intended to
be implemented by applications that need custom types.
Implementors should usually be immutable and must certainly be threadsafe.
Implementors must override equals().
| Method Summary | |
Object |
assemble(Serializable cached,
SessionImplementor session,
Object owner)
Reconstruct the object from its cached "disassembled" state. |
Object |
copy(Object original,
Object target,
SessionImplementor session,
Object owner,
Map copiedAlready)
|
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. |
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. |
int |
getColumnSpan(Mapping mapping)
How many columns are used to persist this type. |
String |
getName()
Returns the abbreviated name of the type. |
Class |
getReturnedClass()
The class returned by nullSafeGet() methods. |
boolean |
hasNiceEquals()
Deprecated. we are not using this anymore |
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 |
isDirty(Object old,
Object current,
SessionImplementor session)
Should the parent be considered dirty, given both the old and current field or element value? |
boolean |
isEntityType()
Is this type an entity type? |
boolean |
isModified(Object oldHydratedState,
Object currentState,
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. |
boolean |
isPersistentCollectionType()
Is this type a collection 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. |
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. |
| Method Detail |
public boolean isAssociationType()
AssociationTypepublic boolean isPersistentCollectionType()
public boolean isComponentType()
AbstractComponentTypepublic boolean isEntityType()
public boolean isObjectType()
public int[] sqlTypes(Mapping mapping) throws MappingException
MappingExceptionTypespublic int getColumnSpan(Mapping mapping) throws MappingException
MappingExceptionpublic Class getReturnedClass()
public boolean equals(Object x, Object y) throws HibernateException
x - y -
HibernateExceptionpublic boolean isDirty(Object old, Object current, SessionImplementor session) throws HibernateException
old - the old valuecurrent - the current valuesession -
HibernateExceptionpublic boolean isModified(Object oldHydratedState, Object currentState, SessionImplementor session) throws HibernateException
oldHydratedState - the database state, in a "hydrated" form, with identifiers unresolvedcurrentState - the current state of the objectsession -
HibernateExceptionpublic Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException
rs - names - the column namessession - owner - the parent entity
HibernateException
SQLExceptionalternative, 2-phase property initializationpublic Object nullSafeGet(ResultSet rs, String name, SessionImplementor session, Object owner) throws HibernateException, SQLException
rs - name - the column namesession - owner - the parent entity
HibernateException
SQLExceptionpublic void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) throws HibernateException, SQLException
st - value - the object to writeindex - statement parameter indexsession -
HibernateException
SQLExceptionpublic String toString(Object value, SessionFactoryImplementor factory) throws HibernateException
value - factory -
HibernateExceptionpublic Object fromString(String xml) throws HibernateException
xml -
HibernateExceptionpublic String getName()
public Object deepCopy(Object value) throws HibernateException
value - generally a collection element or entity field
HibernateExceptionpublic boolean isMutable()
public Serializable disassemble(Object value, SessionImplementor session) throws HibernateException
value - the value to cachesession - the session
HibernateExceptionpublic Object assemble(Serializable cached, SessionImplementor session, Object owner) throws HibernateException
cached - the disassembled state from the cachesession - the sessionowner - the parent entity object
HibernateExceptionpublic boolean hasNiceEquals()
public Object hydrate(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException
rs - names - the column namessession - the sessionowner - the parent entity
HibernateException
SQLExceptionresolveIdentifier(Object, SessionImplementor, Object)public Object resolveIdentifier(Object value, SessionImplementor session, Object owner) throws HibernateException
value - an identifier or value returned by hydrate()owner - the parent entitysession - the session
HibernateExceptionhydrate(ResultSet, String[], SessionImplementor, Object)public Object copy(Object original, Object target, SessionImplementor session, Object owner, Map copiedAlready) throws HibernateException
HibernateException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||