|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.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 Type
isPersistentCollectionType
in class AbstractType
public final boolean equals(Object x, Object y)
Type
x
- y
-
public abstract PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister) throws HibernateException
HibernateException
public Object nullSafeGet(ResultSet rs, String name, SessionImplementor session, Object owner) throws HibernateException, SQLException
Type
nullSafeGet
in interface Type
rs
- name
- the column namesession
- owner
- the parent entity
SQLException
HibernateException
public Object nullSafeGet(ResultSet rs, String[] name, SessionImplementor session, Object owner) throws HibernateException, SQLException
Type
nullSafeGet
in interface Type
rs
- name
- the column namessession
- owner
- the parent entity
HibernateException
SQLException
alternative, 2-phase property initialization
public void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session) throws HibernateException, SQLException
Type
nullSafeSet
in interface Type
st
- value
- the object to writeindex
- statement parameter indexsession
-
SQLException
HibernateException
public int[] sqlTypes(Mapping session) throws MappingException
Type
MappingException
Types
public int getColumnSpan(Mapping session) throws MappingException
Type
getColumnSpan
in interface Type
MappingException
public String toString(Object value, SessionFactoryImplementor factory) throws HibernateException
Type
value
- factory
-
HibernateException
public Object fromString(String xml)
Type
fromString
in interface Type
xml
-
public Object deepCopy(Object value) throws HibernateException
Type
value
- generally a collection element or entity field
HibernateException
public 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 Type
disassemble
in class AbstractType
HibernateException
public Object assemble(Serializable cached, SessionImplementor session, Object owner) throws HibernateException
Type
assemble
in interface Type
assemble
in class AbstractType
HibernateException
public boolean isDirty(Object old, Object current, SessionImplementor session) throws HibernateException
Type
isDirty
in interface Type
isDirty
in class AbstractType
HibernateException
public boolean hasNiceEquals()
Type
hasNiceEquals
in interface Type
public abstract PersistentCollection wrap(SessionImplementor session, Object collection)
public boolean isAssociationType()
isAssociationType
in interface Type
isAssociationType
in class AbstractType
public ForeignKeyDirection getForeignKeyDirection()
AssociationType
getForeignKeyDirection
in interface AssociationType
public Object hydrate(ResultSet rs, String[] name, SessionImplementor session, Object owner) throws HibernateException, SQLException
Type
hydrate
in interface Type
hydrate
in class AbstractType
HibernateException
SQLException
public Object resolveIdentifier(Object value, SessionImplementor session, Object owner) throws HibernateException
Type
resolveIdentifier
in interface Type
resolveIdentifier
in class AbstractType
HibernateException
public boolean isArrayType()
public boolean usePrimaryKeyAsForeignKey()
AssociationType
usePrimaryKeyAsForeignKey
in interface AssociationType
public Joinable getJoinable(SessionFactoryImplementor factory) throws MappingException
AssociationType
getJoinable
in interface AssociationType
MappingException
public String[] getReferencedColumns(SessionFactoryImplementor factory) throws MappingException
AssociationType
getReferencedColumns
in interface AssociationType
MappingException
public boolean isModified(Object old, Object current, SessionImplementor session) throws HibernateException
Type
isModified
in interface Type
isModified
in class AbstractType
HibernateException
public Class getAssociatedClass(SessionFactoryImplementor factory) throws MappingException
getAssociatedClass
in interface AssociationType
MappingException
public boolean equals(Object object)
equals
in class AbstractType
public int hashCode()
hashCode
in class AbstractType
public Object copy(Object original, Object target, SessionImplementor session, Object owner, Map copiedAlready) throws HibernateException
copy
in interface Type
copy
in class AbstractType
HibernateException
protected final Type getElementType(SessionFactoryImplementor factory) throws MappingException
MappingException
public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |