|
|||||||||||
| 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
HibernateExceptionpublic void setFlushMode(FlushMode flushMode)
Session
setFlushMode in interface SessionflushMode - the FlushModeFlushModepublic FlushMode getFlushMode()
Session
getFlushMode in interface Sessionpublic Connection connection() throws HibernateException
Session
connection in interface SessionHibernateException - if the Session is disconnectedpublic Connection disconnect() throws HibernateException
Session
disconnect in interface SessionHibernateException - if the Session is disconnectedSession.reconnect()
public void reconnect()
throws HibernateException
Session
HibernateExceptionSession.disconnect()public void reconnect(Connection connection) throws HibernateException
Session
connection - a JDBC connection
HibernateException - if the Session is connectedSession.disconnect()public Connection close() throws HibernateException
Session
HibernateExceptionpublic boolean isOpen()
Session
public 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
theClass - 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
theClass - 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
object - 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
object - a transient instance of a persistent class
HibernateExceptionSession.save(Object)public void save(Object object, Serializable id) throws HibernateException
Session
object - 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
object - a transient instance containing updated state
HibernateExceptionSession.update(Object)public void update(Object object, Serializable id) throws HibernateException
Session
object - a transient instance containing updated stateid - identifier of persistent instance
HibernateExceptionSession.update(Object, Serializable)public void delete(Object object) throws HibernateException
Session
object - the instance to be removed
HibernateExceptionpublic List find(String query) throws HibernateException
Session
query - a query expressed in Hibernate's query language
HibernateExceptionpublic List find(String query, Object value, Type type) throws HibernateException
Session
query - 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 instancespublic List find(String query, Object[] values, Type[] types) throws HibernateException
Session
query - 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 instancespublic Iterator iterate(String query) throws HibernateException
Session
query - the query string
HibernateExceptionpublic Iterator iterate(String query, Object value, Type type) throws HibernateException
Session
query - the query stringvalue - a value to be witten to a "?" placeholder in the query stringtype - the hibernate type of value
HibernateExceptionpublic Iterator iterate(String query, Object[] values, Type[] types) throws HibernateException
Session
query - the query stringvalues - a list of values to be written to "?" placeholders in the querytypes - a list of Hibernate types of the values
HibernateExceptionpublic Collection filter(Object collection, String filter) throws HibernateException
Session
collection - a persistent collection to filterfilter - a filter query string
HibernateExceptionpublic Collection filter(Object collection, String filter, Object value, Type type) throws HibernateException
Session
collection - 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
HibernateExceptionpublic Collection filter(Object collection, String filter, Object[] values, Type[] types) throws HibernateException
Session
collection - 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
HibernateExceptionpublic int delete(String query) throws HibernateException
Session
query - the query string
HibernateExceptionpublic int delete(String query, Object value, Type type) throws HibernateException
Session
query - the query stringvalue - a value to be witten to a "?" placeholder in the query string.type - the hibernate type of value.
HibernateExceptionpublic int delete(String query, Object[] values, Type[] types) throws HibernateException
Session
query - the query stringvalues - a list of values to be written to "?" placeholders in the query.types - a list of Hibernate types of the values
HibernateExceptionpublic void lock(Object object, LockMode lockMode) throws HibernateException
Session
object - a persistent or transient instancelockMode - the lock level
HibernateExceptionpublic void refresh(Object object) throws HibernateException
Session
object - a persistent or transient instance
HibernateExceptionpublic LockMode getCurrentLockMode(Object object) throws HibernateException
Session
getCurrentLockMode in interface Sessionobject - a persistent instance
HibernateExceptionpublic Transaction beginTransaction() throws HibernateException
Session
beginTransaction in interface SessionHibernateExceptionTransactionpublic Query createQuery(String queryString) throws HibernateException
Session
createQuery in interface SessionqueryString - a Hibernate query
HibernateExceptionpublic Query createFilter(Object collection, String queryString) throws HibernateException
Session
createFilter in interface Sessioncollection - a persistent collectionqueryString - a Hibernate query
HibernateExceptionpublic 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
object - a persistent or transient instancelockMode - the lock mode to use
HibernateExceptionpublic boolean contains(Object object)
Session
object - an instance of a persistent class
public void evict(Object object) throws HibernateException
Session
object - a persistent instance
HibernateExceptionpublic 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 classpublic 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
public Object get(Class clazz, Serializable id, LockMode lockMode) throws HibernateException
Session
clazz - a persistent classid - an identifierlockMode - the lock mode
HibernateExceptionpublic Object get(Class clazz, Serializable id) throws HibernateException
Session
clazz - a persistent classid - an identifier
HibernateExceptionpublic void replicate(Object object, ReplicationMode mode) throws HibernateException
Session
object - a transient instance of a persistent class
HibernateExceptionpublic SessionFactory getSessionFactory()
Session
getSessionFactory in interface SessionSessionFactory
public void cancelQuery()
throws HibernateException
Session
cancelQuery in interface SessionHibernateExceptionpublic Object saveOrUpdateCopy(Object object) throws HibernateException
Session
saveOrUpdateCopy in interface Sessionobject - a transient instance with state to be copied
HibernateExceptionpublic 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
HibernateException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||