|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.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 CollectionPersister
HibernateException
protected abstract CollectionInitializer createCollectionInitializer(SessionFactoryImplementor factory) throws MappingException
MappingException
public CacheConcurrencyStrategy getCache()
CollectionPersister
getCache
in interface CollectionPersister
public boolean hasCache()
CollectionPersister
hasCache
in interface CollectionPersister
public PersistentCollectionType getCollectionType()
CollectionPersister
getCollectionType
in interface CollectionPersister
public String getSQLWhereString(String alias)
QueryableCollection
getSQLWhereString
in interface QueryableCollection
public String getSQLOrderByString(String alias)
QueryableCollection
getSQLOrderByString
in interface QueryableCollection
public int enableJoinedFetch()
QueryableCollection
enableJoinedFetch
in interface QueryableCollection
public boolean hasOrdering()
CollectionPersister
hasOrdering
in interface CollectionPersister
public boolean hasWhere()
QueryableCollection
hasWhere
in interface QueryableCollection
protected String getSQLDeleteString()
protected String getSQLInsertRowString()
protected String getSQLUpdateRowString()
protected String getSQLDeleteRowString()
public Type getKeyType()
CollectionMetadata
getKeyType
in interface CollectionMetadata
public Type getIndexType()
CollectionMetadata
getIndexType
in interface CollectionMetadata
public Type getElementType()
CollectionMetadata
getElementType
in interface CollectionMetadata
public Class getElementClass()
getElementClass
in interface CollectionPersister
public Object readElement(ResultSet rs, Object owner, SessionImplementor session) throws HibernateException, SQLException
CollectionPersister
readElement
in interface CollectionPersister
HibernateException
SQLException
public Object readIndex(ResultSet rs, SessionImplementor session) throws HibernateException, SQLException
CollectionPersister
readIndex
in interface CollectionPersister
HibernateException
SQLException
public Object readIdentifier(ResultSet rs, SessionImplementor session) throws HibernateException, SQLException
CollectionPersister
readIdentifier
in interface CollectionPersister
HibernateException
SQLException
public Object readKey(ResultSet rs, SessionImplementor session) throws HibernateException, SQLException
CollectionPersister
readKey
in interface CollectionPersister
HibernateException
SQLException
public void writeElement(PreparedStatement st, Object elt, boolean writeOrder, SessionImplementor session) throws HibernateException, SQLException
CollectionPersister
writeElement
in interface CollectionPersister
HibernateException
SQLException
public void writeIndex(PreparedStatement st, Object idx, boolean writeOrder, SessionImplementor session) throws HibernateException, SQLException
CollectionPersister
writeIndex
in interface CollectionPersister
HibernateException
SQLException
public void writeIdentifier(PreparedStatement st, Object idx, boolean writeOrder, SessionImplementor session) throws HibernateException, SQLException
CollectionPersister
writeIdentifier
in interface CollectionPersister
HibernateException
SQLException
public void writeKey(PreparedStatement st, Serializable id, boolean writeOrder, SessionImplementor session) throws HibernateException, SQLException
CollectionPersister
writeKey
in interface CollectionPersister
HibernateException
SQLException
public boolean isPrimitiveArray()
CollectionMetadata
isPrimitiveArray
in interface CollectionMetadata
public boolean isArray()
CollectionMetadata
isArray
in interface CollectionMetadata
public String selectFragment(String alias)
selectFragment
in interface QueryableCollection
public String[] getIndexColumnNames()
QueryableCollection
getIndexColumnNames
in interface QueryableCollection
public String[] getElementColumnNames()
QueryableCollection
getElementColumnNames
in interface QueryableCollection
public String[] getKeyColumnNames()
QueryableCollection
getKeyColumnNames
in interface QueryableCollection
public boolean hasIndex()
CollectionMetadata
hasIndex
in interface CollectionMetadata
public boolean isLazy()
CollectionMetadata
isLazy
in interface CollectionMetadata
public boolean isInverse()
CollectionPersister
isInverse
in interface CollectionPersister
public String getTableName()
Joinable
getTableName
in interface Joinable
public void remove(Serializable id, SessionImplementor session) throws HibernateException
CollectionPersister
remove
in interface CollectionPersister
HibernateException
public void recreate(PersistentCollection collection, Serializable id, SessionImplementor session) throws HibernateException
CollectionPersister
recreate
in interface CollectionPersister
HibernateException
public void deleteRows(PersistentCollection collection, Serializable id, SessionImplementor session) throws HibernateException
CollectionPersister
deleteRows
in interface CollectionPersister
HibernateException
public void insertRows(PersistentCollection collection, Serializable id, SessionImplementor session) throws HibernateException
CollectionPersister
insertRows
in interface CollectionPersister
HibernateException
public String getRole()
CollectionMetadata
getRole
in interface CollectionMetadata
public Class getOwnerClass()
CollectionPersister
getOwnerClass
in interface CollectionPersister
public IdentifierGenerator getIdentifierGenerator()
CollectionPersister
getIdentifierGenerator
in interface CollectionPersister
public Type getIdentifierType()
CollectionPersister
getIdentifierType
in interface CollectionPersister
public boolean hasOrphanDelete()
CollectionPersister
hasOrphanDelete
in interface CollectionPersister
public Type toType(String propertyName) throws QueryException
PropertyMapping
toType
in interface PropertyMapping
QueryException
public String[] toColumns(String alias, String propertyName) throws QueryException
PropertyMapping
toColumns
in interface PropertyMapping
QueryException
public Type getType()
PropertyMapping
getType
in interface PropertyMapping
public String[] getJoinKeyColumnNames()
Joinable
getJoinKeyColumnNames
in interface Joinable
public String getName()
Joinable
public ClassPersister getElementPersister()
QueryableCollection
getElementPersister
in interface QueryableCollection
public boolean isCollection()
Joinable
isCollection
in interface Joinable
public Serializable getCollectionSpace()
CollectionPersister
getCollectionSpace
in interface CollectionPersister
protected 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 CollectionPersister
HibernateException
protected abstract int doUpdateRows(Serializable key, PersistentCollection collection, SessionImplementor session) throws HibernateException
HibernateException
public CollectionMetadata getCollectionMetadata()
getCollectionMetadata
in interface CollectionPersister
protected 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 |