|
||||||||||
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 | |
---|---|
java.lang.Object |
assemble(java.io.Serializable cached,
SessionImplementor session,
java.lang.Object owner)
Reconstruct an object from the cacheable representation. |
java.lang.Object |
deepCopy(java.lang.Object value)
Return a deep copy of the persistent state, stopping at entities and at collections. |
java.io.Serializable |
disassemble(java.lang.Object value,
SessionImplementor session)
Transform the object into its cacheable representation. |
boolean |
equals(java.lang.Object x,
java.lang.Object y)
Compare two instances of the class mapped by this type for persistence "equality". |
java.lang.String[] |
getPropertyNames()
Get the "property names" that may be used in a query. |
Type[] |
getPropertyTypes()
Get the corresponding "property types". |
java.lang.Object |
getPropertyValue(java.lang.Object component,
int property)
Get the value of a property. |
int |
hashCode(java.lang.Object x)
Get a hashcode for the instance, consistent with persistence "equality" |
boolean |
isMutable()
Check if objects of this type mutable. |
java.lang.Object |
nullSafeGet(java.sql.ResultSet rs,
java.lang.String[] names,
SessionImplementor session,
java.lang.Object owner)
Retrieve an instance of the mapped class from a JDBC resultset. |
void |
nullSafeSet(java.sql.PreparedStatement st,
java.lang.Object value,
int index,
SessionImplementor session)
Write an instance of the mapped class to a prepared statement. |
java.lang.Object |
replace(java.lang.Object original,
java.lang.Object target,
SessionImplementor session,
java.lang.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. |
java.lang.Class |
returnedClass()
The class returned by nullSafeGet(). |
void |
setPropertyValue(java.lang.Object component,
int property,
java.lang.Object value)
Set the value of a property. |
Method Detail |
---|
java.lang.String[] getPropertyNames()
Type[] getPropertyTypes()
java.lang.Object getPropertyValue(java.lang.Object component, int property) throws HibernateException
component
- an instance of class mapped by this "type"property
-
HibernateException
void setPropertyValue(java.lang.Object component, int property, java.lang.Object value) throws HibernateException
component
- an instance of class mapped by this "type"property
- value
- the value to set
HibernateException
java.lang.Class returnedClass()
boolean equals(java.lang.Object x, java.lang.Object y) throws HibernateException
x
- y
-
HibernateException
int hashCode(java.lang.Object x) throws HibernateException
HibernateException
java.lang.Object nullSafeGet(java.sql.ResultSet rs, java.lang.String[] names, SessionImplementor session, java.lang.Object owner) throws HibernateException, java.sql.SQLException
rs
- a JDBC result setnames
- the column namessession
- owner
- the containing entity
HibernateException
java.sql.SQLException
void nullSafeSet(java.sql.PreparedStatement st, java.lang.Object value, int index, SessionImplementor session) throws HibernateException, java.sql.SQLException
st
- a JDBC prepared statementvalue
- the object to writeindex
- statement parameter indexsession
-
HibernateException
java.sql.SQLException
java.lang.Object deepCopy(java.lang.Object value) throws HibernateException
value
- generally a collection element or entity field
HibernateException
boolean isMutable()
java.io.Serializable disassemble(java.lang.Object value, SessionImplementor session) throws HibernateException
value
- the object to be cachedsession
-
HibernateException
java.lang.Object assemble(java.io.Serializable cached, SessionImplementor session, java.lang.Object owner) throws HibernateException
cached
- the object to be cachedsession
- owner
- the owner of the cached object
HibernateException
java.lang.Object replace(java.lang.Object original, java.lang.Object target, SessionImplementor session, java.lang.Object owner) throws HibernateException
original
- target
- session
- owner
-
HibernateException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |