|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sf.hibernate.jca.JCASessionImpl
A logical session handle, all real work is deligated to underlying physical session represented by ManagedConnectionImpl instance.
| Constructor Summary | |
JCASessionImpl(ManagedConnectionImpl mc)
|
|
| Method Summary | |
Transaction |
beginTransaction()
Begin a unit of work and return the associated Transaction object. |
void |
cancelQuery()
Cancel execution of the current query. |
void |
clear()
Completely clear the session. |
Connection |
close()
End the Session by disconnecting from the JDBC connection and cleaning up. |
Connection |
connection()
Get the JDBC connection. |
boolean |
contains(Object object)
Check if this instance is associated with this Session. |
Criteria |
createCriteria(Class persistentClass)
Create a new Criteria instance, for the given entity class. |
Query |
createFilter(Object collection,
String queryString)
Create a new instance of Query for the given collection and filter string. |
Query |
createQuery(String queryString)
Create a new instance of Query for the given query string. |
Query |
createSQLQuery(String string,
String[] returnAliases,
Class[] returnClasses)
Create a new instance of Query for the given SQL string. |
Query |
createSQLQuery(String string,
String returnAlias,
Class returnClass)
Create a new instance of Query for the given SQL string. |
void |
delete(Object object)
Remove a persistent instance from the datastore. |
int |
delete(String query)
Delete all objects returned by the query. |
int |
delete(String query,
Object[] values,
Type[] types)
Delete all objects returned by the query. |
int |
delete(String query,
Object value,
Type type)
Delete all objects returned by the query. |
Connection |
disconnect()
Disconnect the Session from the current JDBC connection. |
void |
evict(Object object)
Remove this instance from the session cache. |
Collection |
filter(Object collection,
String filter)
Apply a filter to a persistent collection. |
Collection |
filter(Object collection,
String filter,
Object[] values,
Type[] types)
Apply a filter to a persistent collection. |
Collection |
filter(Object collection,
String filter,
Object value,
Type type)
Apply a filter to a persistent collection. |
List |
find(String query)
Execute a query. |
List |
find(String query,
Object[] values,
Type[] types)
Execute a query with bind parameters. |
List |
find(String query,
Object value,
Type type)
Execute a query with bind parameters. |
void |
flush()
Force the Session to flush. |
Object |
get(Class clazz,
Serializable id)
Return the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance. |
Object |
get(Class clazz,
Serializable id,
LockMode lockMode)
Return the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance. |
LockMode |
getCurrentLockMode(Object object)
Determine the current lock mode of the given object. |
FlushMode |
getFlushMode()
Get the current flush mode. |
Serializable |
getIdentifier(Object object)
Return the identifier of an entity instance cached by the Session, or throw an exception if the instance is transient or associated with a different Session. |
Query |
getNamedQuery(String queryName)
Obtain an instance of Query for a named query string defined in the mapping file. |
SessionFactory |
getSessionFactory()
Get the SessionFactory that created this instance. |
boolean |
isConnected()
Check if the Session is currently connected. |
boolean |
isDirty()
Does this Session contain any changes which must be synchronized with the database? Would any SQL be executed if we flushed this session? |
boolean |
isOpen()
Check if the Session is still open. |
Iterator |
iterate(String query)
Execute a query and return the results in an iterator. |
Iterator |
iterate(String query,
Object[] values,
Type[] types)
Execute a query and return the results in an iterator. |
Iterator |
iterate(String query,
Object value,
Type type)
Execute a query and return the results in an iterator. |
Object |
load(Class theClass,
Serializable id)
Return the persistent instance of the given entity class with the given identifier, assuming that the instance exists. |
Object |
load(Class theClass,
Serializable id,
LockMode lockMode)
Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists. |
void |
load(Object object,
Serializable id)
Read the persistent state associated with the given identifier into the given transient instance. |
void |
lock(Object object,
LockMode lockMode)
Obtain the specified lock level upon the given object. |
void |
reconnect()
Obtain a new JDBC connection. |
void |
reconnect(Connection connection)
Reconnect to the given JDBC connection. |
void |
refresh(Object object)
Re-read the state of the given instance from the underlying database. |
void |
refresh(Object object,
LockMode lockMode)
Re-read the state of the given instance from the underlying database, with the given LockMode. |
void |
replicate(Object object,
ReplicationMode mode)
Persist all reachable transient objects, reusing the current identifier values. |
Serializable |
save(Object object)
Persist the given transient instance, first assigning a generated identifier. |
void |
save(Object object,
Serializable id)
Persist the given transient instance, using the given identifier. |
void |
saveOrUpdate(Object object)
Either save() or update() the given instance, depending upon the value of its identifier property. |
Object |
saveOrUpdateCopy(Object object)
Copy the state of the given object onto the persistent object with the same identifier. |
Object |
saveOrUpdateCopy(Object object,
Serializable id)
Copy the state of the given object onto the persistent object with the given identifier. |
void |
setFlushMode(FlushMode flushMode)
Set the flush mode. |
void |
update(Object object)
Update the persistent instance with the identifier of the given transient instance. |
void |
update(Object object,
Serializable id)
Update the persistent state associated with the given identifier. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public JCASessionImpl(ManagedConnectionImpl mc)
| Method Detail |
public void flush()
throws HibernateException
Session
flush in interface SessionHibernateExceptionpublic void setFlushMode(FlushMode flushMode)
Session
setFlushMode in interface SessionflushMode - the FlushModeFlushModepublic FlushMode getFlushMode()
Session
getFlushMode in interface Session
public Connection connection()
throws HibernateException
Session
connection in interface SessionHibernateException - if the Session is disconnected
public Connection disconnect()
throws HibernateException
Session
disconnect in interface SessionHibernateException - if the Session is disconnectedSession.reconnect()
public void reconnect()
throws HibernateException
Session
reconnect in interface SessionHibernateExceptionSession.disconnect()
public void reconnect(Connection connection)
throws HibernateException
Session
reconnect in interface Sessionconnection - a JDBC connection
HibernateException - if the Session is connectedSession.disconnect()
public Connection close()
throws HibernateException
Session
close in interface SessionHibernateExceptionpublic boolean isOpen()
Session
isOpen in interface Sessionpublic boolean isConnected()
Session
isConnected in interface SessionSession.isConnected()
public Serializable getIdentifier(Object object)
throws HibernateException
Session
getIdentifier in interface Sessionobject - a persistent instance
HibernateException - if the Session is connectedSession.getIdentifier(Object)
public Object load(Class theClass,
Serializable id,
LockMode lockMode)
throws HibernateException
Session
load in interface SessiontheClass - a persistent classid - a valid identifier of an existing persistent instance of the classlockMode - the lock level
HibernateExceptionSession.load(Class, Serializable, LockMode)
public Object load(Class theClass,
Serializable id)
throws HibernateException
Session
load in interface SessiontheClass - a persistent classid - a valid identifier of an existing persistent instance of the class
HibernateExceptionSession.load(Class, Serializable)
public void load(Object object,
Serializable id)
throws HibernateException
Session
load in interface Sessionobject - an "empty" instance of the persistent classid - a valid identifier of an existing persistent instance of the class
HibernateExceptionSession.load(Object, Serializable)
public Serializable save(Object object)
throws HibernateException
Session
save in interface Sessionobject - a transient instance of a persistent class
HibernateExceptionSession.save(Object)
public void save(Object object,
Serializable id)
throws HibernateException
Session
save in interface Sessionobject - a transient instance of a persistent classid - an unused valid identifier
HibernateExceptionSession.save(Object, Serializable)
public void saveOrUpdate(Object object)
throws HibernateException
Session
saveOrUpdate in interface Sessionobject - a transient instance containing new or updated state
HibernateExceptionSession.saveOrUpdate(Object)
public void update(Object object)
throws HibernateException
Session
update in interface Sessionobject - a transient instance containing updated state
HibernateExceptionSession.update(Object)
public void update(Object object,
Serializable id)
throws HibernateException
Session
update in interface Sessionobject - a transient instance containing updated stateid - identifier of persistent instance
HibernateExceptionSession.update(Object, Serializable)
public void delete(Object object)
throws HibernateException
Session
delete in interface Sessionobject - the instance to be removed
HibernateException
public List find(String query)
throws HibernateException
Session
find in interface Sessionquery - a query expressed in Hibernate's query language
HibernateException
public List find(String query,
Object value,
Type type)
throws HibernateException
Session
find in interface Sessionquery - the query stringvalue - a value to be bound to a "?" placeholder (JDBC IN parameter).type - the Hibernate type of the value
HibernateExceptionfor access to Type instances
public List find(String query,
Object[] values,
Type[] types)
throws HibernateException
Session
find in interface Sessionquery - the query stringvalues - an array of values to be bound to the "?" placeholders (JDBC IN parameters).types - an array of Hibernate types of the values
HibernateExceptionfor access to Type instances
public Iterator iterate(String query)
throws HibernateException
Session
iterate in interface Sessionquery - the query string
HibernateException
public Iterator iterate(String query,
Object value,
Type type)
throws HibernateException
Session
iterate in interface Sessionquery - the query stringvalue - a value to be witten to a "?" placeholder in the query stringtype - the hibernate type of value
HibernateException
public Iterator iterate(String query,
Object[] values,
Type[] types)
throws HibernateException
Session
iterate in interface Sessionquery - the query stringvalues - a list of values to be written to "?" placeholders in the querytypes - a list of Hibernate types of the values
HibernateException
public Collection filter(Object collection,
String filter)
throws HibernateException
Session
filter in interface Sessioncollection - a persistent collection to filterfilter - a filter query string
HibernateException
public Collection filter(Object collection,
String filter,
Object value,
Type type)
throws HibernateException
Session
filter in interface Sessioncollection - a persistent collection to filterfilter - a filter query stringvalue - a value to be witten to a "?" placeholder in the query stringtype - the hibernate type of value
HibernateException
public Collection filter(Object collection,
String filter,
Object[] values,
Type[] types)
throws HibernateException
Session
filter in interface Sessioncollection - a persistent collection to filterfilter - a filter query stringvalues - a list of values to be written to "?" placeholders in the querytypes - a list of Hibernate types of the values
HibernateException
public int delete(String query)
throws HibernateException
Session
delete in interface Sessionquery - the query string
HibernateException
public int delete(String query,
Object value,
Type type)
throws HibernateException
Session
delete in interface Sessionquery - the query stringvalue - a value to be witten to a "?" placeholder in the query string.type - the hibernate type of value.
HibernateException
public int delete(String query,
Object[] values,
Type[] types)
throws HibernateException
Session
delete in interface Sessionquery - the query stringvalues - a list of values to be written to "?" placeholders in the query.types - a list of Hibernate types of the values
HibernateException
public void lock(Object object,
LockMode lockMode)
throws HibernateException
Session
lock in interface Sessionobject - a persistent or transient instancelockMode - the lock level
HibernateException
public void refresh(Object object)
throws HibernateException
Session
refresh in interface Sessionobject - a persistent or transient instance
HibernateException
public LockMode getCurrentLockMode(Object object)
throws HibernateException
Session
getCurrentLockMode in interface Sessionobject - a persistent instance
HibernateException
public Transaction beginTransaction()
throws HibernateException
Session
beginTransaction in interface SessionHibernateExceptionTransaction
public Query createQuery(String queryString)
throws HibernateException
Session
createQuery in interface SessionqueryString - a Hibernate query
HibernateException
public Query createFilter(Object collection,
String queryString)
throws HibernateException
Session
createFilter in interface Sessioncollection - a persistent collectionqueryString - a Hibernate query
HibernateException
public Query getNamedQuery(String queryName)
throws HibernateException
Session
getNamedQuery in interface SessionqueryName - the name of a query defined externally
HibernateExceptionpublic Criteria createCriteria(Class persistentClass)
Session
createCriteria in interface SessionpersistentClass -
public void refresh(Object object,
LockMode lockMode)
throws HibernateException
Session
refresh in interface Sessionobject - a persistent or transient instancelockMode - the lock mode to use
HibernateExceptionpublic boolean contains(Object object)
Session
contains in interface Sessionobject - an instance of a persistent class
public void evict(Object object)
throws HibernateException
Session
evict in interface Sessionobject - a persistent instance
HibernateException
public Query createSQLQuery(String string,
String returnAlias,
Class returnClass)
Session
createSQLQuery in interface Sessionstring - a query expressed in SQLreturnAlias - a table alias that appears inside {} in the SQL stringreturnClass - the returned persistent class
public Query createSQLQuery(String string,
String[] returnAliases,
Class[] returnClasses)
Session
createSQLQuery in interface Sessionstring - a query expressed in SQLreturnAliases - an array of table aliases that appear inside {} in the SQL stringreturnClasses - the returned persistent classespublic void clear()
Session
clear in interface Session
public Object get(Class clazz,
Serializable id,
LockMode lockMode)
throws HibernateException
Session
get in interface Sessionclazz - a persistent classid - an identifierlockMode - the lock mode
HibernateException
public Object get(Class clazz,
Serializable id)
throws HibernateException
Session
get in interface Sessionclazz - a persistent classid - an identifier
HibernateException
public void replicate(Object object,
ReplicationMode mode)
throws HibernateException
Session
replicate in interface Sessionobject - a transient instance of a persistent class
HibernateExceptionpublic SessionFactory getSessionFactory()
Session
getSessionFactory in interface SessionSessionFactory
public void cancelQuery()
throws HibernateException
Session
cancelQuery in interface SessionHibernateException
public Object saveOrUpdateCopy(Object object)
throws HibernateException
Session
saveOrUpdateCopy in interface Sessionobject - a transient instance with state to be copied
HibernateException
public Object saveOrUpdateCopy(Object object,
Serializable id)
throws HibernateException
Session
saveOrUpdateCopy in interface Sessionobject - a persistent or transient instance with state to be copiedid - the identifier of the instance to copy to
HibernateException
public boolean isDirty()
throws HibernateException
Session
isDirty in interface SessionHibernateException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||