Method Summary |
---|
protected void | applyNamedParameterToQuery(net.sf.hibernate.Query queryObject, String paramName, Object value, net.sf.hibernate.type.Type type) Apply the given name parameter to the given Query object. |
protected void | checkWriteOperationAllowed(net.sf.hibernate.Session session) Check whether write operations are allowed on the given Session. |
void | clear() Remove all objects from the Session cache, and cancel all pending saves, updates and deletes. |
void | closeIterator(Iterator it) Close an Iterator created by iterate operations immediately, instead of waiting until the session is closed or disconnected. |
boolean | contains(Object entity) Check whether the given object is in the Session cache. |
protected net.sf.hibernate.Session | createSessionProxy(net.sf.hibernate.Session session) Create a close-suppressing proxy for the given Hibernate Session. |
void | delete(Object entity) Delete the given persistent instance. |
void | delete(Object entity, net.sf.hibernate.LockMode lockMode) Delete the given persistent instance. |
int | delete(String queryString) Delete all objects returned by the query. |
int | delete(String queryString, Object[] values, net.sf.hibernate.type.Type[] types) Delete all objects returned by the query. |
int | delete(String queryString, Object value, net.sf.hibernate.type.Type type) Delete all objects returned by the query. |
void | deleteAll(Collection entities) Delete all given persistent instances. |
void | evict(Object entity) Remove the given object from the Session cache. |
Object | execute(HibernateCallback action) Execute the action specified by the given action object within a Session. |
Object | execute(HibernateCallback action, boolean exposeNativeSession) Execute the action specified by the given action object within a Session. |
List | executeFind(HibernateCallback action) Execute the specified action assuming that the result object is a List. |
List | find(String queryString) Execute a query for persistent instances. |
List | find(String queryString, Object value) Execute a query for persistent instances, binding one value to a "?" |
List | find(String queryString, Object[] values) Execute a query for persistent instances, binding a number of values to "?" |
List | find(String queryString, Object[] values, net.sf.hibernate.type.Type[] types) Execute a query for persistent instances, binding a number of values to "?" |
List | find(String queryString, Object value, net.sf.hibernate.type.Type type) Execute a query for persistent instances, binding one value to a "?" |
List | findByNamedParam(String queryString, String[] paramNames, Object[] values) Execute a query for persistent instances, binding a number of values to ":" named parameters in the query string. |
List | findByNamedParam(String queryString, String[] paramNames, Object[] values, net.sf.hibernate.type.Type[] types) Execute a query for persistent instances, binding a number of values to ":" named parameters in the query string. |
List | findByNamedParam(String queryString, String paramName, Object value) Execute a query for persistent instances, binding one value to a ":" named parameter in the query string. |
List | findByNamedParam(String queryString, String paramName, Object value, net.sf.hibernate.type.Type type) Execute a query for persistent instances, binding one value to a ":" named parameter in the query string. |
List | findByNamedQuery(String queryName) Execute a named query for persistent instances. |
List | findByNamedQuery(String queryName, Object value) Execute a named query for persistent instances, binding one value to a "?" |
List | findByNamedQuery(String queryName, Object[] values) Execute a named query for persistent instances, binding a number of values to "?" |
List | findByNamedQuery(String queryName, Object[] values, net.sf.hibernate.type.Type[] types) Execute a named query for persistent instances, binding a number of values to "?" |
List | findByNamedQuery(String queryName, Object value, net.sf.hibernate.type.Type type) Execute a named query for persistent instances, binding one value to a "?" |
List | findByNamedQueryAndNamedParam(String queryName, String[] paramNames, Object[] values) Execute a named query for persistent instances, binding a number of values to ":" named parameters in the query string. |
List | findByNamedQueryAndNamedParam(String queryName, String[] paramNames, Object[] values, net.sf.hibernate.type.Type[] types) Execute a named query for persistent instances, binding a number of values to ":" named parameters in the query string. |
List | findByNamedQueryAndNamedParam(String queryName, String paramName, Object value) Execute a named query for persistent instances, binding one value to a ":" named parameter in the query string. |
List | findByNamedQueryAndNamedParam(String queryName, String paramName, Object value, net.sf.hibernate.type.Type type) Execute a named query for persistent instances, binding one value to a ":" named parameter in the query string. |
List | findByNamedQueryAndValueBean(String queryName, Object valueBean) Execute a named query for persistent instances, binding the properties of the given bean to ":" named parameters in the query string. |
List | findByValueBean(String queryString, Object valueBean) Execute a query for persistent instances, binding the properties of the given bean to named parameters in the query string. |
void | flush() Flush all pending saves, updates and deletes to the database. |
Object | get(Class entityClass, Serializable id) Return the persistent instance of the given entity class with the given identifier, or null if not found. |
Object | get(Class entityClass, Serializable id, net.sf.hibernate.LockMode lockMode) Return the persistent instance of the given entity class with the given identifier, or null if not found. |
int | getFetchSize() Return the fetch size specified for this HibernateTemplate. |
int | getMaxResults() Return the maximum number of rows specified for this HibernateTemplate. |
String | getQueryCacheRegion() Return the name of the cache region for queries executed by this template. |
protected net.sf.hibernate.Session | getSession() Return a Session for use by this template. |
void | initialize(Object proxy) Force initialization of a Hibernate proxy or persistent collection. |
boolean | isAllowCreate() Return if a new Session should be created if no thread-bound found. |
boolean | isAlwaysUseNewSession() Return whether to always use a new Hibernate Session for this template. |
boolean | isCacheQueries() Return whether to cache all queries executed by this template. |
boolean | isCheckWriteOperations() Return whether to check that the Hibernate Session is not in read-only mode in case of write operations (save/update/delete). |
boolean | isExposeNativeSession() Return whether to expose the native Hibernate Session to HibernateCallback code, or rather a Session proxy. |
Iterator | iterate(String queryString) Execute a query for persistent instances. |
Iterator | iterate(String queryString, Object value) Execute a query for persistent instances, binding one value to a "?" |
Iterator | iterate(String queryString, Object[] values) Execute a query for persistent instances, binding a number of values to "?" |
Iterator | iterate(String queryString, Object[] values, net.sf.hibernate.type.Type[] types) Execute a query for persistent instances, binding a number of values to "?" |
Iterator | iterate(String queryString, Object value, net.sf.hibernate.type.Type type) Execute a query for persistent instances, binding one value to a "?" |
Object | load(Class entityClass, Serializable id) Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found. |
Object | load(Class entityClass, Serializable id, net.sf.hibernate.LockMode lockMode) Return the persistent instance of the given entity class with the given identifier, throwing an exception if not found. |
void | load(Object entity, Serializable id) Load the persistent instance with the given identifier into the given object, throwing an exception if not found. |
List | loadAll(Class entityClass) Return all persistent instances of the given entity class. |
void | lock(Object entity, net.sf.hibernate.LockMode lockMode) Obtain the specified lock level upon the given object, implicitly checking whether the corresponding database entry still exists (throwing an OptimisticLockingFailureException if not found). |
protected void | prepareCriteria(net.sf.hibernate.Criteria criteria) Prepare the given Criteria object, applying cache settings and/or a transaction timeout. |
protected void | prepareQuery(net.sf.hibernate.Query queryObject) Prepare the given Query object, applying cache settings and/or a transaction timeout. |
void | refresh(Object entity) Re-read the state of the given persistent instance. |
void | refresh(Object entity, net.sf.hibernate.LockMode lockMode) Re-read the state of the given persistent instance. |
void | replicate(Object entity, net.sf.hibernate.ReplicationMode replicationMode) Persist the state of the given detached instance according to the given replication mode, reusing the current identifier value. |
Serializable | save(Object entity) Persist the given transient instance. |
void | save(Object entity, Serializable id) Persist the given transient instance with the given identifier. |
void | saveOrUpdate(Object entity) Save or update the given persistent instance, according to its id (matching the configured "unsaved-value"?). |
void | saveOrUpdateAll(Collection entities) Save or update all given persistent instances, according to its id (matching the configured "unsaved-value"?). |
Object | saveOrUpdateCopy(Object entity) Save or update the contents of given persistent object, according to its id (matching the configured "unsaved-value"?). |
void | setAllowCreate(boolean allowCreate) Set if a new Session should be created when no transactional Session can be found for the current thread. |
void | setAlwaysUseNewSession(boolean alwaysUseNewSession) Set whether to always use a new Hibernate Session for this template. |
void | setCacheQueries(boolean cacheQueries) Set whether to cache all queries executed by this template. |
void | setCheckWriteOperations(boolean checkWriteOperations) Set whether to check that the Hibernate Session is not in read-only mode in case of write operations (save/update/delete). |
void | setExposeNativeSession(boolean exposeNativeSession) Set whether to expose the native Hibernate Session to HibernateCallback code. |
void | setFetchSize(int fetchSize) Set the fetch size for this HibernateTemplate. |
void | setMaxResults(int maxResults) Set the maximum number of rows for this HibernateTemplate. |
void | setQueryCacheRegion(String queryCacheRegion) Set the name of the cache region for queries executed by this template. |
void | update(Object entity) Update the given persistent instance. |
void | update(Object entity, net.sf.hibernate.LockMode lockMode) Update the given persistent instance. |