|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CompositeUserType
A UserType that may be dereferenced in a query.
This interface allows a custom type to define "properties".
These need not necessarily correspond to physical JavaBeans
style properties.
A CompositeUserType may be used in almost every way
that a component may be used. It may even contain many-to-one
associations.
Implementors must be immutable and must declare a public
default constructor.
Unlike UserType, cacheability does not depend upon
serializability. Instead, assemble() and
disassemble provide conversion to/from a cacheable
representation.
for more simple cases
,
Type
Method Summary | |
---|---|
Object |
assemble(Serializable cached,
SessionImplementor session,
Object owner)
Reconstruct an object from the cacheable representation. |
Object |
deepCopy(Object value)
Return a deep copy of the persistent state, stopping at entities and at collections. |
Serializable |
disassemble(Object value,
SessionImplementor session)
Transform the object into its cacheable representation. |
boolean |
equals(Object x,
Object y)
Compare two instances of the class mapped by this type for persistence "equality". |
String[] |
getPropertyNames()
Get the "property names" that may be used in a query. |
Type[] |
getPropertyTypes()
Get the corresponding "property types". |
Object |
getPropertyValue(Object component,
int property)
Get the value of a property. |
int |
hashCode(Object x)
Get a hashcode for the instance, consistent with persistence "equality" |
boolean |
isMutable()
Check if objects of this type mutable. |
Object |
nullSafeGet(ResultSet rs,
String[] names,
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 |
replace(Object original,
Object target,
SessionImplementor session,
Object owner)
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. |
Class |
returnedClass()
The class returned by nullSafeGet(). |
void |
setPropertyValue(Object component,
int property,
Object value)
Set the value of a property. |
Method Detail |
---|
String[] getPropertyNames()
Type[] getPropertyTypes()
Object getPropertyValue(Object component, int property) throws HibernateException
component
- an instance of class mapped by this "type"property
-
HibernateException
void setPropertyValue(Object component, int property, Object value) throws HibernateException
component
- an instance of class mapped by this "type"property
- value
- the value to set
HibernateException
Class returnedClass()
boolean equals(Object x, Object y) throws HibernateException
HibernateException
int hashCode(Object x) throws HibernateException
HibernateException
Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner) throws HibernateException, SQLException
rs
- a JDBC result setnames
- the column namessession
- owner
- the containing entity
HibernateException
SQLException
void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) throws HibernateException, SQLException
st
- a JDBC prepared statementvalue
- the object to writeindex
- statement parameter indexsession
-
HibernateException
SQLException
Object deepCopy(Object value) throws HibernateException
value
- generally a collection element or entity field
HibernateException
boolean isMutable()
Serializable disassemble(Object value, SessionImplementor session) throws HibernateException
value
- the object to be cachedsession
-
HibernateException
Object assemble(Serializable cached, SessionImplementor session, Object owner) throws HibernateException
cached
- the object to be cachedsession
- owner
- the owner of the cached object
HibernateException
Object replace(Object original, Object target, SessionImplementor session, Object owner) throws HibernateException
HibernateException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |