|
|||||||||||
| 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.ComponentType
Handles "component" mappings
| Constructor Summary | |
ComponentType(Class componentClass,
String[] propertyNames,
Getter[] propertyGetters,
Setter[] propertySetters,
boolean foundCustomAccessor,
Type[] propertyTypes,
int[] joinedFetch,
Cascades.CascadeStyle[] cascade,
String parentProperty)
|
|
| Method Summary | |
Object |
assemble(Serializable object,
SessionImplementor session,
Object owner)
Reconstruct the object from its cached "disassembled" state. |
Cascades.CascadeStyle |
cascade(int i)
|
Object |
copy(Object original,
Object target,
SessionImplementor session,
Object owner,
Map copiedAlready)
|
Object |
deepCopy(Object component)
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. |
int |
getColumnSpan(Mapping mapping)
How many columns are used to persist this type. |
String |
getName()
Returns the abbreviated name of the type. |
String[] |
getPropertyNames()
|
Object |
getPropertyValue(Object component,
int i)
|
Object |
getPropertyValue(Object component,
int i,
SessionImplementor session)
|
Object[] |
getPropertyValues(Object component)
Optional operation |
Object[] |
getPropertyValues(Object component,
SessionImplementor session)
|
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. |
Object |
instantiate(Object parent,
SessionImplementor session)
|
boolean |
isComponentType()
Is this type a component type. |
boolean |
isDirty(Object x,
Object y,
SessionImplementor session)
Should the parent be considered dirty, given both the old and current field or element value? |
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. |
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 begin,
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. |
| Methods inherited from class net.sf.hibernate.type.AbstractType |
isAssociationType, isEntityType, isObjectType, 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 |
isAssociationType, isEntityType, isObjectType, isPersistentCollectionType |
| Constructor Detail |
public ComponentType(Class componentClass,
String[] propertyNames,
Getter[] propertyGetters,
Setter[] propertySetters,
boolean foundCustomAccessor,
Type[] propertyTypes,
int[] joinedFetch,
Cascades.CascadeStyle[] cascade,
String parentProperty)
throws MappingException
| Method Detail |
public int[] sqlTypes(Mapping mapping)
throws MappingException
Type
sqlTypes in interface TypeMappingExceptionTypes
public int getColumnSpan(Mapping mapping)
throws MappingException
Type
getColumnSpan in interface TypeMappingExceptionpublic final boolean isComponentType()
Type
isComponentType in interface TypeisComponentType in class AbstractTypepublic Class getReturnedClass()
Type
getReturnedClass in interface Type
public boolean equals(Object x,
Object y)
throws HibernateException
Type
equals in interface Typex - y -
HibernateException
public boolean isDirty(Object x,
Object y,
SessionImplementor session)
throws HibernateException
Type
isDirty in interface TypeisDirty in class AbstractTypeHibernateException
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
SQLExceptionalternative, 2-phase property initialization
public void nullSafeSet(PreparedStatement st,
Object value,
int begin,
SessionImplementor session)
throws HibernateException,
SQLException
Type
nullSafeSet in interface Typest - value - the object to writebegin - statement parameter indexsession -
SQLException
HibernateException
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
HibernateException
public Object getPropertyValue(Object component,
int i,
SessionImplementor session)
throws HibernateException
getPropertyValue in interface AbstractComponentTypeHibernateException
public Object getPropertyValue(Object component,
int i)
throws HibernateException
HibernateException
public Object[] getPropertyValues(Object component,
SessionImplementor session)
throws HibernateException
getPropertyValues in interface AbstractComponentTypeHibernateException
public Object[] getPropertyValues(Object component)
throws HibernateException
AbstractComponentType
getPropertyValues in interface AbstractComponentTypeHibernateException
public void setPropertyValues(Object component,
Object[] values)
throws HibernateException
AbstractComponentType
setPropertyValues in interface AbstractComponentTypeHibernateExceptionpublic Type[] getSubtypes()
getSubtypes in interface AbstractComponentTypepublic String getName()
Type
getName in interface Type
public String toString(Object value,
SessionFactoryImplementor factory)
throws HibernateException
Type
toString in interface Typevalue - factory -
HibernateException
public Object fromString(String xml)
throws HibernateException
Type
fromString in interface Typexml -
HibernateExceptionpublic String[] getPropertyNames()
getPropertyNames in interface AbstractComponentType
public Object deepCopy(Object component)
throws HibernateException
Type
deepCopy in interface Typecomponent - generally a collection element or entity field
HibernateException
public Object copy(Object original,
Object target,
SessionImplementor session,
Object owner,
Map copiedAlready)
throws HibernateException
copy in interface Typecopy in class AbstractTypeHibernateException
public Object instantiate(Object parent,
SessionImplementor session)
throws HibernateException
HibernateExceptionpublic Cascades.CascadeStyle cascade(int i)
cascade in interface AbstractComponentTypepublic boolean isMutable()
Type
isMutable in interface Type
public Serializable disassemble(Object value,
SessionImplementor session)
throws HibernateException
Type
disassemble in interface Typedisassemble in class AbstractTypeHibernateException
public Object assemble(Serializable object,
SessionImplementor session,
Object owner)
throws HibernateException
Type
assemble in interface Typeassemble in class AbstractTypeHibernateExceptionpublic boolean hasNiceEquals()
Type
hasNiceEquals in interface TypeObject.equals(java.lang.Object),
Type.equals(java.lang.Object, java.lang.Object)public int enableJoinedFetch(int i)
enableJoinedFetch in interface AbstractComponentType
public Object hydrate(ResultSet rs,
String[] names,
SessionImplementor session,
Object owner)
throws HibernateException,
SQLException
Type
hydrate in interface Typehydrate in class AbstractTypeHibernateException
SQLException
public Object resolveIdentifier(Object value,
SessionImplementor session,
Object owner)
throws HibernateException
Type
resolveIdentifier in interface TyperesolveIdentifier in class AbstractTypeHibernateException
public boolean isModified(Object old,
Object current,
SessionImplementor session)
throws HibernateException
Type
isModified in interface TypeisModified in class AbstractTypeHibernateExceptionpublic 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 | ||||||||||