|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines the internal contract between the Session and other parts of Hibernate such as implementors of Type or ClassPersister.
the interface to the application
,
the actual implementation
Method Summary | |
void |
addArrayHolder(ArrayHolder holder)
Register a PersistentCollection object for an array |
void |
addNonExist(Key key)
|
void |
addUninitializedEntity(Key key,
Object object,
LockMode lockMode)
Add an uninitialized instance of an entity class, as a placeholder to ensure object identity. |
void |
afterLoad()
|
void |
afterTransactionCompletion(boolean successful)
Notify the session that the transaction completed, so we no longer own the old locks. |
void |
beforeLoad()
|
Object |
copy(Object object,
Map copiedAlready)
|
void |
endLoadingCollections(CollectionPersister persister,
Object resultSetId)
|
List |
filter(Object collection,
String filter,
QueryParameters queryParameters)
Execute a filter |
List |
find(String query,
QueryParameters queryParameters)
Execute a find() query |
List |
findBySQL(String sqlQuery,
String[] aliases,
Class[] classes,
QueryParameters queryParameters,
Collection querySpaces)
Execute an SQL Query |
ArrayHolder |
getArrayHolder(Object array)
Get the PersistentCollection object for an array |
Batcher |
getBatcher()
Get the prepared statement Batcher for this session |
Serializable[] |
getClassBatch(Class clazz,
Serializable id,
int batchSize)
Get a batch of unloaded identifiers for this class |
Object |
getCollection(String role,
Serializable id,
Object owner)
|
Serializable[] |
getCollectionBatch(CollectionPersister collectionPersister,
Serializable id,
int batchSize)
Get a batch of uninitialized collection keys for this role |
Object |
getCollectionOwner(Serializable key,
CollectionPersister collectionPersister)
|
Object |
getEntity(Key key)
Get the entity instance associated with the given Key |
Serializable |
getEntityIdentifier(Object obj)
Return the identifier of the persistent object, or null if transient |
Serializable |
getEntityIdentifierIfNotUnsaved(Object object)
Return the identifier of the persistent or transient object, or throw an exception if the instance is "unsaved" |
SessionFactoryImplementor |
getFactory()
Get the creating SessionFactoryImplementor |
Serializable |
getLoadedCollectionKey(PersistentCollection collection)
Get the pre-flush identifier of the collection |
PersistentCollection |
getLoadingCollection(CollectionPersister persister,
Serializable id,
Object resultSetId)
|
LockMode |
getLockMode(Object object)
Get the lock mode of the entity |
Collection |
getOrphans(PersistentCollection coll)
Get the collection orphans (entities which were removed from the collection) |
ClassPersister |
getPersister(Object object)
Get the ClassPersister for an object |
Serializable |
getSnapshot(PersistentCollection collection)
Get the snapshot of the pre-flush collection state |
long |
getTimestamp()
System time before the start of the transaction |
Object |
getVersion(Object entity)
Get the current versioon of the entity |
Object |
immediateLoad(Class persistentClass,
Serializable id)
Load an instance immediately. |
void |
initializeCollection(PersistentCollection collection,
boolean writing)
Initialize the collection (if not already initialized) |
void |
initializeEntity(Object object)
Perform the second step of 2-phase load. |
void |
initializeNonLazyCollections()
|
Object |
instantiate(Class clazz,
Serializable id)
Instantiate the entity class, initializing with the given identifier |
Object |
internalLoad(Class persistentClass,
Serializable id)
Load an instance without checking if it was deleted. |
Object |
internalLoadOneToOne(Class persistentClass,
Serializable id)
Load an instance without checking if it was deleted. |
boolean |
isInverseCollection(PersistentCollection collection)
Is this the "inverse" end of a bidirectional association? |
boolean |
isSaved(Object object)
Was this object already saved to the database? |
Iterator |
iterate(String query,
QueryParameters queryParameters)
Execute an iterate() query |
Iterator |
iterateFilter(Object collection,
String filter,
QueryParameters queryParameters)
Iterate a filter |
Object |
loadByUniqueKey(Class persistentClass,
String uniqueKeyPropertyName,
Serializable id)
Load an instance by a unique key that is not the primary key. |
void |
postDelete(Object object)
After actually deleting a row, record the fact that the instance no longer exists on the database (needed for identity-column key generation) |
void |
postHydrate(ClassPersister persister,
Serializable id,
Object[] values,
Object object,
LockMode lockMode)
Register the "hydrated" state of an entity instance, after the first step of 2-phase loading |
void |
postInsert(Object object)
After actually inserting a row, record the fact that the instance exists on the database (needed for identity-column key generation) |
void |
postUpdate(Object object,
Object[] updatedState,
Object nextVersion)
After actually updating a row, record the fact that the database state has been updated |
Object |
proxyFor(ClassPersister persister,
Key key,
Object impl)
Return the existing proxy associated with the given Key, or the second argument (the entity associated with the key) if no proxy exists. |
Object |
proxyFor(Object impl)
Return the existing proxy associated with the given Key, or the second argument (the entity associated with the key) if no proxy exists. |
void |
scheduleBatchLoad(Class clazz,
Serializable id)
Register the entity as batch loadable, if enabled |
ScrollableResults |
scroll(String query,
QueryParameters queryParameters)
Execute a scroll() query |
void |
setLockMode(Object entity,
LockMode lockMode)
Set the lock mode of the entity to the given lock mode |
Methods inherited from interface net.sf.hibernate.Session |
beginTransaction, cancelQuery, clear, close, connection, contains, createCriteria, createFilter, createQuery, createSQLQuery, createSQLQuery, delete, delete, delete, delete, disconnect, evict, filter, filter, filter, find, find, find, flush, get, get, getCurrentLockMode, getFlushMode, getIdentifier, getNamedQuery, getSessionFactory, isConnected, isDirty, isOpen, iterate, iterate, iterate, load, load, load, lock, reconnect, reconnect, refresh, refresh, replicate, save, save, saveOrUpdate, saveOrUpdateCopy, saveOrUpdateCopy, setFlushMode, update, update |
Method Detail |
public Serializable getLoadedCollectionKey(PersistentCollection collection)
public Serializable getSnapshot(PersistentCollection collection)
public ArrayHolder getArrayHolder(Object array)
public void addArrayHolder(ArrayHolder holder)
public void initializeCollection(PersistentCollection collection, boolean writing) throws HibernateException
HibernateException
public boolean isInverseCollection(PersistentCollection collection)
public PersistentCollection getLoadingCollection(CollectionPersister persister, Serializable id, Object resultSetId) throws HibernateException
HibernateException
public void endLoadingCollections(CollectionPersister persister, Object resultSetId) throws HibernateException
HibernateException
public void afterLoad()
public void beforeLoad()
public void initializeNonLazyCollections() throws HibernateException
HibernateException
public Object getCollection(String role, Serializable id, Object owner) throws HibernateException
HibernateException
public Object internalLoad(Class persistentClass, Serializable id) throws HibernateException
HibernateException
public Object internalLoadOneToOne(Class persistentClass, Serializable id) throws HibernateException
HibernateException
public Object immediateLoad(Class persistentClass, Serializable id) throws HibernateException
HibernateException
public Object loadByUniqueKey(Class persistentClass, String uniqueKeyPropertyName, Serializable id) throws HibernateException
HibernateException
public long getTimestamp()
public SessionFactoryImplementor getFactory()
public Batcher getBatcher()
public void postInsert(Object object)
public void postDelete(Object object)
public void postUpdate(Object object, Object[] updatedState, Object nextVersion) throws HibernateException
HibernateException
public List find(String query, QueryParameters queryParameters) throws HibernateException
HibernateException
public Iterator iterate(String query, QueryParameters queryParameters) throws HibernateException
HibernateException
public ScrollableResults scroll(String query, QueryParameters queryParameters) throws HibernateException
HibernateException
public List filter(Object collection, String filter, QueryParameters queryParameters) throws HibernateException
HibernateException
public Iterator iterateFilter(Object collection, String filter, QueryParameters queryParameters) throws HibernateException
HibernateException
public ClassPersister getPersister(Object object) throws MappingException
MappingException
public void addUninitializedEntity(Key key, Object object, LockMode lockMode)
public void postHydrate(ClassPersister persister, Serializable id, Object[] values, Object object, LockMode lockMode) throws HibernateException
HibernateException
public void initializeEntity(Object object) throws HibernateException
HibernateException
public Object getEntity(Key key)
public Object proxyFor(ClassPersister persister, Key key, Object impl) throws HibernateException
HibernateException
public Object proxyFor(Object impl) throws HibernateException
HibernateException
public void afterTransactionCompletion(boolean successful)
public Serializable getEntityIdentifier(Object obj)
public Serializable getEntityIdentifierIfNotUnsaved(Object object) throws HibernateException
HibernateException
public boolean isSaved(Object object) throws HibernateException
HibernateException
public Object instantiate(Class clazz, Serializable id) throws HibernateException
HibernateException
public void setLockMode(Object entity, LockMode lockMode)
public Object getVersion(Object entity)
public LockMode getLockMode(Object object)
public Collection getOrphans(PersistentCollection coll) throws HibernateException
HibernateException
public Serializable[] getCollectionBatch(CollectionPersister collectionPersister, Serializable id, int batchSize)
collectionPersister
- the collection roleid
- a key that must be includedbatchSize
- the maximum number of keys to return
public Serializable[] getClassBatch(Class clazz, Serializable id, int batchSize)
clazz
- the persistent classid
- an identifier that must be includedbatchSize
- the maximum number of keys to return
public void scheduleBatchLoad(Class clazz, Serializable id) throws MappingException
MappingException
public List findBySQL(String sqlQuery, String[] aliases, Class[] classes, QueryParameters queryParameters, Collection querySpaces) throws HibernateException
HibernateException
public void addNonExist(Key key)
public Object copy(Object object, Map copiedAlready) throws HibernateException
HibernateException
public Object getCollectionOwner(Serializable key, CollectionPersister collectionPersister) throws MappingException
MappingException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |