Java org.hibernate Session fields, constructors, methods, implement or subclass

Example usage for Java org.hibernate Session fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.hibernate Session.

The text is from its open source code.

Implementation

org.hibernate.Session has the following implementations.
Click this link to see all its implementation.

Method

LockRequestbuildLockRequest(LockOptions lockOptions)
Build a LockRequest that specifies the LockMode, pessimistic lock timeout and lock scope.
IdentifierLoadAccessbyId(String entityName)
Create an IdentifierLoadAccess instance to retrieve the specified entity type by primary key.
IdentifierLoadAccessbyId(Class entityClass)
Create an IdentifierLoadAccess instance to retrieve the specified entity by primary key.
NaturalIdLoadAccessbyNaturalId(String entityName)
Create a NaturalIdLoadAccess instance to retrieve the specified entity by its natural id.
NaturalIdLoadAccessbyNaturalId(Class entityClass)
Create a NaturalIdLoadAccess instance to retrieve the specified entity by its natural id.
SimpleNaturalIdLoadAccessbySimpleNaturalId(String entityName)
Create a SimpleNaturalIdLoadAccess instance to retrieve the specified entity by its natural id.
SimpleNaturalIdLoadAccessbySimpleNaturalId(Class entityClass)
Create a SimpleNaturalIdLoadAccess instance to retrieve the specified entity by its simple (single attribute) natural id.
voidclear()
Completely clear the session.
org.hibernate.QuerycreateFilter(Object collection, String queryString)
Create a Query instance for the given collection and filter string.
org.hibernate.query.QuerycreateNamedQuery(String name, Class resultType)
QuerycreateNamedQuery(String name)
The JPA-defined named query creation method.
NativeQuerycreateNativeQuery(String sqlString)
Create a NativeQuery instance for the given native (SQL) query
org.hibernate.query.QuerycreateQuery(CriteriaQuery criteriaQuery)
org.hibernate.query.QuerycreateQuery(CriteriaUpdate updateQuery)
org.hibernate.query.QuerycreateQuery(CriteriaDelete deleteQuery)
org.hibernate.query.QuerycreateQuery(String queryString, Class resultType)
NativeQuerycreateSQLQuery(String queryString)
voiddelete(Object object)
Remove a persistent instance from the datastore.
voiddelete(String entityName, Object object)
Remove a persistent instance from the datastore.
voiddisableFilter(String filterName)
Disable the named filter for the current session.
Connectiondisconnect()
Disconnect the session from its underlying JDBC connection.
TdoReturningWork(ReturningWork work)
Controller for allowing users to perform JDBC related work using the Connection managed by this Session.
voiddoWork(Work work)
Controller for allowing users to perform JDBC related work using the Connection managed by this Session.
voidenableFetchProfile(String name)
Enable a particular fetch profile on this session.
FilterenableFilter(String filterName)
Enable the named filter for this current session.
voidevict(Object object)
Remove this instance from the session cache.
voidflush()
Force this session to flush.
Tget(Class entityType, Serializable id)
Return the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance.
Objectget(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.
CacheModegetCacheMode()
Get the current cache mode.
LockModegetCurrentLockMode(Object object)
Determine the current lock mode of the given object.
FiltergetEnabledFilter(String filterName)
Retrieve a currently enabled filter by name.
StringgetEntityName(Object object)
Return the entity name for a persistent entity.
FlushModeTypegetFlushMode()

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 .

SerializablegetIdentifier(Object object)
Return the identifier value of the given entity as associated with this session.
LobHelpergetLobHelper()
Retrieve this session's helper/delegate for creating LOB instances.
org.hibernate.QuerygetNamedQuery(String queryName)
Create a Query instance for the named query.
SessionFactorygetSessionFactory()
Get the session factory which created this session.
SessionStatisticsgetStatistics()
Get the statistics for this session.
TypeHelpergetTypeHelper()
Convenience access to the TypeHelper associated with this session's SessionFactory .
booleanisDirty()
Does this session contain any changes which must be synchronized with the database?
booleanisReadOnly(Object entityOrProxy)
Is the specified entity or proxy read-only?
Tload(Class theClass, Serializable id)
Return the persistent instance of the given entity class with the given identifier, assuming that the instance exists.
Objectload(String entityName, Serializable id)
Return the persistent instance of the given entity class with the given identifier, assuming that the instance exists.
voidload(Object object, Serializable id)
Read the persistent state associated with the given identifier into the given transient instance.
Tload(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.
Tload(Class theClass, 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.
Objectload(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.
Objectload(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.
voidlock(Object object, LockMode lockMode)
Obtain the specified lock level upon the given object.
voidlock(String entityName, Object object, LockMode lockMode)
Obtain the specified lock level upon the given object.
Objectmerge(Object object)
Copy the state of the given object onto the persistent object with the same identifier.
Objectmerge(String entityName, Object object)
Copy the state of the given object onto the persistent object with the same identifier.
voidpersist(Object object)
Make a transient instance persistent.
voidpersist(String entityName, Object object)
Make a transient instance persistent.
voidreconnect(Connection connection)
Reconnect to the given JDBC connection.
voidrefresh(Object object)
Re-read the state of the given instance from the underlying database.
voidrefresh(String entityName, Object object)
Re-read the state of the given instance from the underlying database.
voidrefresh(Object object, LockMode lockMode)
Re-read the state of the given instance from the underlying database, with the given LockMode.
voidrefresh(Object object, LockOptions lockOptions)
Re-read the state of the given instance from the underlying database, with the given LockMode.
voidreplicate(Object object, ReplicationMode replicationMode)
Persist the state of the given detached instance, reusing the current identifier value.
voidreplicate(String entityName, Object object, ReplicationMode replicationMode)
Persist the state of the given detached instance, reusing the current identifier value.
Serializablesave(Object object)
Persist the given transient instance, first assigning a generated identifier.
Serializablesave(String entityName, Object object)
Persist the given transient instance, first assigning a generated identifier.
voidsaveOrUpdate(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).
voidsaveOrUpdate(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).
voidsetCacheMode(CacheMode cacheMode)
Set the cache mode.
voidsetDefaultReadOnly(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.
voidsetFlushMode(FlushMode flushMode)
Set the flush mode for this session.
voidsetHibernateFlushMode(FlushMode flushMode)
Set the flush mode for this session.
voidsetReadOnly(Object entityOrProxy, boolean readOnly)
Set an unmodified persistent object to read-only mode, or a read-only object to modifiable mode.
voidupdate(Object object)
Update the persistent instance with the identifier of the given detached instance.
voidupdate(String entityName, Object object)
Update the persistent instance with the identifier of the given detached instance.