|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A strategy for persisting a collection role. Defines a contract between
the persistence strategy and the actual persistent collection framework
and session. Does not define operations that are required for querying
collections, or loading by outer join.
Implements persistence of a collection instance while the instance is
referenced in a particular role.
This class is highly coupled to the PersistentCollection
hierarchy, since double dispatch is used to load and update collection
elements.
May be considered an immutable view of the mapping object
QueryableCollection
,
PersistentCollection
Method Summary | |
void |
deleteRows(PersistentCollection collection,
Serializable key,
SessionImplementor session)
Delete the persistent state of any elements that were removed from the collection |
boolean |
elementExists(Serializable key,
Object element,
SessionImplementor session)
|
CacheConcurrencyStrategy |
getCache()
Get the cache |
CacheEntryStructure |
getCacheEntryStructure()
Get the cache structure |
CollectionMetadata |
getCollectionMetadata()
|
Serializable[] |
getCollectionSpaces()
Get the "space" that holds the persistent state |
CollectionType |
getCollectionType()
Get the associated Type |
Object |
getElementByIndex(Serializable key,
Object index,
SessionImplementor session,
Object owner)
|
Class |
getElementClass()
Return the element class of an array, or null otherwise |
String[] |
getElementColumnAliases(String suffix)
Generates the collection's element column aliases, based on the given suffix. |
String |
getElementNodeName()
|
Type |
getElementType()
Get the "element" type |
SessionFactoryImplementor |
getFactory()
|
String |
getIdentifierColumnAlias(String suffix)
Generates the collection's identifier column aliases, based on the given suffix. |
IdentifierGenerator |
getIdentifierGenerator()
Get the surrogate key generation strategy (optional operation) |
Type |
getIdentifierType()
Get the type of the surrogate key |
String[] |
getIndexColumnAliases(String suffix)
Generates the collection's index column aliases, based on the given suffix. |
String |
getIndexNodeName()
|
Type |
getIndexType()
Get the "index" type for a list or map (optional operation) |
String[] |
getKeyColumnAliases(String suffix)
Generates the collection's key column aliases, based on the given suffix. |
Type |
getKeyType()
Get the "key" type (the type of the foreign key) |
String |
getManyToManyFilterFragment(String alias,
Map enabledFilters)
|
String |
getNodeName()
|
EntityPersister |
getOwnerEntityPersister()
Get the persister of the entity that "owns" this collection |
String |
getRole()
Get the name of this collection role (the fully qualified class name, extended by a "property path") |
int |
getSize(Serializable key,
SessionImplementor session)
|
boolean |
hasCache()
Is this collection role cacheable |
boolean |
hasIndex()
Is this an "indexed" collection? (list or map) |
boolean |
hasManyToManyOrdering()
|
boolean |
hasOrdering()
Is this an ordered collection? (An ordered collection is ordered by the initialization operation, not by sorting that happens in memory, as in the case of a sorted collection.) |
boolean |
hasOrphanDelete()
Does this collection implement "orphan delete"? |
boolean |
indexExists(Serializable key,
Object index,
SessionImplementor session)
|
void |
initialize(Serializable key,
SessionImplementor session)
Initialize the given collection with the given key |
void |
insertRows(PersistentCollection collection,
Serializable key,
SessionImplementor session)
Insert the persistent state of any new collection elements |
boolean |
isAffectedByEnabledFilters(SessionImplementor session)
|
boolean |
isArray()
Is this an array? |
boolean |
isCascadeDeleteEnabled()
Is cascade delete handled by the database-level foreign key constraint definition? |
boolean |
isExtraLazy()
|
boolean |
isInverse()
Is this collection "inverse", so state changes are not propogated to the database. |
boolean |
isLazy()
Is this collection lazyily initialized? |
boolean |
isManyToMany()
Is this a many-to-many association? Note that this is mainly a convenience feature as the single persister does not conatin all the information needed to handle a many-to-many itself, as internally it is looked at as two many-to-ones. |
boolean |
isMutable()
Can the elements of this collection change? |
boolean |
isOneToMany()
Is this a one-to-many association? |
boolean |
isPrimitiveArray()
Is this an array or primitive values? |
boolean |
isVersioned()
Does this collection cause version increment of the owning entity? |
void |
postInstantiate()
|
Object |
readElement(ResultSet rs,
Object owner,
String[] columnAliases,
SessionImplementor session)
Read the element from a row of the JDBC ResultSet |
Object |
readIdentifier(ResultSet rs,
String columnAlias,
SessionImplementor session)
Read the identifier from a row of the JDBC ResultSet |
Object |
readIndex(ResultSet rs,
String[] columnAliases,
SessionImplementor session)
Read the index from a row of the JDBC ResultSet |
Object |
readKey(ResultSet rs,
String[] keyAliases,
SessionImplementor session)
Read the key from a row of the JDBC ResultSet |
void |
recreate(PersistentCollection collection,
Serializable key,
SessionImplementor session)
(Re)create the collection's persistent state |
void |
remove(Serializable id,
SessionImplementor session)
Completely remove the persistent state of the collection |
void |
updateRows(PersistentCollection collection,
Serializable key,
SessionImplementor session)
Update the persistent state of any elements that were modified |
Method Detail |
public void initialize(Serializable key, SessionImplementor session) throws HibernateException
HibernateException
public CacheConcurrencyStrategy getCache()
public boolean hasCache()
public CacheEntryStructure getCacheEntryStructure()
public CollectionType getCollectionType()
public Type getKeyType()
public Type getIndexType()
public Type getElementType()
public Class getElementClass()
public Object readKey(ResultSet rs, String[] keyAliases, SessionImplementor session) throws HibernateException, SQLException
HibernateException
SQLException
public Object readElement(ResultSet rs, Object owner, String[] columnAliases, SessionImplementor session) throws HibernateException, SQLException
HibernateException
SQLException
public Object readIndex(ResultSet rs, String[] columnAliases, SessionImplementor session) throws HibernateException, SQLException
HibernateException
SQLException
public Object readIdentifier(ResultSet rs, String columnAlias, SessionImplementor session) throws HibernateException, SQLException
HibernateException
SQLException
public boolean isPrimitiveArray()
public boolean isArray()
public boolean isOneToMany()
public boolean isManyToMany()
public String getManyToManyFilterFragment(String alias, Map enabledFilters)
public boolean hasIndex()
public boolean isLazy()
public boolean isInverse()
public void remove(Serializable id, SessionImplementor session) throws HibernateException
HibernateException
public void recreate(PersistentCollection collection, Serializable key, SessionImplementor session) throws HibernateException
HibernateException
public void deleteRows(PersistentCollection collection, Serializable key, SessionImplementor session) throws HibernateException
HibernateException
public void updateRows(PersistentCollection collection, Serializable key, SessionImplementor session) throws HibernateException
HibernateException
public void insertRows(PersistentCollection collection, Serializable key, SessionImplementor session) throws HibernateException
HibernateException
public String getRole()
public EntityPersister getOwnerEntityPersister()
public IdentifierGenerator getIdentifierGenerator()
public Type getIdentifierType()
public boolean hasOrphanDelete()
public boolean hasOrdering()
public boolean hasManyToManyOrdering()
public Serializable[] getCollectionSpaces()
public CollectionMetadata getCollectionMetadata()
public boolean isCascadeDeleteEnabled()
public boolean isVersioned()
public boolean isMutable()
public String getNodeName()
public String getElementNodeName()
public String getIndexNodeName()
public void postInstantiate() throws MappingException
MappingException
public SessionFactoryImplementor getFactory()
public boolean isAffectedByEnabledFilters(SessionImplementor session)
public String[] getKeyColumnAliases(String suffix)
suffix
- The suffix to use in the key column alias generation.
public String[] getIndexColumnAliases(String suffix)
suffix
- The suffix to use in the index column alias generation.
public String[] getElementColumnAliases(String suffix)
suffix
- The suffix to use in the element column alias generation.
public String getIdentifierColumnAlias(String suffix)
suffix
- The suffix to use in the key column alias generation.
public boolean isExtraLazy()
public int getSize(Serializable key, SessionImplementor session)
public boolean indexExists(Serializable key, Object index, SessionImplementor session)
public boolean elementExists(Serializable key, Object element, SessionImplementor session)
public Object getElementByIndex(Serializable key, Object index, SessionImplementor session, Object owner)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |