Example usage for Java org.hibernate Session fields, constructors, methods, implement or subclass
The text is from its open source code.
LockRequest | buildLockRequest(LockOptions lockOptions) Build a LockRequest that specifies the LockMode, pessimistic lock timeout and lock scope. |
IdentifierLoadAccess | byId(String entityName) Create an IdentifierLoadAccess instance to retrieve the specified entity type by primary key. |
IdentifierLoadAccess | byId(Class Create an IdentifierLoadAccess instance to retrieve the specified entity by primary key. |
NaturalIdLoadAccess | byNaturalId(String entityName) Create a NaturalIdLoadAccess instance to retrieve the specified entity by its natural id. |
NaturalIdLoadAccess | byNaturalId(Class Create a NaturalIdLoadAccess instance to retrieve the specified entity by its natural id. |
SimpleNaturalIdLoadAccess | bySimpleNaturalId(String entityName) Create a SimpleNaturalIdLoadAccess instance to retrieve the specified entity by its natural id. |
SimpleNaturalIdLoadAccess | bySimpleNaturalId(Class Create a SimpleNaturalIdLoadAccess instance to retrieve the specified entity by its simple (single attribute) natural id. |
void | clear() Completely clear the session. |
org.hibernate.Query | createFilter(Object collection, String queryString) Create a Query instance for the given collection and filter string. |
org.hibernate.query.Query | createNamedQuery(String name, Class |
Query | createNamedQuery(String name) The JPA-defined named query creation method. |
NativeQuery | createNativeQuery(String sqlString) Create a NativeQuery instance for the given native (SQL) query |
org.hibernate.query.Query | createQuery(CriteriaQuery |
org.hibernate.query.Query | createQuery(CriteriaUpdate updateQuery) |
org.hibernate.query.Query | createQuery(CriteriaDelete deleteQuery) |
org.hibernate.query.Query | createQuery(String queryString, Class |
NativeQuery | createSQLQuery(String queryString) |
void | delete(Object object) Remove a persistent instance from the datastore. |
void | delete(String entityName, Object object) Remove a persistent instance from the datastore. |
void | disableFilter(String filterName) Disable the named filter for the current session. |
Connection | disconnect() Disconnect the session from its underlying JDBC connection. |
T | doReturningWork(ReturningWork Controller for allowing users to perform JDBC related work using the Connection managed by this Session. |
void | doWork(Work work) Controller for allowing users to perform JDBC related work using the Connection managed by this Session. |
void | enableFetchProfile(String name) Enable a particular fetch profile on this session. |
Filter | enableFilter(String filterName) Enable the named filter for this current session. |
void | evict(Object object) Remove this instance from the session cache. |
void | flush() Force this session to flush. |
T | get(Class Return the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance. |
Object | get(String entityName, Serializable id) Return the persistent instance of the given named entity with the given identifier, or null if there is no such persistent instance. |
CacheMode | getCacheMode() Get the current cache mode. |
LockMode | getCurrentLockMode(Object object) Determine the current lock mode of the given object. |
Filter | getEnabledFilter(String filterName) Retrieve a currently enabled filter by name. |
String | getEntityName(Object object) Return the entity name for a persistent entity. |
FlushModeType | getFlushMode() For users of the Hibernate native APIs, we've had to rename this method as defined by Hibernate historically because the JPA contract defines a method of the same name, but returning the JPA FlushModeType rather than Hibernate's FlushMode . |
Serializable | getIdentifier(Object object) Return the identifier value of the given entity as associated with this session. |
LobHelper | getLobHelper() Retrieve this session's helper/delegate for creating LOB instances. |
org.hibernate.Query | getNamedQuery(String queryName) Create a Query instance for the named query. |
SessionFactory | getSessionFactory() Get the session factory which created this session. |
SessionStatistics | getStatistics() Get the statistics for this session. |
TypeHelper | getTypeHelper() Convenience access to the TypeHelper associated with this session's SessionFactory . |
boolean | isDirty() Does this session contain any changes which must be synchronized with the database? |
boolean | isReadOnly(Object entityOrProxy) Is the specified entity or proxy read-only? |
T | load(Class Return the persistent instance of the given entity class with the given identifier, assuming that the instance exists. |
Object | load(String entityName, Serializable id) Return the persistent instance of the given entity class with the given identifier, assuming that the instance exists. |
void | load(Object object, Serializable id) Read the persistent state associated with the given identifier into the given transient instance. |
T | load(Class Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists. |
T | load(Class Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists. |
Object | load(String entityName, 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. |
Object | load(String entityName, Serializable id, LockOptions lockOptions) Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists. |
void | lock(Object object, LockMode lockMode) Obtain the specified lock level upon the given object. |
void | lock(String entityName, Object object, LockMode lockMode) Obtain the specified lock level upon the given object. |
Object | merge(Object object) Copy the state of the given object onto the persistent object with the same identifier. |
Object | merge(String entityName, Object object) Copy the state of the given object onto the persistent object with the same identifier. |
void | persist(Object object) Make a transient instance persistent. |
void | persist(String entityName, Object object) Make a transient instance persistent. |
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(String entityName, 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 | refresh(Object object, LockOptions lockOptions) Re-read the state of the given instance from the underlying database, with the given LockMode. |
void | replicate(Object object, ReplicationMode replicationMode) Persist the state of the given detached instance, reusing the current identifier value. |
void | replicate(String entityName, Object object, ReplicationMode replicationMode) Persist the state of the given detached instance, reusing the current identifier value. |
Serializable | save(Object object) Persist the given transient instance, first assigning a generated identifier. |
Serializable | save(String entityName, Object object) Persist the given transient instance, first assigning a generated identifier. |
void | saveOrUpdate(Object object) Either #save(Object) or #update(Object) the given instance, depending upon resolution of the unsaved-value checks (see the manual for discussion of unsaved-value checking). |
void | saveOrUpdate(String entityName, Object object) Either #save(String,Object) or #update(String,Object) the given instance, depending upon resolution of the unsaved-value checks (see the manual for discussion of unsaved-value checking). |
void | setCacheMode(CacheMode cacheMode) Set the cache mode. |
void | setDefaultReadOnly(boolean readOnly) Change the default for entities and proxies loaded into this session from modifiable to read-only mode, or from modifiable to read-only mode. |
void | setFlushMode(FlushMode flushMode) Set the flush mode for this session. |
void | setHibernateFlushMode(FlushMode flushMode) Set the flush mode for this session. |
void | setReadOnly(Object entityOrProxy, boolean readOnly) Set an unmodified persistent object to read-only mode, or a read-only object to modifiable mode. |
void | update(Object object) Update the persistent instance with the identifier of the given detached instance. |
void | update(String entityName, Object object) Update the persistent instance with the identifier of the given detached instance. |