|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sf.hibernate.collection.AbstractCollectionPersister
Base implementation of the QueryableCollection interface.
BasicCollectionPersister,
OneToManyPersister| Field Summary | |
protected int |
batchSize
|
protected String[] |
elementColumnAliases
|
protected String[] |
elementColumnNames
|
protected ClassPersister |
elementPersister
|
protected Type |
elementType
|
protected boolean |
hasIdentifier
|
protected boolean |
hasIndex
|
protected boolean |
hasWhere
|
protected String |
identifierColumnName
|
protected String[] |
indexColumnAliases
|
protected String[] |
indexColumnNames
|
protected String[] |
keyColumnAliases
|
protected String[] |
keyColumnNames
|
protected String |
qualifiedTableName
|
protected String[] |
rowSelectColumnNames
|
protected String |
sqlWhereString
|
| Constructor Summary | |
AbstractCollectionPersister(Collection collection,
Configuration cfg,
SessionFactoryImplementor factory)
|
|
| Method Summary | |
protected JDBCException |
convert(SQLException sqlException,
String message)
|
protected abstract CollectionInitializer |
createCollectionInitializer(SessionFactoryImplementor factory)
|
void |
deleteRows(PersistentCollection collection,
Serializable id,
SessionImplementor session)
Delete the persistent state of any elements that were removed from the collection |
protected abstract int |
doUpdateRows(Serializable key,
PersistentCollection collection,
SessionImplementor session)
|
int |
enableJoinedFetch()
Should we load this collection role by outerjoining? |
protected abstract String |
generateDeleteRowString()
|
protected abstract String |
generateDeleteString()
|
protected abstract String |
generateInsertRowString()
|
protected abstract String |
generateUpdateRowString()
|
CacheConcurrencyStrategy |
getCache()
Get the cache |
CollectionMetadata |
getCollectionMetadata()
|
Serializable |
getCollectionSpace()
Get the "space" that holds the persistent state |
PersistentCollectionType |
getCollectionType()
Get the associated Type |
Class |
getElementClass()
Return the element class of an array, or null otherwise |
String[] |
getElementColumnNames()
Get the names of the collection element columns (or the primary key columns in the case of a one-to-many association) |
ClassPersister |
getElementPersister()
Get the persister of the element class, if this is a collection of entities (optional operation). |
Type |
getElementType()
The collection element type |
IdentifierGenerator |
getIdentifierGenerator()
Get the surrogate key generation strategy (optional operation) |
Type |
getIdentifierType()
Get the type of the surrogate key |
String[] |
getIndexColumnNames()
Get the names of the collection index columnsm if this is an indexed collection (optional operation) |
Type |
getIndexType()
The collection index type (or null if the collection has no index) |
String[] |
getJoinKeyColumnNames()
The columns to join on. |
String[] |
getKeyColumnNames()
Get the names of the collection key columns |
Type |
getKeyType()
The collection key type |
String |
getName()
An identifying name; a class name or collection role name. |
Class |
getOwnerClass()
Get the entity class that "owns" this collection |
String |
getRole()
The name of this collection role |
protected String |
getSQLDeleteRowString()
|
protected String |
getSQLDeleteString()
|
protected String |
getSQLInsertRowString()
|
String |
getSQLOrderByString(String alias)
Get the order by SQL |
protected String |
getSQLUpdateRowString()
|
String |
getSQLWhereString(String alias)
Get the extra where clause filter SQL |
String |
getTableName()
The table to join to. |
Type |
getType()
Get the type of the thing containing the properties |
boolean |
hasCache()
Is this collection role cacheable |
boolean |
hasIndex()
Is this collection indexed? |
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 |
hasWhere()
Does this collection role have a where clause filter? |
void |
initialize(Serializable key,
SessionImplementor session)
Initialize the given collection with the given key |
void |
insertRows(PersistentCollection collection,
Serializable id,
SessionImplementor session)
Insert the persistent state of any new collection elements |
boolean |
isArray()
Is the collection an array? |
boolean |
isCollection()
Is this instance actually a CollectionPersister? |
boolean |
isInverse()
Is this collection "inverse", so state changes are not propogated to the database. |
boolean |
isLazy()
Is the collection lazily initialized? |
boolean |
isPrimitiveArray()
Is the collection a primitive array? |
Object |
readElement(ResultSet rs,
Object owner,
SessionImplementor session)
Read the element from a row of the JDBC ResultSet |
Object |
readIdentifier(ResultSet rs,
SessionImplementor session)
Read the identifier from a row of the JDBC ResultSet |
Object |
readIndex(ResultSet rs,
SessionImplementor session)
Read the index from a row of the JDBC ResultSet |
Object |
readKey(ResultSet rs,
SessionImplementor session)
Read the key from a row of the JDBC ResultSet |
void |
recreate(PersistentCollection collection,
Serializable id,
SessionImplementor session)
(Re)create the collection's persistent state |
void |
remove(Serializable id,
SessionImplementor session)
Completely remove the persistent state of the collection |
String |
selectFragment(String alias)
Generate a list of collection index, key and element columns |
String[] |
toColumns(String alias,
String propertyName)
Given a query alias and a property path, return the qualified column name |
String |
toString()
|
Type |
toType(String propertyName)
Given a component path expression, get the type of the property |
void |
updateRows(PersistentCollection collection,
Serializable id,
SessionImplementor session)
Update the persistent state of any elements that were modified |
void |
writeElement(PreparedStatement st,
Object elt,
boolean writeOrder,
SessionImplementor session)
Write the element to a JDBC PreparedStatement |
void |
writeIdentifier(PreparedStatement st,
Object idx,
boolean writeOrder,
SessionImplementor session)
Write the identifier to a JDBC PreparedStatement |
void |
writeIndex(PreparedStatement st,
Object idx,
boolean writeOrder,
SessionImplementor session)
Write the index to a JDBC PreparedStatement |
void |
writeKey(PreparedStatement st,
Serializable id,
boolean writeOrder,
SessionImplementor session)
Write the key to a JDBC PreparedStatement |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface net.sf.hibernate.persister.Joinable |
consumesAlias, fromJoinFragment, isManyToMany, selectFragment, whereJoinFragment |
| Methods inherited from interface net.sf.hibernate.collection.CollectionPersister |
isOneToMany |
| Field Detail |
protected final String sqlWhereString
protected final boolean hasWhere
protected final Type elementType
protected final String[] keyColumnNames
protected final String[] indexColumnNames
protected final String[] elementColumnNames
protected final String[] rowSelectColumnNames
protected final String[] indexColumnAliases
protected final String[] elementColumnAliases
protected final String[] keyColumnAliases
protected final String qualifiedTableName
protected final boolean hasIndex
protected final int batchSize
protected final boolean hasIdentifier
protected final String identifierColumnName
protected final ClassPersister elementPersister
| Constructor Detail |
public AbstractCollectionPersister(Collection collection, Configuration cfg, SessionFactoryImplementor factory) throws MappingException, CacheException
| Method Detail |
public void initialize(Serializable key, SessionImplementor session) throws HibernateException
CollectionPersister
initialize in interface CollectionPersisterHibernateExceptionprotected abstract CollectionInitializer createCollectionInitializer(SessionFactoryImplementor factory) throws MappingException
MappingExceptionpublic CacheConcurrencyStrategy getCache()
CollectionPersister
getCache in interface CollectionPersisterpublic boolean hasCache()
CollectionPersister
hasCache in interface CollectionPersisterpublic PersistentCollectionType getCollectionType()
CollectionPersister
getCollectionType in interface CollectionPersisterpublic String getSQLWhereString(String alias)
QueryableCollection
getSQLWhereString in interface QueryableCollectionpublic String getSQLOrderByString(String alias)
QueryableCollection
getSQLOrderByString in interface QueryableCollectionpublic int enableJoinedFetch()
QueryableCollection
enableJoinedFetch in interface QueryableCollectionpublic boolean hasOrdering()
CollectionPersister
hasOrdering in interface CollectionPersisterpublic boolean hasWhere()
QueryableCollection
hasWhere in interface QueryableCollectionprotected String getSQLDeleteString()
protected String getSQLInsertRowString()
protected String getSQLUpdateRowString()
protected String getSQLDeleteRowString()
public Type getKeyType()
CollectionMetadata
getKeyType in interface CollectionMetadatapublic Type getIndexType()
CollectionMetadata
getIndexType in interface CollectionMetadatapublic Type getElementType()
CollectionMetadata
getElementType in interface CollectionMetadatapublic Class getElementClass()
getElementClass in interface CollectionPersisterpublic Object readElement(ResultSet rs, Object owner, SessionImplementor session) throws HibernateException, SQLException
CollectionPersister
readElement in interface CollectionPersisterHibernateException
SQLExceptionpublic Object readIndex(ResultSet rs, SessionImplementor session) throws HibernateException, SQLException
CollectionPersister
readIndex in interface CollectionPersisterHibernateException
SQLExceptionpublic Object readIdentifier(ResultSet rs, SessionImplementor session) throws HibernateException, SQLException
CollectionPersister
readIdentifier in interface CollectionPersisterHibernateException
SQLExceptionpublic Object readKey(ResultSet rs, SessionImplementor session) throws HibernateException, SQLException
CollectionPersister
readKey in interface CollectionPersisterHibernateException
SQLExceptionpublic void writeElement(PreparedStatement st, Object elt, boolean writeOrder, SessionImplementor session) throws HibernateException, SQLException
CollectionPersister
writeElement in interface CollectionPersisterHibernateException
SQLExceptionpublic void writeIndex(PreparedStatement st, Object idx, boolean writeOrder, SessionImplementor session) throws HibernateException, SQLException
CollectionPersister
writeIndex in interface CollectionPersisterHibernateException
SQLExceptionpublic void writeIdentifier(PreparedStatement st, Object idx, boolean writeOrder, SessionImplementor session) throws HibernateException, SQLException
CollectionPersister
writeIdentifier in interface CollectionPersisterHibernateException
SQLExceptionpublic void writeKey(PreparedStatement st, Serializable id, boolean writeOrder, SessionImplementor session) throws HibernateException, SQLException
CollectionPersister
writeKey in interface CollectionPersisterHibernateException
SQLExceptionpublic boolean isPrimitiveArray()
CollectionMetadata
isPrimitiveArray in interface CollectionMetadatapublic boolean isArray()
CollectionMetadata
isArray in interface CollectionMetadatapublic String selectFragment(String alias)
selectFragment in interface QueryableCollectionpublic String[] getIndexColumnNames()
QueryableCollection
getIndexColumnNames in interface QueryableCollectionpublic String[] getElementColumnNames()
QueryableCollection
getElementColumnNames in interface QueryableCollectionpublic String[] getKeyColumnNames()
QueryableCollection
getKeyColumnNames in interface QueryableCollectionpublic boolean hasIndex()
CollectionMetadata
hasIndex in interface CollectionMetadatapublic boolean isLazy()
CollectionMetadata
isLazy in interface CollectionMetadatapublic boolean isInverse()
CollectionPersister
isInverse in interface CollectionPersisterpublic String getTableName()
Joinable
getTableName in interface Joinablepublic void remove(Serializable id, SessionImplementor session) throws HibernateException
CollectionPersister
remove in interface CollectionPersisterHibernateExceptionpublic void recreate(PersistentCollection collection, Serializable id, SessionImplementor session) throws HibernateException
CollectionPersister
recreate in interface CollectionPersisterHibernateExceptionpublic void deleteRows(PersistentCollection collection, Serializable id, SessionImplementor session) throws HibernateException
CollectionPersister
deleteRows in interface CollectionPersisterHibernateExceptionpublic void insertRows(PersistentCollection collection, Serializable id, SessionImplementor session) throws HibernateException
CollectionPersister
insertRows in interface CollectionPersisterHibernateExceptionpublic String getRole()
CollectionMetadata
getRole in interface CollectionMetadatapublic Class getOwnerClass()
CollectionPersister
getOwnerClass in interface CollectionPersisterpublic IdentifierGenerator getIdentifierGenerator()
CollectionPersister
getIdentifierGenerator in interface CollectionPersisterpublic Type getIdentifierType()
CollectionPersister
getIdentifierType in interface CollectionPersisterpublic boolean hasOrphanDelete()
CollectionPersister
hasOrphanDelete in interface CollectionPersisterpublic Type toType(String propertyName) throws QueryException
PropertyMapping
toType in interface PropertyMappingQueryExceptionpublic String[] toColumns(String alias, String propertyName) throws QueryException
PropertyMapping
toColumns in interface PropertyMappingQueryExceptionpublic Type getType()
PropertyMapping
getType in interface PropertyMappingpublic String[] getJoinKeyColumnNames()
Joinable
getJoinKeyColumnNames in interface Joinablepublic String getName()
Joinable
public ClassPersister getElementPersister()
QueryableCollection
getElementPersister in interface QueryableCollectionpublic boolean isCollection()
Joinable
isCollection in interface Joinablepublic Serializable getCollectionSpace()
CollectionPersister
getCollectionSpace in interface CollectionPersisterprotected abstract String generateDeleteString()
protected abstract String generateDeleteRowString()
protected abstract String generateUpdateRowString()
protected abstract String generateInsertRowString()
public void updateRows(PersistentCollection collection, Serializable id, SessionImplementor session) throws HibernateException
CollectionPersister
updateRows in interface CollectionPersisterHibernateExceptionprotected abstract int doUpdateRows(Serializable key, PersistentCollection collection, SessionImplementor session) throws HibernateException
HibernateExceptionpublic CollectionMetadata getCollectionMetadata()
getCollectionMetadata in interface CollectionPersisterprotected JDBCException convert(SQLException sqlException, String message)
public String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||