|
|||||||||||
| 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.PersistentCollectionType
A type that handles Hibernate PersistentCollections (including arrays).
| Constructor Summary | |
PersistentCollectionType(String role)
|
|
| 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 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. |
Class |
getAssociatedClass(SessionFactoryImplementor factory)
|
int |
getColumnSpan(Mapping session)
How many columns are used to persist this type. |
Iterator |
getElementsIterator(Object collection)
|
protected Type |
getElementType(SessionFactoryImplementor factory)
|
ForeignKeyDirection |
getForeignKeyDirection()
Get the foreign key directionality of this association |
Joinable |
getJoinable(SessionFactoryImplementor factory)
Get the "persister" for this association - a class or collection persister |
String |
getName()
Returns the abbreviated name of the type. |
String[] |
getReferencedColumns(SessionFactoryImplementor factory)
Get the columns referenced by this association. |
String |
getRole()
|
int |
hashCode()
|
boolean |
hasNiceEquals()
Does this type implement a well-behaved equals() method. |
Object |
hydrate(ResultSet rs,
String[] name,
SessionImplementor session,
Object owner)
Retrieve an instance of the mapped class, or the identifier of an entity or collection, from a JDBC resultset. |
abstract PersistentCollection |
instantiate(SessionImplementor session,
CollectionPersister persister)
|
boolean |
isArrayType()
|
boolean |
isAssociationType()
Note: return true because this type is castable to AssociationType. |
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 |
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. |
boolean |
isPersistentCollectionType()
Is this type a collection type. |
Object |
nullSafeGet(ResultSet rs,
String[] name,
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 session)
Return the SQL type codes for the columns mapped by this type. |
String |
toString()
|
String |
toString(Object value,
SessionFactoryImplementor factory)
A representation of the value to be embedded in an XML element. |
boolean |
usePrimaryKeyAsForeignKey()
Is the foreign key the primary key of the table? |
abstract PersistentCollection |
wrap(SessionImplementor session,
Object collection)
|
| Methods inherited from class net.sf.hibernate.type.AbstractType |
isComponentType, isEntityType, isObjectType |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface net.sf.hibernate.type.Type |
getReturnedClass, isComponentType, isEntityType, isObjectType |
| Constructor Detail |
public PersistentCollectionType(String role)
| Method Detail |
public String getRole()
public boolean isPersistentCollectionType()
Type
isPersistentCollectionType in interface TypeisPersistentCollectionType in class AbstractTypepublic final boolean equals(Object x, Object y)
Type
x - y -
public abstract PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister) throws HibernateException
HibernateExceptionpublic 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
HibernateExceptionpublic Object nullSafeGet(ResultSet rs, String[] name, SessionImplementor session, Object owner) throws HibernateException, SQLException
Type
nullSafeGet in interface Typers - name - the column namessession - owner - the parent entity
HibernateException
SQLExceptionalternative, 2-phase property initializationpublic void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) throws HibernateException, SQLException
Type
nullSafeSet in interface Typest - value - the object to writeindex - statement parameter indexsession -
SQLException
HibernateExceptionpublic int[] sqlTypes(Mapping session) throws MappingException
Type
MappingExceptionTypespublic int getColumnSpan(Mapping session) throws MappingException
Type
getColumnSpan in interface TypeMappingExceptionpublic String toString(Object value, SessionFactoryImplementor factory) throws HibernateException
Type
value - factory -
HibernateExceptionpublic Object fromString(String xml)
Type
fromString in interface Typexml -
public Object deepCopy(Object value) throws HibernateException
Type
value - generally a collection element or entity field
HibernateExceptionpublic String getName()
Type
public Iterator getElementsIterator(Object collection)
public boolean isMutable()
Type
public Serializable disassemble(Object value, SessionImplementor session) throws HibernateException
Type
disassemble in interface Typedisassemble in class AbstractTypeHibernateExceptionpublic Object assemble(Serializable cached, SessionImplementor session, Object owner) throws HibernateException
Type
assemble in interface Typeassemble in class AbstractTypeHibernateExceptionpublic boolean isDirty(Object old, Object current, SessionImplementor session) throws HibernateException
Type
isDirty in interface TypeisDirty in class AbstractTypeHibernateExceptionpublic boolean hasNiceEquals()
Type
hasNiceEquals in interface Typepublic abstract PersistentCollection wrap(SessionImplementor session, Object collection)
public boolean isAssociationType()
isAssociationType in interface TypeisAssociationType in class AbstractTypepublic ForeignKeyDirection getForeignKeyDirection()
AssociationType
getForeignKeyDirection in interface AssociationTypepublic Object hydrate(ResultSet rs, String[] name, SessionImplementor session, Object owner) throws HibernateException, SQLException
Type
hydrate in interface Typehydrate in class AbstractTypeHibernateException
SQLExceptionpublic Object resolveIdentifier(Object value, SessionImplementor session, Object owner) throws HibernateException
Type
resolveIdentifier in interface TyperesolveIdentifier in class AbstractTypeHibernateExceptionpublic boolean isArrayType()
public boolean usePrimaryKeyAsForeignKey()
AssociationType
usePrimaryKeyAsForeignKey in interface AssociationTypepublic Joinable getJoinable(SessionFactoryImplementor factory) throws MappingException
AssociationType
getJoinable in interface AssociationTypeMappingExceptionpublic String[] getReferencedColumns(SessionFactoryImplementor factory) throws MappingException
AssociationType
getReferencedColumns in interface AssociationTypeMappingExceptionpublic boolean isModified(Object old, Object current, SessionImplementor session) throws HibernateException
Type
isModified in interface TypeisModified in class AbstractTypeHibernateExceptionpublic Class getAssociatedClass(SessionFactoryImplementor factory) throws MappingException
getAssociatedClass in interface AssociationTypeMappingExceptionpublic boolean equals(Object object)
equals in class AbstractTypepublic int hashCode()
hashCode in class AbstractTypepublic Object copy(Object original, Object target, SessionImplementor session, Object owner, Map copiedAlready) throws HibernateException
copy in interface Typecopy in class AbstractTypeHibernateExceptionprotected final Type getElementType(SessionFactoryImplementor factory) throws MappingException
MappingExceptionpublic String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||