public interface UserType
for more complex cases
,
Type
Modifier and Type | Method and Description |
---|---|
Object |
assemble(Serializable cached,
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)
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".
|
int |
hashCode(Object x)
Get a hashcode for the instance, consistent with persistence "equality"
|
boolean |
isMutable()
Are objects of this type mutable?
|
Object |
nullSafeGet(ResultSet rs,
String[] names,
SharedSessionContractImplementor session,
Object owner)
Retrieve an instance of the mapped class from a JDBC resultset.
|
void |
nullSafeSet(PreparedStatement st,
Object value,
int index,
SharedSessionContractImplementor session)
Write an instance of the mapped class to a prepared statement.
|
Object |
replace(Object original,
Object target,
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().
|
int[] |
sqlTypes()
Return the SQL type codes for the columns mapped by this type.
|
int[] sqlTypes()
Types
Class returnedClass()
boolean equals(Object x, Object y) throws HibernateException
x
- y
- HibernateException
int hashCode(Object x) throws HibernateException
HibernateException
Object nullSafeGet(ResultSet rs, String[] names, SharedSessionContractImplementor session, Object owner) throws HibernateException, SQLException
rs
- a JDBC result setnames
- the column namessession
- owner
- the containing entity @return ObjectHibernateException
SQLException
void nullSafeSet(PreparedStatement st, Object value, int index, SharedSessionContractImplementor 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
- the object to be cloned, which may be nullHibernateException
boolean isMutable()
Serializable disassemble(Object value) throws HibernateException
value
- the object to be cachedHibernateException
Object assemble(Serializable cached, Object owner) throws HibernateException
cached
- the object to be cachedowner
- the owner of the cached objectHibernateException
Object replace(Object original, Object target, Object owner) throws HibernateException
original
- the value from the detached entity being mergedtarget
- the value in the managed entityHibernateException
Copyright © 2001-2021 Red Hat, Inc. All Rights Reserved.