Package org.hibernate.engine.spi
Class SessionDelegatorBaseImpl
- java.lang.Object
-
- org.hibernate.engine.spi.SessionDelegatorBaseImpl
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Serializable,java.lang.AutoCloseable,EntityManager,HibernateEntityManager,LobCreationContext,SessionImplementor,SharedSessionContractImplementor,HibernateEntityManager,HibernateEntityManagerFactoryAware,HibernateEntityManagerImplementor,QueryProducer,QueryProducerImplementor,JdbcSessionOwner,TransactionCoordinatorBuilder.Options,Session,SharedSessionContract,WrapperOptions
public class SessionDelegatorBaseImpl extends java.lang.Object implements SessionImplementor
This class is meant to be extended. Wraps and delegates all methods to aSessionImplementorand aSession. This is useful for custom implementations of this API so that only some methods need to be overridden (Used by Hibernate Search).- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.jpa.spi.HibernateEntityManagerImplementor
HibernateEntityManagerImplementor.QueryOptions
-
Nested classes/interfaces inherited from interface org.hibernate.engine.jdbc.LobCreationContext
LobCreationContext.Callback<T>
-
Nested classes/interfaces inherited from interface org.hibernate.Session
Session.LockRequest
-
-
Field Summary
Fields Modifier and Type Field Description protected SessionImplementordelegate
-
Constructor Summary
Constructors Constructor Description SessionDelegatorBaseImpl(SessionImplementor delegate)SessionDelegatorBaseImpl(SessionImplementor delegate, Session session)Deprecated.(since 5.3) SessionDelegatorBaseImpl should take just one argument, the SessionImplementor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TransactionaccessTransaction()Provides access to the underlying transaction or creates a new transaction if one does not already exist or is active.voidaddEventListeners(SessionEventListener... listeners)Add one or more listeners to the SessionvoidafterScrollOperation()voidafterTransactionBegin()A after-begin callback from the coordinator to its owner.voidafterTransactionCompletion(boolean successful, boolean delayed)An after-completion callback to the owner.voidbeforeTransactionCompletion()A before-completion callback to the owner.TransactionbeginTransaction()Begin a unit of work and return the associatedTransactionobject.java.lang.StringbestGuessEntityName(java.lang.Object object)The best guess entity name for an entity not in an associationLockOptionsbuildLockOptions(LockModeType lockModeType, java.util.Map<java.lang.String,java.lang.Object> properties)Given a JPALockModeTypeand properties, build a HibernateLockOptionsSession.LockRequestbuildLockRequest(LockOptions lockOptions)Build a LockRequest that specifies the LockMode, pessimistic lock timeout and lock scope.<T> IdentifierLoadAccess<T>byId(java.lang.Class<T> entityClass)Create anIdentifierLoadAccessinstance to retrieve the specified entity by primary key.IdentifierLoadAccessbyId(java.lang.String entityName)Create anIdentifierLoadAccessinstance to retrieve the specified entity type by primary key.<T> MultiIdentifierLoadAccess<T>byMultipleIds(java.lang.Class<T> entityClass)Create aMultiIdentifierLoadAccessinstance to retrieve multiple entities at once as specified by primary key values.MultiIdentifierLoadAccessbyMultipleIds(java.lang.String entityName)Create aMultiIdentifierLoadAccessinstance to retrieve multiple entities at once as specified by primary key values.<T> NaturalIdLoadAccess<T>byNaturalId(java.lang.Class<T> entityClass)Create aNaturalIdLoadAccessinstance to retrieve the specified entity by its natural id.NaturalIdLoadAccessbyNaturalId(java.lang.String entityName)Create aNaturalIdLoadAccessinstance to retrieve the specified entity by its natural id.<T> SimpleNaturalIdLoadAccess<T>bySimpleNaturalId(java.lang.Class<T> entityClass)Create aSimpleNaturalIdLoadAccessinstance to retrieve the specified entity by its simple (single attribute) natural id.SimpleNaturalIdLoadAccessbySimpleNaturalId(java.lang.String entityName)Create aSimpleNaturalIdLoadAccessinstance to retrieve the specified entity by its natural id.voidcancelQuery()Cancel the execution of the current query.voidcheckOpen()Performs a check whether the Session is open, and if not: marks current transaction (if one) for rollback only throws an IllegalStateException (JPA defines the exception type)voidcheckOpen(boolean markForRollbackIfClosed)Performs a check whether the Session is open, and if not: ifmarkForRollbackIfClosedis true, marks current transaction (if one) for rollback only throws an IllegalStateException (JPA defines the exception type)voidcheckTransactionNeededForUpdateOperation(java.lang.String exceptionMessage)Check if an active Transaction is necessary for the update operation to be executed.voidclear()Completely clear the session.voidclose()End the session by releasing the JDBC connection and cleaning up.java.sql.Connectionconnection()booleancontains(java.lang.Object object)booleancontains(java.lang.String entityName, java.lang.Object object)Check if this entity is associated with this Session.CriteriacreateCriteria(java.lang.Class persistentClass)CreateCriteriainstance for the given class (entity or subclasses/implementors).CriteriacreateCriteria(java.lang.Class persistentClass, java.lang.String alias)CreateCriteriainstance for the given class (entity or subclasses/implementors), using a specific alias.CriteriacreateCriteria(java.lang.String entityName)CreateCriteriainstance for the given entity name.CriteriacreateCriteria(java.lang.String entityName, java.lang.String alias)CreateCriteriainstance for the given entity name, using a specific alias.<T> RootGraphImplementor<T>createEntityGraph(java.lang.Class<T> rootType)RootGraphImplementor<?>createEntityGraph(java.lang.String graphName)QuerycreateFilter(java.lang.Object collection, java.lang.String queryString)Create aQueryinstance for the given collection and filter string.QueryImplementorcreateNamedQuery(java.lang.String name)The JPA-defined named query creation method.<T> QueryImplementor<T>createNamedQuery(java.lang.String name, java.lang.Class<T> resultClass)The JPA-defined named, typed query creation method.StoredProcedureQuerycreateNamedStoredProcedureQuery(java.lang.String name)NativeQueryImplementorcreateNativeQuery(java.lang.String sqlString)Create a NativeQuery instance for the given native (SQL) queryNativeQueryImplementorcreateNativeQuery(java.lang.String sqlString, java.lang.Class resultClass)Create a NativeQuery instance for the given native (SQL) query using implicit mapping to the specified Java type.NativeQueryImplementorcreateNativeQuery(java.lang.String sqlString, java.lang.String resultSetMapping)Create a NativeQuery instance for the given native (SQL) query using implicit mapping to the specified Java type.QueryImplementorcreateQuery(java.lang.String queryString)Create aQueryinstance for the given HQL/JPQL query string.<T> QueryImplementor<T>createQuery(java.lang.String queryString, java.lang.Class<T> resultType)Create a typedQueryinstance for the given HQL/JPQL query string.<T> QueryImplementor<T>createQuery(java.lang.String jpaqlString, java.lang.Class<T> resultClass, Selection selection, HibernateEntityManagerImplementor.QueryOptions queryOptions)Used during "compiling" a JPA criteria query.QueryImplementorcreateQuery(CriteriaDelete deleteQuery)<T> QueryImplementor<T>createQuery(CriteriaQuery<T> criteriaQuery)QueryImplementorcreateQuery(CriteriaUpdate updateQuery)NativeQueryImplementorcreateSQLQuery(java.lang.String queryString)Create aNativeQueryinstance for the given SQL query string.ProcedureCallcreateStoredProcedureCall(java.lang.String procedureName)Creates a call to a stored procedure.ProcedureCallcreateStoredProcedureCall(java.lang.String procedureName, java.lang.Class... resultClasses)Creates a call to a stored procedure with specific result set entity mappings.ProcedureCallcreateStoredProcedureCall(java.lang.String procedureName, java.lang.String... resultSetMappings)Creates a call to a stored procedure with specific result set entity mappings.StoredProcedureQuerycreateStoredProcedureQuery(java.lang.String procedureName)StoredProcedureQuerycreateStoredProcedureQuery(java.lang.String procedureName, java.lang.Class... resultClasses)StoredProcedureQuerycreateStoredProcedureQuery(java.lang.String procedureName, java.lang.String... resultSetMappings)protected SessionImplementordelegate()Returns the underlying delegate.voiddelete(java.lang.Object object)Remove a persistent instance from the datastore.voiddelete(java.lang.String entityName, java.lang.Object object)Remove a persistent instance from the datastore.voiddelete(java.lang.String entityName, java.lang.Object child, boolean isCascadeDeleteEnabled, java.util.Set transientEntities)voiddetach(java.lang.Object entity)voiddisableFetchProfile(java.lang.String name)Disable a particular fetch profile on this session.voiddisableFilter(java.lang.String filterName)Disable the named filter for the current session.java.sql.Connectiondisconnect()Disconnect the session from its underlying JDBC connection.<T> TdoReturningWork(ReturningWork<T> 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(java.lang.String name)Enable a particular fetch profile on this session.FilterenableFilter(java.lang.String filterName)Enable the named filter for this current session.voidevict(java.lang.Object object)Remove this instance from the session cache.<T> Texecute(LobCreationContext.Callback<T> callback)Execute the given callback, making sure it has access to a viable JDBCConnection.intexecuteNativeUpdate(NativeSQLQuerySpecification specification, QueryParameters queryParameters)Execute a native SQL update or delete queryintexecuteUpdate(java.lang.String query, QueryParameters queryParameters)Execute a HQL update or delete query<T> Tfind(java.lang.Class<T> entityClass, java.lang.Object primaryKey)<T> Tfind(java.lang.Class<T> entityClass, java.lang.Object primaryKey, java.util.Map<java.lang.String,java.lang.Object> properties)<T> Tfind(java.lang.Class<T> entityClass, java.lang.Object primaryKey, LockModeType lockMode)<T> Tfind(java.lang.Class<T> entityClass, java.lang.Object primaryKey, LockModeType lockMode, java.util.Map<java.lang.String,java.lang.Object> properties)voidflush()Force this session to flush.voidflushBeforeTransactionCompletion()voidforceFlush(EntityEntry e)EntityKeygenerateEntityKey(java.io.Serializable id, EntityPersister persister)Hide the changing requirements of entity key creation<T> Tget(java.lang.Class<T> theClass, java.io.Serializable id)Return the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance.<T> Tget(java.lang.Class<T> theClass, java.io.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.<T> Tget(java.lang.Class<T> theClass, java.io.Serializable id, LockOptions lockOptions)Return the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance.java.lang.Objectget(java.lang.String entityName, java.io.Serializable id)Return the persistent instance of the given named entity with the given identifier, or null if there is no such persistent instance.java.lang.Objectget(java.lang.String entityName, java.io.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.java.lang.Objectget(java.lang.String entityName, java.io.Serializable id, LockOptions lockOptions)Return the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance.ActionQueuegetActionQueue()CacheModegetCacheMode()Get the current cache mode.CacheTransactionSynchronizationgetCacheTransactionSynchronization()The current CacheTransactionContext associated with the Session.java.io.SerializablegetContextEntityIdentifier(java.lang.Object object)Return the identifier of the persistent object, or null if not associated with the sessionCriteriaBuildergetCriteriaBuilder()LockModegetCurrentLockMode(java.lang.Object object)Determine the current lock mode of the given object.java.lang.ObjectgetDelegate()This is an implementation of EntityManager#getDelegate().intgetDontFlushFromFind()FiltergetEnabledFilter(java.lang.String filterName)Retrieve a currently enabled filter by name.RootGraphImplementor<?>getEntityGraph(java.lang.String graphName)<T> java.util.List<EntityGraph<? super T>>getEntityGraphs(java.lang.Class<T> entityClass)EntityManagerFactorygetEntityManagerFactory()java.lang.StringgetEntityName(java.lang.Object object)Return the entity name for a persistent entity.EntityPersistergetEntityPersister(java.lang.String entityName, java.lang.Object object)Get the EntityPersister for any instancejava.lang.ObjectgetEntityUsingInterceptor(EntityKey key)Get the entity instance associated with the given Key, calling the Interceptor if necessarySessionEventListenerManagergetEventListenerManager()ExceptionConvertergetExceptionConverter()The converter associated to a Session might be lazily initialized: only invoke this getter when there is actual need to use it.SessionFactoryImplementorgetFactory()Get the creating SessionFactoryImplementorFlushModeTypegetFlushMode()FlushModegetHibernateFlushMode()Get the current flush mode for this session.java.io.SerializablegetIdentifier(java.lang.Object object)Return the identifier value of the given entity as associated with this session.InterceptorgetInterceptor()Retrieves the interceptor currently in use by this event source.java.lang.IntegergetJdbcBatchSize()Get the Session-level JDBC batch size for the current Session.JdbcConnectionAccessgetJdbcConnectionAccess()JdbcCoordinatorgetJdbcCoordinator()JdbcServicesgetJdbcServices()JdbcSessionContextgetJdbcSessionContext()java.util.TimeZonegetJdbcTimeZone()The JDBCTimeZoneused when persisting Timestamp and DateTime properties into the database.LoadQueryInfluencersgetLoadQueryInfluencers()Get the load query influencers associated with this session.LobCreatorgetLobCreator()Obtain access to theLobCreatorLobHelpergetLobHelper()Retrieve this session's helper/delegate for creating LOB instances.LockModeTypegetLockMode(java.lang.Object entity)LockOptionsgetLockRequest(LockModeType lockModeType, java.util.Map<java.lang.String,java.lang.Object> properties)Convert from JPA 2LockModeType& properties intoLockOptionsMetamodelgetMetamodel()NativeQueryImplementorgetNamedNativeQuery(java.lang.String name)Get a NativeQuery instance for a named native SQL queryProcedureCallgetNamedProcedureCall(java.lang.String name)Gets a ProcedureCall based on a named templateQueryImplementorgetNamedQuery(java.lang.String name)Create aQueryinstance for the named query.NativeQueryImplementorgetNamedSQLQuery(java.lang.String name)Get a NativeQuery instance for a named native SQL queryPersistenceContextgetPersistenceContext()Get the persistence context for this session.PersistenceContextgetPersistenceContextInternal()This is similar toSharedSessionContractImplementor.getPersistenceContext(), with two main differences: a) this version performs better as it allows for inlining and probably better prediction b) see SessionImplSharedSessionContractImplementor.getPersistenceContext(): it does some checks on the current state of the Session.java.util.Map<java.lang.String,java.lang.Object>getProperties()<T> TgetReference(java.lang.Class<T> entityClass, java.lang.Object primaryKey)<T> TgetReference(T object)Return a reference to the persistent instance with the same identity as the given instance, which might be detached, making the assumption that the instance is still persistent in the database.SessionImplementorgetSession()Retrieve a reference to the HibernateSessionused by thisEntityManager.SessionFactoryImplementorgetSessionFactory()Get the session factory which created this session.java.util.UUIDgetSessionIdentifier()A UUID associated with each Session.SessionStatisticsgetStatistics()Get the statistics for this session.java.lang.StringgetTenantIdentifier()Obtain the tenant identifier associated with this session.longgetTimestamp()TransactiongetTransaction()Get theTransactioninstance associated with this session.TransactionCoordinatorgetTransactionCoordinator()Obtain the builder for TransactionCoordinator instanceslonggetTransactionStartTimestamp()A "timestamp" at or before the start of the current transaction.TypeHelpergetTypeHelper()Convenience access to theTypeHelperassociated with this session'sSessionFactory.java.lang.StringguessEntityName(java.lang.Object entity)The guessed entity name for an entity not in an associationjava.lang.ObjectimmediateLoad(java.lang.String entityName, java.io.Serializable id)Load an instance immediately.voidinitializeCollection(PersistentCollection collection, boolean writing)Initialize the collection (if not already initialized)java.lang.Objectinstantiate(java.lang.String entityName, java.io.Serializable id)Instantiate the entity class, initializing with the given identifierjava.lang.Objectinstantiate(EntityPersister persister, java.io.Serializable id)Instantiate the entity class of an EntityPersister, initializing with the given identifier.java.lang.ObjectinternalLoad(java.lang.String entityName, java.io.Serializable id, boolean eager, boolean nullable)Load an instance without checking if it was deleted.booleanisAutoCloseSessionEnabled()booleanisClosed()Checks whether the session is closed.booleanisConnected()Check if the session is currently connected.booleanisDefaultReadOnly()Will entities and proxies that are loaded into this session be made read-only by default? To determine the read-only/modifiable setting for a particular entity or proxy:booleanisDirty()Does this session contain any changes which must be synchronized with the database? In other words, would any DML operations be executed if we flushed this session?booleanisEventSource()booleanisFetchProfileEnabled(java.lang.String name)Is a particular fetch profile enabled on this session?booleanisFlushBeforeCompletionEnabled()booleanisJoinedToTransaction()booleanisOpen()Check if the session is still open.booleanisOpenOrWaitingForAutoClose()Checks whether the session is open or is waiting for auto-closebooleanisQueryParametersValidationEnabled()booleanisReadOnly(java.lang.Object entityOrProxy)Is the specified entity or proxy read-only? To get the default read-only/modifiable setting used for entities and proxies that are loaded into the session:booleanisTransactionInProgress()Does this Session have an active Hibernate transaction or is there a JTA transaction in progress?java.util.Iteratoriterate(java.lang.String query, QueryParameters queryParameters)Execute an iterate() queryjava.util.IteratoriterateFilter(java.lang.Object collection, java.lang.String filter, QueryParameters queryParameters)Iterate a filtervoidjoinTransaction()java.util.Listlist(java.lang.String query, QueryParameters queryParameters)Execute a find() queryjava.util.Listlist(Criteria criteria)Execute a criteria queryjava.util.Listlist(NativeSQLQuerySpecification spec, QueryParameters queryParameters)Execute a native SQL query, and return the results as a fully built list.java.util.ListlistCustomQuery(CustomQuery customQuery, QueryParameters queryParameters)Execute an SQL Queryjava.util.ListlistFilter(java.lang.Object collection, java.lang.String filter, QueryParameters queryParameters)Execute a filter<T> Tload(java.lang.Class<T> theClass, java.io.Serializable id)Return the persistent instance of the given entity class with the given identifier, assuming that the instance exists.<T> Tload(java.lang.Class<T> theClass, java.io.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.<T> Tload(java.lang.Class<T> theClass, java.io.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.voidload(java.lang.Object object, java.io.Serializable id)Read the persistent state associated with the given identifier into the given transient instance.java.lang.Objectload(java.lang.String entityName, java.io.Serializable id)Return the persistent instance of the given entity class with the given identifier, assuming that the instance exists.java.lang.Objectload(java.lang.String entityName, java.io.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.java.lang.Objectload(java.lang.String entityName, java.io.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(java.lang.Object entity, LockModeType lockMode)voidlock(java.lang.Object entity, LockModeType lockMode, java.util.Map<java.lang.String,java.lang.Object> properties)voidlock(java.lang.Object object, LockMode lockMode)Obtain the specified lock level upon the given object.voidlock(java.lang.String entityName, java.lang.Object object, LockMode lockMode)Obtain the specified lock level upon the given object.voidmarkForRollbackOnly()Marks current transaction (if one) for rollback onlyjava.lang.Objectmerge(java.lang.Object object)Copy the state of the given object onto the persistent object with the same identifier.java.lang.Objectmerge(java.lang.String entityName, java.lang.Object object)Copy the state of the given object onto the persistent object with the same identifier.voidmerge(java.lang.String entityName, java.lang.Object object, java.util.Map copiedAlready)voidpersist(java.lang.Object object)Make a transient instance persistent.voidpersist(java.lang.String entityName, java.lang.Object object)Make a transient instance persistent.voidpersist(java.lang.String entityName, java.lang.Object object, java.util.Map createdAlready)voidpersistOnFlush(java.lang.String entityName, java.lang.Object object, java.util.Map copiedAlready)voidreconnect(java.sql.Connection connection)Reconnect to the given JDBC connection.voidrefresh(java.lang.Object object)Re-read the state of the given instance from the underlying database.voidrefresh(java.lang.Object entity, java.util.Map<java.lang.String,java.lang.Object> properties)voidrefresh(java.lang.Object entity, LockModeType lockMode)voidrefresh(java.lang.Object entity, LockModeType lockMode, java.util.Map<java.lang.String,java.lang.Object> properties)voidrefresh(java.lang.Object object, LockMode lockMode)Re-read the state of the given instance from the underlying database, with the given LockMode.voidrefresh(java.lang.Object object, LockOptions lockOptions)Re-read the state of the given instance from the underlying database, with the given LockMode.voidrefresh(java.lang.String entityName, java.lang.Object object)Re-read the state of the given instance from the underlying database.voidrefresh(java.lang.String entityName, java.lang.Object object, java.util.Map refreshedAlready)voidrefresh(java.lang.String entityName, java.lang.Object object, LockOptions lockOptions)Re-read the state of the given instance from the underlying database, with the given LockMode.SqlTypeDescriptorremapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor)Allow remapping of descriptors for dealing with sql type.voidremove(java.lang.Object entity)voidremoveOrphanBeforeUpdates(java.lang.String entityName, java.lang.Object child)voidreplicate(java.lang.Object object, ReplicationMode replicationMode)Persist the state of the given detached instance, reusing the current identifier value.voidreplicate(java.lang.String entityName, java.lang.Object object, ReplicationMode replicationMode)Persist the state of the given detached instance, reusing the current identifier value.java.io.Serializablesave(java.lang.Object object)Persist the given transient instance, first assigning a generated identifier.java.io.Serializablesave(java.lang.String entityName, java.lang.Object object)Persist the given transient instance, first assigning a generated identifier.voidsaveOrUpdate(java.lang.Object object)EitherSession.save(Object)orSession.update(Object)the given instance, depending upon resolution of the unsaved-value checks (see the manual for discussion of unsaved-value checking).voidsaveOrUpdate(java.lang.String entityName, java.lang.Object object)EitherSession.save(String, Object)orSession.update(String, Object)the given instance, depending upon resolution of the unsaved-value checks (see the manual for discussion of unsaved-value checking).ScrollableResultsImplementorscroll(java.lang.String query, QueryParameters queryParameters)Execute a scroll() queryScrollableResultsImplementorscroll(Criteria criteria, ScrollMode scrollMode)Execute a criteria queryScrollableResultsImplementorscroll(NativeSQLQuerySpecification spec, QueryParameters queryParameters)Execute a native SQL query, and return the results as a scrollable result.ScrollableResultsImplementorscrollCustomQuery(CustomQuery customQuery, QueryParameters queryParameters)Execute an SQL QuerySharedSessionBuildersessionWithOptions()Obtain aSessionbuilder with the ability to grab certain information from this session.voidsetAutoClear(boolean enabled)Enable/disable automatic cache clearing from after transaction completion (for EJB3)voidsetCacheMode(CacheMode cm)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(FlushModeType flushModeType)voidsetFlushMode(FlushMode fm)Set the flush mode for this session.voidsetHibernateFlushMode(FlushMode flushMode)Set the flush mode for this session.voidsetJdbcBatchSize(java.lang.Integer jdbcBatchSize)Set the Session-level JDBC batch size.voidsetProperty(java.lang.String propertyName, java.lang.Object value)voidsetReadOnly(java.lang.Object entityOrProxy, boolean readOnly)Set an unmodified persistent object to read-only mode, or a read-only object to modifiable mode.booleanshouldAutoClose()booleanshouldAutoJoinTransaction()Indicates whether an active transaction should be automatically joined.voidstartTransactionBoundary()Callback indicating recognition of entering into a transactional context whether that is explicitly via the HibernateTransactionAPI or via registration of Hibernate's JTA Synchronization impl with a JTA Transaction<T> Tunwrap(java.lang.Class<T> cls)voidupdate(java.lang.Object object)Update the persistent instance with the identifier of the given detached instance.voidupdate(java.lang.String entityName, java.lang.Object object)Update the persistent instance with the identifier of the given detached instance.booleanuseStreamForLobBinding()Should streams be used for binding LOB values.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.engine.spi.SharedSessionContractImplementor
getConfiguredJdbcBatchSize, isEnforcingFetchGraph, setEnforcingFetchGraph
-
-
-
-
Field Detail
-
delegate
protected final SessionImplementor delegate
-
-
Constructor Detail
-
SessionDelegatorBaseImpl
@Deprecated public SessionDelegatorBaseImpl(SessionImplementor delegate, Session session)
Deprecated.(since 5.3) SessionDelegatorBaseImpl should take just one argument, the SessionImplementor. Use theSessionDelegatorBaseImpl(SessionImplementor)form instead
-
SessionDelegatorBaseImpl
public SessionDelegatorBaseImpl(SessionImplementor delegate)
-
-
Method Detail
-
delegate
protected SessionImplementor delegate()
Returns the underlying delegate. Be careful that it has a different behavior from thegetDelegate()method coming from the EntityManager interface which returns the current session.- See Also:
getDelegate()
-
execute
public <T> T execute(LobCreationContext.Callback<T> callback)
Description copied from interface:LobCreationContextExecute the given callback, making sure it has access to a viable JDBCConnection.- Specified by:
executein interfaceLobCreationContext- Type Parameters:
T- The Java type of the type of LOB being created. One ofBlob,Clob,NClob- Parameters:
callback- The callback to execute .- Returns:
- The LOB created by the callback.
-
getTenantIdentifier
public java.lang.String getTenantIdentifier()
Description copied from interface:SharedSessionContractObtain the tenant identifier associated with this session.- Specified by:
getTenantIdentifierin interfaceSharedSessionContract- Specified by:
getTenantIdentifierin interfaceSharedSessionContractImplementor- Returns:
- The tenant identifier associated with this session, or
null
-
getSessionIdentifier
public java.util.UUID getSessionIdentifier()
Description copied from interface:SharedSessionContractImplementorA UUID associated with each Session. Useful mainly for logging.- Specified by:
getSessionIdentifierin interfaceSharedSessionContractImplementor- Returns:
- The UUID
-
getJdbcConnectionAccess
public JdbcConnectionAccess getJdbcConnectionAccess()
- Specified by:
getJdbcConnectionAccessin interfaceJdbcSessionOwner
-
generateEntityKey
public EntityKey generateEntityKey(java.io.Serializable id, EntityPersister persister)
Description copied from interface:SharedSessionContractImplementorHide the changing requirements of entity key creation- Specified by:
generateEntityKeyin interfaceSharedSessionContractImplementor- Parameters:
id- The entity idpersister- The entity persister- Returns:
- The entity key
-
getInterceptor
public Interceptor getInterceptor()
Description copied from interface:SharedSessionContractImplementorRetrieves the interceptor currently in use by this event source.- Specified by:
getInterceptorin interfaceSharedSessionContractImplementor- Returns:
- The interceptor.
-
setAutoClear
public void setAutoClear(boolean enabled)
Description copied from interface:SharedSessionContractImplementorEnable/disable automatic cache clearing from after transaction completion (for EJB3)- Specified by:
setAutoClearin interfaceSharedSessionContractImplementor
-
isTransactionInProgress
public boolean isTransactionInProgress()
Description copied from interface:SharedSessionContractImplementorDoes this Session have an active Hibernate transaction or is there a JTA transaction in progress?- Specified by:
isTransactionInProgressin interfaceHibernateEntityManagerImplementor- Specified by:
isTransactionInProgressin interfaceSharedSessionContractImplementor- Returns:
- True if a transaction is considered currently in progress; false otherwise.
-
checkTransactionNeededForUpdateOperation
public void checkTransactionNeededForUpdateOperation(java.lang.String exceptionMessage)
Description copied from interface:SharedSessionContractImplementorCheck if an active Transaction is necessary for the update operation to be executed. If an active Transaction is necessary but it is not then a TransactionRequiredException is raised.- Specified by:
checkTransactionNeededForUpdateOperationin interfaceSharedSessionContractImplementor- Parameters:
exceptionMessage- the message to use for the TransactionRequiredException
-
getLockRequest
public LockOptions getLockRequest(LockModeType lockModeType, java.util.Map<java.lang.String,java.lang.Object> properties)
Description copied from interface:HibernateEntityManagerImplementorConvert from JPA 2LockModeType& properties intoLockOptions- Specified by:
getLockRequestin interfaceHibernateEntityManagerImplementor- Parameters:
lockModeType- is the requested lock typeproperties- are the lock properties- Returns:
- the LockOptions
-
buildLockOptions
public LockOptions buildLockOptions(LockModeType lockModeType, java.util.Map<java.lang.String,java.lang.Object> properties)
Description copied from interface:HibernateEntityManagerImplementorGiven a JPALockModeTypeand properties, build a HibernateLockOptions- Specified by:
buildLockOptionsin interfaceHibernateEntityManagerImplementor- Parameters:
lockModeType- the requested LockModeTypeproperties- the lock properties- Returns:
- the LockOptions
-
createQuery
public <T> QueryImplementor<T> createQuery(java.lang.String jpaqlString, java.lang.Class<T> resultClass, Selection selection, HibernateEntityManagerImplementor.QueryOptions queryOptions)
Description copied from interface:SessionImplementorUsed during "compiling" a JPA criteria query.- Specified by:
createQueryin interfaceHibernateEntityManagerImplementor- Specified by:
createQueryin interfaceSessionImplementor- Specified by:
createQueryin interfaceSharedSessionContractImplementor- Type Parameters:
T- The query type- Parameters:
jpaqlString- The criteria query rendered as a JPA QL stringresultClass- The result type (the type expected in the result list)selection- The selection(s)queryOptions- The options to use to build the query.- Returns:
- The typed query
-
initializeCollection
public void initializeCollection(PersistentCollection collection, boolean writing) throws HibernateException
Description copied from interface:SharedSessionContractImplementorInitialize the collection (if not already initialized)- Specified by:
initializeCollectionin interfaceSharedSessionContractImplementor- Throws:
HibernateException
-
internalLoad
public java.lang.Object internalLoad(java.lang.String entityName, java.io.Serializable id, boolean eager, boolean nullable) throws HibernateExceptionDescription copied from interface:SharedSessionContractImplementorLoad an instance without checking if it was deleted. When nullable is disabled this method may create a new proxy or return an existing proxy; if it does not exist, throw an exception. When nullable is enabled, the method does not create new proxies (but might return an existing proxy); if it does not exist, return null. When eager is enabled, the object is eagerly fetched- Specified by:
internalLoadin interfaceSharedSessionContractImplementor- Throws:
HibernateException
-
immediateLoad
public java.lang.Object immediateLoad(java.lang.String entityName, java.io.Serializable id) throws HibernateExceptionDescription copied from interface:SharedSessionContractImplementorLoad an instance immediately. This method is only called when lazily initializing a proxy. Do not return the proxy.- Specified by:
immediateLoadin interfaceSharedSessionContractImplementor- Throws:
HibernateException
-
getTimestamp
public long getTimestamp()
- Specified by:
getTimestampin interfaceSharedSessionContractImplementor
-
getFactory
public SessionFactoryImplementor getFactory()
Description copied from interface:SharedSessionContractImplementorGet the creating SessionFactoryImplementor- Specified by:
getFactoryin interfaceHibernateEntityManagerFactoryAware- Specified by:
getFactoryin interfaceQueryProducerImplementor- Specified by:
getFactoryin interfaceSharedSessionContractImplementor- Returns:
- The Hibernate EMF contract for this EM.
-
list
public java.util.List list(java.lang.String query, QueryParameters queryParameters) throws HibernateExceptionDescription copied from interface:SharedSessionContractImplementorExecute a find() query- Specified by:
listin interfaceSharedSessionContractImplementor- Throws:
HibernateException
-
iterate
public java.util.Iterator iterate(java.lang.String query, QueryParameters queryParameters) throws HibernateExceptionDescription copied from interface:SharedSessionContractImplementorExecute an iterate() query- Specified by:
iteratein interfaceSharedSessionContractImplementor- Throws:
HibernateException
-
scroll
public ScrollableResultsImplementor scroll(java.lang.String query, QueryParameters queryParameters) throws HibernateException
Description copied from interface:SharedSessionContractImplementorExecute a scroll() query- Specified by:
scrollin interfaceSharedSessionContractImplementor- Throws:
HibernateException
-
scroll
public ScrollableResultsImplementor scroll(Criteria criteria, ScrollMode scrollMode)
Description copied from interface:SharedSessionContractImplementorExecute a criteria query- Specified by:
scrollin interfaceSharedSessionContractImplementor
-
list
public java.util.List list(Criteria criteria)
Description copied from interface:SharedSessionContractImplementorExecute a criteria query- Specified by:
listin interfaceSharedSessionContractImplementor
-
listFilter
public java.util.List listFilter(java.lang.Object collection, java.lang.String filter, QueryParameters queryParameters) throws HibernateExceptionDescription copied from interface:SharedSessionContractImplementorExecute a filter- Specified by:
listFilterin interfaceSharedSessionContractImplementor- Throws:
HibernateException
-
iterateFilter
public java.util.Iterator iterateFilter(java.lang.Object collection, java.lang.String filter, QueryParameters queryParameters) throws HibernateExceptionDescription copied from interface:SharedSessionContractImplementorIterate a filter- Specified by:
iterateFilterin interfaceSharedSessionContractImplementor- Throws:
HibernateException
-
getEntityPersister
public EntityPersister getEntityPersister(java.lang.String entityName, java.lang.Object object) throws HibernateException
Description copied from interface:SharedSessionContractImplementorGet the EntityPersister for any instance- Specified by:
getEntityPersisterin interfaceSharedSessionContractImplementor- Parameters:
entityName- optional entity nameobject- the entity instance- Throws:
HibernateException
-
getEntityUsingInterceptor
public java.lang.Object getEntityUsingInterceptor(EntityKey key) throws HibernateException
Description copied from interface:SharedSessionContractImplementorGet the entity instance associated with the given Key, calling the Interceptor if necessary- Specified by:
getEntityUsingInterceptorin interfaceSharedSessionContractImplementor- Throws:
HibernateException
-
getContextEntityIdentifier
public java.io.Serializable getContextEntityIdentifier(java.lang.Object object)
Description copied from interface:SharedSessionContractImplementorReturn the identifier of the persistent object, or null if not associated with the session- Specified by:
getContextEntityIdentifierin interfaceSharedSessionContractImplementor
-
bestGuessEntityName
public java.lang.String bestGuessEntityName(java.lang.Object object)
Description copied from interface:SharedSessionContractImplementorThe best guess entity name for an entity not in an association- Specified by:
bestGuessEntityNamein interfaceSharedSessionContractImplementor
-
guessEntityName
public java.lang.String guessEntityName(java.lang.Object entity) throws HibernateExceptionDescription copied from interface:SharedSessionContractImplementorThe guessed entity name for an entity not in an association- Specified by:
guessEntityNamein interfaceSharedSessionContractImplementor- Throws:
HibernateException
-
instantiate
public java.lang.Object instantiate(java.lang.String entityName, java.io.Serializable id) throws HibernateExceptionDescription copied from interface:SharedSessionContractImplementorInstantiate the entity class, initializing with the given identifier- Specified by:
instantiatein interfaceSharedSessionContractImplementor- Throws:
HibernateException
-
listCustomQuery
public java.util.List listCustomQuery(CustomQuery customQuery, QueryParameters queryParameters) throws HibernateException
Description copied from interface:SharedSessionContractImplementorExecute an SQL Query- Specified by:
listCustomQueryin interfaceSharedSessionContractImplementor- Throws:
HibernateException
-
scrollCustomQuery
public ScrollableResultsImplementor scrollCustomQuery(CustomQuery customQuery, QueryParameters queryParameters) throws HibernateException
Description copied from interface:SharedSessionContractImplementorExecute an SQL Query- Specified by:
scrollCustomQueryin interfaceSharedSessionContractImplementor- Throws:
HibernateException
-
list
public java.util.List list(NativeSQLQuerySpecification spec, QueryParameters queryParameters) throws HibernateException
Description copied from interface:SharedSessionContractImplementorExecute a native SQL query, and return the results as a fully built list.- Specified by:
listin interfaceSharedSessionContractImplementor- Parameters:
spec- The specification of the native SQL query to execute.queryParameters- The parameters by which to perform the execution.- Returns:
- The result list.
- Throws:
HibernateException
-
scroll
public ScrollableResultsImplementor scroll(NativeSQLQuerySpecification spec, QueryParameters queryParameters) throws HibernateException
Description copied from interface:SharedSessionContractImplementorExecute a native SQL query, and return the results as a scrollable result.- Specified by:
scrollin interfaceSharedSessionContractImplementor- Parameters:
spec- The specification of the native SQL query to execute.queryParameters- The parameters by which to perform the execution.- Returns:
- The resulting scrollable result.
- Throws:
HibernateException
-
getDontFlushFromFind
public int getDontFlushFromFind()
- Specified by:
getDontFlushFromFindin interfaceSharedSessionContractImplementor
-
getPersistenceContext
public PersistenceContext getPersistenceContext()
Description copied from interface:SharedSessionContractImplementorGet the persistence context for this session. See alsoSharedSessionContractImplementor.getPersistenceContextInternal()for an alternative. This method is not extremely fast: if you need to access the PersistenceContext multiple times, prefer keeping a reference to it over invoking this method multiple times.- Specified by:
getPersistenceContextin interfaceSharedSessionContractImplementor
-
executeUpdate
public int executeUpdate(java.lang.String query, QueryParameters queryParameters) throws HibernateExceptionDescription copied from interface:SharedSessionContractImplementorExecute a HQL update or delete query- Specified by:
executeUpdatein interfaceSharedSessionContractImplementor- Throws:
HibernateException
-
executeNativeUpdate
public int executeNativeUpdate(NativeSQLQuerySpecification specification, QueryParameters queryParameters) throws HibernateException
Description copied from interface:SharedSessionContractImplementorExecute a native SQL update or delete query- Specified by:
executeNativeUpdatein interfaceSharedSessionContractImplementor- Throws:
HibernateException
-
getCacheMode
public CacheMode getCacheMode()
Description copied from interface:SessionGet the current cache mode.- Specified by:
getCacheModein interfaceQueryProducerImplementor- Specified by:
getCacheModein interfaceSession- Specified by:
getCacheModein interfaceSharedSessionContractImplementor- Returns:
- The current cache mode.
-
setCacheMode
public void setCacheMode(CacheMode cm)
Description copied from interface:SessionSet the cache mode. Cache mode determines the manner in which this session can interact with the second level cache.- Specified by:
setCacheModein interfaceSession- Specified by:
setCacheModein interfaceSharedSessionContractImplementor- Parameters:
cm- The new cache mode.
-
isOpen
public boolean isOpen()
Description copied from interface:SharedSessionContractCheck if the session is still open.- Specified by:
isOpenin interfaceEntityManager- Specified by:
isOpenin interfaceSharedSessionContract- Returns:
- boolean
-
isConnected
public boolean isConnected()
Description copied from interface:SharedSessionContractCheck if the session is currently connected.- Specified by:
isConnectedin interfaceSharedSessionContract- Returns:
- boolean
-
checkOpen
public void checkOpen(boolean markForRollbackIfClosed)
Description copied from interface:SharedSessionContractImplementorPerforms a check whether the Session is open, and if not:- if
markForRollbackIfClosedis true, marks current transaction (if one) for rollback only - throws an IllegalStateException (JPA defines the exception type)
- Specified by:
checkOpenin interfaceHibernateEntityManagerImplementor- Specified by:
checkOpenin interfaceSharedSessionContractImplementor- Parameters:
markForRollbackIfClosed- If the EM is closed, should the transaction (if one) be marked for rollback?
- if
-
markForRollbackOnly
public void markForRollbackOnly()
Description copied from interface:SharedSessionContractImplementorMarks current transaction (if one) for rollback only- Specified by:
markForRollbackOnlyin interfaceHibernateEntityManagerImplementor- Specified by:
markForRollbackOnlyin interfaceSharedSessionContractImplementor
-
getTransactionStartTimestamp
public long getTransactionStartTimestamp()
Description copied from interface:SharedSessionContractImplementorA "timestamp" at or before the start of the current transaction.- Specified by:
getTransactionStartTimestampin interfaceSharedSessionContractImplementor
-
getFlushMode
public FlushModeType getFlushMode()
Description copied from interface:SessionFor 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 JPAFlushModeTyperather than Hibernate'sFlushMode. For the former behavior, useSession.getHibernateFlushMode()instead.- Specified by:
getFlushModein interfaceEntityManager- Specified by:
getFlushModein interfaceSession- Specified by:
getFlushModein interfaceSharedSessionContractImplementor- Returns:
- The FlushModeType in effect for this Session.
-
setFlushMode
public void setFlushMode(FlushModeType flushModeType)
- Specified by:
setFlushModein interfaceEntityManager
-
setHibernateFlushMode
public void setHibernateFlushMode(FlushMode flushMode)
Description copied from interface:SessionSet the flush mode for this session. The flush mode determines the points at which the session is flushed. Flushing is the process of synchronizing the underlying persistent store with persistable state held in memory. For a logically "read only" session, it is reasonable to set the session's flush mode toFlushMode.MANUALat the start of the session (in order to achieve some extra performance).- Specified by:
setHibernateFlushModein interfaceSession- Specified by:
setHibernateFlushModein interfaceSharedSessionContractImplementor- Parameters:
flushMode- the new flush mode
-
getHibernateFlushMode
public FlushMode getHibernateFlushMode()
Description copied from interface:SessionGet the current flush mode for this session.- Specified by:
getHibernateFlushModein interfaceQueryProducerImplementor- Specified by:
getHibernateFlushModein interfaceSession- Specified by:
getHibernateFlushModein interfaceSharedSessionContractImplementor- Returns:
- The flush mode
-
setFlushMode
public void setFlushMode(FlushMode fm)
Description copied from interface:SessionSet the flush mode for this session. The flush mode determines the points at which the session is flushed. Flushing is the process of synchronizing the underlying persistent store with persistable state held in memory. For a logically "read only" session, it is reasonable to set the session's flush mode toFlushMode.MANUALat the start of the session (in order to achieve some extra performance).- Specified by:
setFlushModein interfaceSession- Specified by:
setFlushModein interfaceSharedSessionContractImplementor- Parameters:
fm- the new flush mode
-
lock
public void lock(java.lang.Object entity, LockModeType lockMode)- Specified by:
lockin interfaceEntityManager
-
lock
public void lock(java.lang.Object entity, LockModeType lockMode, java.util.Map<java.lang.String,java.lang.Object> properties)- Specified by:
lockin interfaceEntityManager
-
connection
public java.sql.Connection connection()
- Specified by:
connectionin interfaceSharedSessionContractImplementor
-
flush
public void flush()
Description copied from interface:SessionForce this session to flush. Must be called at the end of a unit of work, before committing the transaction and closing the session (depending onSession.setFlushMode(FlushMode),EntityTransaction.commit()calls this method). Flushing is the process of synchronizing the underlying persistent store with persistable state held in memory.- Specified by:
flushin interfaceEntityManager- Specified by:
flushin interfaceSession- Specified by:
flushin interfaceSharedSessionContractImplementor
-
isEventSource
public boolean isEventSource()
- Specified by:
isEventSourcein interfaceSharedSessionContractImplementor
-
afterScrollOperation
public void afterScrollOperation()
- Specified by:
afterScrollOperationin interfaceSharedSessionContractImplementor
-
getTransactionCoordinator
public TransactionCoordinator getTransactionCoordinator()
Description copied from interface:JdbcSessionOwnerObtain the builder for TransactionCoordinator instances- Specified by:
getTransactionCoordinatorin interfaceJdbcSessionOwner- Returns:
- The TransactionCoordinatorBuilder
-
getJdbcCoordinator
public JdbcCoordinator getJdbcCoordinator()
- Specified by:
getJdbcCoordinatorin interfaceSharedSessionContractImplementor
-
getJdbcServices
public JdbcServices getJdbcServices()
- Specified by:
getJdbcServicesin interfaceSharedSessionContractImplementor
-
getJdbcSessionContext
public JdbcSessionContext getJdbcSessionContext()
- Specified by:
getJdbcSessionContextin interfaceJdbcSessionOwner
-
isClosed
public boolean isClosed()
Description copied from interface:SharedSessionContractImplementorChecks whether the session is closed. Provided separately fromSharedSessionContract.isOpen()as this method does not attempt any JTA synchronization registration, whereasSharedSessionContract.isOpen()does; which makes this one nicer to use for most internal purposes.- Specified by:
isClosedin interfaceSharedSessionContractImplementor- Returns:
trueif the session is closed;falseotherwise.
-
checkOpen
public void checkOpen()
Description copied from interface:SharedSessionContractImplementorPerforms a check whether the Session is open, and if not:- marks current transaction (if one) for rollback only
- throws an IllegalStateException (JPA defines the exception type)
- Specified by:
checkOpenin interfaceSharedSessionContractImplementor
-
isOpenOrWaitingForAutoClose
public boolean isOpenOrWaitingForAutoClose()
Description copied from interface:SharedSessionContractImplementorChecks whether the session is open or is waiting for auto-close- Specified by:
isOpenOrWaitingForAutoClosein interfaceSharedSessionContractImplementor- Returns:
trueif the session is closed or if it's waiting for auto-close;falseotherwise.
-
shouldAutoClose
public boolean shouldAutoClose()
- Specified by:
shouldAutoClosein interfaceSharedSessionContractImplementor
-
isAutoCloseSessionEnabled
public boolean isAutoCloseSessionEnabled()
- Specified by:
isAutoCloseSessionEnabledin interfaceSharedSessionContractImplementor
-
isQueryParametersValidationEnabled
public boolean isQueryParametersValidationEnabled()
- Specified by:
isQueryParametersValidationEnabledin interfaceSharedSessionContractImplementor
-
shouldAutoJoinTransaction
public boolean shouldAutoJoinTransaction()
Description copied from interface:TransactionCoordinatorBuilder.OptionsIndicates whether an active transaction should be automatically joined. Only relevant for JTA-based TransactionCoordinator instances.- Specified by:
shouldAutoJoinTransactionin interfaceTransactionCoordinatorBuilder.Options- Returns:
trueindicates the active transaction should be auto joined;falseindicates it should not (untilTransactionCoordinator.explicitJoin()is called).
-
getLoadQueryInfluencers
public LoadQueryInfluencers getLoadQueryInfluencers()
Description copied from interface:SharedSessionContractImplementorGet the load query influencers associated with this session.- Specified by:
getLoadQueryInfluencersin interfaceSharedSessionContractImplementor- Returns:
- the load query influencers associated with this session; should never be null.
-
getExceptionConverter
public ExceptionConverter getExceptionConverter()
Description copied from interface:SharedSessionContractImplementorThe converter associated to a Session might be lazily initialized: only invoke this getter when there is actual need to use it.- Specified by:
getExceptionConverterin interfaceSharedSessionContractImplementor- Returns:
- the ExceptionConverter for this Session.
-
getPersistenceContextInternal
public PersistenceContext getPersistenceContextInternal()
Description copied from interface:SharedSessionContractImplementorThis is similar toSharedSessionContractImplementor.getPersistenceContext(), with two main differences: a) this version performs better as it allows for inlining and probably better prediction b) see SessionImplSharedSessionContractImplementor.getPersistenceContext(): it does some checks on the current state of the Session. Choose wisely: performance is important, correctness comes first.- Specified by:
getPersistenceContextInternalin interfaceSharedSessionContractImplementor- Returns:
- the PersistenceContext associated to this session.
-
getEventListenerManager
public SessionEventListenerManager getEventListenerManager()
- Specified by:
getEventListenerManagerin interfaceSharedSessionContractImplementor
-
accessTransaction
public Transaction accessTransaction()
Description copied from interface:SharedSessionContractImplementorProvides access to the underlying transaction or creates a new transaction if one does not already exist or is active. This is primarily for internal or integrator use.- Specified by:
accessTransactionin interfaceSharedSessionContractImplementor- Returns:
- the transaction
-
beginTransaction
public Transaction beginTransaction()
Description copied from interface:SharedSessionContractBegin a unit of work and return the associatedTransactionobject. If a new underlying transaction is required, begin the transaction. Otherwise continue the new work in the context of the existing underlying transaction.- Specified by:
beginTransactionin interfaceSharedSessionContract- Returns:
- a Transaction instance
- See Also:
SharedSessionContract.getTransaction()
-
getTransaction
public Transaction getTransaction()
Description copied from interface:SharedSessionContractGet theTransactioninstance associated with this session. The concrete type of the returnedTransactionobject is determined by thehibernate.transaction_factoryproperty.- Specified by:
getTransactionin interfaceEntityManager- Specified by:
getTransactionin interfaceSharedSessionContract- Returns:
- a Transaction instance
-
startTransactionBoundary
public void startTransactionBoundary()
Description copied from interface:JdbcSessionOwnerCallback indicating recognition of entering into a transactional context whether that is explicitly via the HibernateTransactionAPI or via registration of Hibernate's JTA Synchronization impl with a JTA Transaction- Specified by:
startTransactionBoundaryin interfaceJdbcSessionOwner
-
getCacheTransactionSynchronization
public CacheTransactionSynchronization getCacheTransactionSynchronization()
Description copied from interface:SharedSessionContractImplementorThe current CacheTransactionContext associated with the Session. This may returnnullwhen the Session is not currently part of a transaction.- Specified by:
getCacheTransactionSynchronizationin interfaceSharedSessionContractImplementor
-
afterTransactionBegin
public void afterTransactionBegin()
Description copied from interface:JdbcSessionOwnerA after-begin callback from the coordinator to its owner.- Specified by:
afterTransactionBeginin interfaceJdbcSessionOwner
-
beforeTransactionCompletion
public void beforeTransactionCompletion()
Description copied from interface:JdbcSessionOwnerA before-completion callback to the owner.- Specified by:
beforeTransactionCompletionin interfaceJdbcSessionOwner
-
afterTransactionCompletion
public void afterTransactionCompletion(boolean successful, boolean delayed)Description copied from interface:JdbcSessionOwnerAn after-completion callback to the owner.- Specified by:
afterTransactionCompletionin interfaceJdbcSessionOwner- Parameters:
successful- Was the transaction successful?delayed- Is this a delayed after transaction completion call (aka after a timeout)?
-
flushBeforeTransactionCompletion
public void flushBeforeTransactionCompletion()
- Specified by:
flushBeforeTransactionCompletionin interfaceJdbcSessionOwner
-
getEntityManagerFactory
public EntityManagerFactory getEntityManagerFactory()
- Specified by:
getEntityManagerFactoryin interfaceEntityManager
-
getCriteriaBuilder
public CriteriaBuilder getCriteriaBuilder()
- Specified by:
getCriteriaBuilderin interfaceEntityManager
-
getMetamodel
public Metamodel getMetamodel()
- Specified by:
getMetamodelin interfaceEntityManager
-
createEntityGraph
public <T> RootGraphImplementor<T> createEntityGraph(java.lang.Class<T> rootType)
- Specified by:
createEntityGraphin interfaceEntityManager- Specified by:
createEntityGraphin interfaceSession- Specified by:
createEntityGraphin interfaceSessionImplementor
-
createEntityGraph
public RootGraphImplementor<?> createEntityGraph(java.lang.String graphName)
- Specified by:
createEntityGraphin interfaceEntityManager- Specified by:
createEntityGraphin interfaceSession- Specified by:
createEntityGraphin interfaceSessionImplementor
-
getEntityGraph
public RootGraphImplementor<?> getEntityGraph(java.lang.String graphName)
- Specified by:
getEntityGraphin interfaceEntityManager- Specified by:
getEntityGraphin interfaceSession- Specified by:
getEntityGraphin interfaceSessionImplementor
-
getEntityGraphs
public <T> java.util.List<EntityGraph<? super T>> getEntityGraphs(java.lang.Class<T> entityClass)
- Specified by:
getEntityGraphsin interfaceEntityManager- Specified by:
getEntityGraphsin interfaceSession
-
getNamedQuery
public QueryImplementor getNamedQuery(java.lang.String name)
Description copied from interface:QueryProducerCreate aQueryinstance for the named query.- Specified by:
getNamedQueryin interfaceQueryProducer- Specified by:
getNamedQueryin interfaceQueryProducerImplementor- Specified by:
getNamedQueryin interfaceSessionImplementor- Specified by:
getNamedQueryin interfaceSharedSessionContract- Parameters:
name- the name of a pre-defined, named query- Returns:
- The Query instance for manipulation and execution
-
getNamedSQLQuery
public NativeQueryImplementor getNamedSQLQuery(java.lang.String name)
Description copied from interface:QueryProducerGet a NativeQuery instance for a named native SQL query- Specified by:
getNamedSQLQueryin interfaceQueryProducer- Specified by:
getNamedSQLQueryin interfaceQueryProducerImplementor- Specified by:
getNamedSQLQueryin interfaceSessionImplementor- Parameters:
name- The name of the pre-defined query- Returns:
- The NativeQuery instance for manipulation and execution
-
getNamedNativeQuery
public NativeQueryImplementor getNamedNativeQuery(java.lang.String name)
Description copied from interface:QueryProducerGet a NativeQuery instance for a named native SQL query- Specified by:
getNamedNativeQueryin interfaceQueryProducer- Specified by:
getNamedNativeQueryin interfaceQueryProducerImplementor- Specified by:
getNamedNativeQueryin interfaceSessionImplementor- Parameters:
name- The name of the pre-defined query- Returns:
- The NativeQuery instance for manipulation and execution
-
createQuery
public QueryImplementor createQuery(java.lang.String queryString)
Description copied from interface:QueryProducerCreate aQueryinstance for the given HQL/JPQL query string.- Specified by:
createQueryin interfaceEntityManager- Specified by:
createQueryin interfaceQueryProducer- Specified by:
createQueryin interfaceQueryProducerImplementor- Specified by:
createQueryin interfaceSessionImplementor- Specified by:
createQueryin interfaceSharedSessionContract- Parameters:
queryString- The HQL/JPQL query- Returns:
- The Query instance for manipulation and execution
- See Also:
EntityManager.createQuery(String)
-
createQuery
public <T> QueryImplementor<T> createQuery(java.lang.String queryString, java.lang.Class<T> resultType)
Description copied from interface:QueryProducerCreate a typedQueryinstance for the given HQL/JPQL query string.- Specified by:
createQueryin interfaceEntityManager- Specified by:
createQueryin interfaceQueryProducer- Specified by:
createQueryin interfaceQueryProducerImplementor- Specified by:
createQueryin interfaceSession- Specified by:
createQueryin interfaceSessionImplementor- Parameters:
queryString- The HQL/JPQL queryresultType- The type of the query result- Returns:
- The Query instance for manipulation and execution
- See Also:
EntityManager.createQuery(String,Class)
-
createQuery
public <T> QueryImplementor<T> createQuery(CriteriaQuery<T> criteriaQuery)
- Specified by:
createQueryin interfaceEntityManager- Specified by:
createQueryin interfaceQueryProducer- Specified by:
createQueryin interfaceSession- Specified by:
createQueryin interfaceSessionImplementor
-
createQuery
public QueryImplementor createQuery(CriteriaUpdate updateQuery)
- Specified by:
createQueryin interfaceEntityManager- Specified by:
createQueryin interfaceQueryProducer- Specified by:
createQueryin interfaceSession- Specified by:
createQueryin interfaceSessionImplementor
-
createQuery
public QueryImplementor createQuery(CriteriaDelete deleteQuery)
- Specified by:
createQueryin interfaceEntityManager- Specified by:
createQueryin interfaceQueryProducer- Specified by:
createQueryin interfaceSession- Specified by:
createQueryin interfaceSessionImplementor
-
createNamedQuery
public QueryImplementor createNamedQuery(java.lang.String name)
Description copied from interface:QueryProducerThe JPA-defined named query creation method. This form can represent an HQL/JPQL query or a native query.- Specified by:
createNamedQueryin interfaceEntityManager- Specified by:
createNamedQueryin interfaceQueryProducer- Specified by:
createNamedQueryin interfaceQueryProducerImplementor- Specified by:
createNamedQueryin interfaceSessionImplementor- Parameters:
name- the name of a pre-defined, named query- Returns:
- The Query instance for manipulation and execution
- See Also:
EntityManager.createNamedQuery(String)
-
createNamedQuery
public <T> QueryImplementor<T> createNamedQuery(java.lang.String name, java.lang.Class<T> resultClass)
Description copied from interface:QueryProducerThe JPA-defined named, typed query creation method. This form can only represent an HQL/JPQL query (not a native query).- Specified by:
createNamedQueryin interfaceEntityManager- Specified by:
createNamedQueryin interfaceQueryProducer- Specified by:
createNamedQueryin interfaceQueryProducerImplementor- Specified by:
createNamedQueryin interfaceSession- Specified by:
createNamedQueryin interfaceSessionImplementor- Parameters:
name- the name of a query defined in metadataresultClass- the type of the query result- Returns:
- The Query instance for manipulation and execution
- See Also:
EntityManager.createNamedQuery(String,Class)
-
createNativeQuery
public NativeQueryImplementor createNativeQuery(java.lang.String sqlString)
Description copied from interface:QueryProducerCreate a NativeQuery instance for the given native (SQL) query- Specified by:
createNativeQueryin interfaceEntityManager- Specified by:
createNativeQueryin interfaceQueryProducer- Specified by:
createNativeQueryin interfaceQueryProducerImplementor- Specified by:
createNativeQueryin interfaceSessionImplementor- Parameters:
sqlString- a native SQL query string- Returns:
- The NativeQuery instance for manipulation and execution
- See Also:
EntityManager.createNativeQuery(String)
-
createNativeQuery
public NativeQueryImplementor createNativeQuery(java.lang.String sqlString, java.lang.Class resultClass)
Description copied from interface:QueryProducerCreate a NativeQuery instance for the given native (SQL) query using implicit mapping to the specified Java type.- Specified by:
createNativeQueryin interfaceEntityManager- Specified by:
createNativeQueryin interfaceQueryProducer- Specified by:
createNativeQueryin interfaceQueryProducerImplementor- Specified by:
createNativeQueryin interfaceSessionImplementor- Parameters:
sqlString- Native (SQL) query stringresultClass- The Java entity type to map results to- Returns:
- The NativeQuery instance for manipulation and execution
- See Also:
EntityManager.createNativeQuery(String,Class)
-
createNativeQuery
public NativeQueryImplementor createNativeQuery(java.lang.String sqlString, java.lang.String resultSetMapping)
Description copied from interface:QueryProducerCreate a NativeQuery instance for the given native (SQL) query using implicit mapping to the specified Java type.- Specified by:
createNativeQueryin interfaceEntityManager- Specified by:
createNativeQueryin interfaceQueryProducer- Specified by:
createNativeQueryin interfaceQueryProducerImplementor- Specified by:
createNativeQueryin interfaceSessionImplementor- Parameters:
sqlString- Native (SQL) query stringresultSetMapping- The explicit (named) result mapping- Returns:
- The NativeQuery instance for manipulation and execution
- See Also:
EntityManager.createNativeQuery(String,Class),SqlResultSetMapping
-
createNamedStoredProcedureQuery
public StoredProcedureQuery createNamedStoredProcedureQuery(java.lang.String name)
- Specified by:
createNamedStoredProcedureQueryin interfaceEntityManager
-
createStoredProcedureQuery
public StoredProcedureQuery createStoredProcedureQuery(java.lang.String procedureName)
- Specified by:
createStoredProcedureQueryin interfaceEntityManager
-
createStoredProcedureQuery
public StoredProcedureQuery createStoredProcedureQuery(java.lang.String procedureName, java.lang.Class... resultClasses)
- Specified by:
createStoredProcedureQueryin interfaceEntityManager
-
createStoredProcedureQuery
public StoredProcedureQuery createStoredProcedureQuery(java.lang.String procedureName, java.lang.String... resultSetMappings)
- Specified by:
createStoredProcedureQueryin interfaceEntityManager
-
joinTransaction
public void joinTransaction()
- Specified by:
joinTransactionin interfaceEntityManager
-
isJoinedToTransaction
public boolean isJoinedToTransaction()
- Specified by:
isJoinedToTransactionin interfaceEntityManager
-
unwrap
public <T> T unwrap(java.lang.Class<T> cls)
- Specified by:
unwrapin interfaceEntityManager
-
getDelegate
public java.lang.Object getDelegate()
This is an implementation of EntityManager#getDelegate(). It returns the current session and not the delegate session as it is what we want. The name of the method is misleading here but, as it is part of JPA, we cannot do anything about it.To get the underlying delegate, use
delegate()instead.- Specified by:
getDelegatein interfaceEntityManager- See Also:
delegate()
-
createSQLQuery
public NativeQueryImplementor createSQLQuery(java.lang.String queryString)
Description copied from interface:SessionCreate aNativeQueryinstance for the given SQL query string.- Specified by:
createSQLQueryin interfaceQueryProducer- Specified by:
createSQLQueryin interfaceQueryProducerImplementor- Specified by:
createSQLQueryin interfaceSession- Specified by:
createSQLQueryin interfaceSessionImplementor- Parameters:
queryString- The SQL query- Returns:
- The query instance for manipulation and execution
-
getNamedProcedureCall
public ProcedureCall getNamedProcedureCall(java.lang.String name)
Description copied from interface:SharedSessionContractGets a ProcedureCall based on a named template- Specified by:
getNamedProcedureCallin interfaceSharedSessionContract- Parameters:
name- The name given to the template- Returns:
- The ProcedureCall
- See Also:
NamedStoredProcedureQuery
-
createStoredProcedureCall
public ProcedureCall createStoredProcedureCall(java.lang.String procedureName)
Description copied from interface:SharedSessionContractCreates a call to a stored procedure.- Specified by:
createStoredProcedureCallin interfaceSharedSessionContract- Parameters:
procedureName- The name of the procedure.- Returns:
- The representation of the procedure call.
-
createStoredProcedureCall
public ProcedureCall createStoredProcedureCall(java.lang.String procedureName, java.lang.Class... resultClasses)
Description copied from interface:SharedSessionContractCreates a call to a stored procedure with specific result set entity mappings. Each class named is considered a "root return".- Specified by:
createStoredProcedureCallin interfaceSharedSessionContract- Parameters:
procedureName- The name of the procedure.resultClasses- The entity(s) to map the result on to.- Returns:
- The representation of the procedure call.
-
createStoredProcedureCall
public ProcedureCall createStoredProcedureCall(java.lang.String procedureName, java.lang.String... resultSetMappings)
Description copied from interface:SharedSessionContractCreates a call to a stored procedure with specific result set entity mappings.- Specified by:
createStoredProcedureCallin interfaceSharedSessionContract- Parameters:
procedureName- The name of the procedure.resultSetMappings- The explicit result set mapping(s) to use for mapping the results- Returns:
- The representation of the procedure call.
-
createCriteria
public Criteria createCriteria(java.lang.Class persistentClass)
Description copied from interface:SharedSessionContractCreateCriteriainstance for the given class (entity or subclasses/implementors).- Specified by:
createCriteriain interfaceSharedSessionContract- Parameters:
persistentClass- The class, which is an entity, or has entity subclasses/implementors- Returns:
- The criteria instance for manipulation and execution
-
createCriteria
public Criteria createCriteria(java.lang.Class persistentClass, java.lang.String alias)
Description copied from interface:SharedSessionContractCreateCriteriainstance for the given class (entity or subclasses/implementors), using a specific alias.- Specified by:
createCriteriain interfaceSharedSessionContract- Parameters:
persistentClass- The class, which is an entity, or has entity subclasses/implementorsalias- The alias to use- Returns:
- The criteria instance for manipulation and execution
-
createCriteria
public Criteria createCriteria(java.lang.String entityName)
Description copied from interface:SharedSessionContractCreateCriteriainstance for the given entity name.- Specified by:
createCriteriain interfaceSharedSessionContract- Parameters:
entityName- The entity name- Returns:
- The criteria instance for manipulation and execution
-
createCriteria
public Criteria createCriteria(java.lang.String entityName, java.lang.String alias)
Description copied from interface:SharedSessionContractCreateCriteriainstance for the given entity name, using a specific alias.- Specified by:
createCriteriain interfaceSharedSessionContract- Parameters:
entityName- The entity namealias- The alias to use- Returns:
- The criteria instance for manipulation and execution
-
sessionWithOptions
public SharedSessionBuilder sessionWithOptions()
Description copied from interface:SessionObtain aSessionbuilder with the ability to grab certain information from this session.- Specified by:
sessionWithOptionsin interfaceSession- Returns:
- The session builder
-
getSessionFactory
public SessionFactoryImplementor getSessionFactory()
Description copied from interface:SessionGet the session factory which created this session.- Specified by:
getSessionFactoryin interfaceSession- Specified by:
getSessionFactoryin interfaceSessionImplementor- Returns:
- The session factory.
- See Also:
SessionFactory
-
close
public void close() throws HibernateExceptionDescription copied from interface:SharedSessionContractEnd the session by releasing the JDBC connection and cleaning up.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceEntityManager- Specified by:
closein interfaceSharedSessionContract- Throws:
HibernateException- Indicates problems cleaning up.
-
cancelQuery
public void cancelQuery() throws HibernateExceptionDescription copied from interface:SessionCancel the execution of the current query. This is the sole method on session which may be safely called from another thread.- Specified by:
cancelQueryin interfaceSession- Throws:
HibernateException- There was a problem canceling the query
-
isDirty
public boolean isDirty() throws HibernateExceptionDescription copied from interface:SessionDoes this session contain any changes which must be synchronized with the database? In other words, would any DML operations be executed if we flushed this session?- Specified by:
isDirtyin interfaceSession- Returns:
- True if the session contains pending changes; false otherwise.
- Throws:
HibernateException- could not perform dirtying checking
-
isDefaultReadOnly
public boolean isDefaultReadOnly()
Description copied from interface:SessionWill entities and proxies that are loaded into this session be made read-only by default? To determine the read-only/modifiable setting for a particular entity or proxy:- Specified by:
isDefaultReadOnlyin interfaceSession- Returns:
- true, loaded entities/proxies will be made read-only by default; false, loaded entities/proxies will be made modifiable by default.
- See Also:
Session.isReadOnly(Object)
-
setDefaultReadOnly
public void setDefaultReadOnly(boolean readOnly)
Description copied from interface:SessionChange the default for entities and proxies loaded into this session from modifiable to read-only mode, or from modifiable to read-only mode. Read-only entities are not dirty-checked and snapshots of persistent state are not maintained. Read-only entities can be modified, but changes are not persisted. When a proxy is initialized, the loaded entity will have the same read-only/modifiable setting as the uninitialized proxy has, regardless of the session's current setting. To change the read-only/modifiable setting for a particular entity or proxy that is already in this session:- Specified by:
setDefaultReadOnlyin interfaceSession- Parameters:
readOnly- true, the default for loaded entities/proxies is read-only; false, the default for loaded entities/proxies is modifiable- See Also:
To override this session's read-only/modifiable setting for entities and proxies loaded by a Query:,Query.setReadOnly(boolean)
-
getIdentifier
public java.io.Serializable getIdentifier(java.lang.Object object)
Description copied from interface:SessionReturn the identifier value of the given entity as associated with this session. An exception is thrown if the given entity instance is transient or detached in relation to this session.- Specified by:
getIdentifierin interfaceSession- Parameters:
object- a persistent instance- Returns:
- the identifier
-
contains
public boolean contains(java.lang.String entityName, java.lang.Object object)Description copied from interface:SessionCheck if this entity is associated with this Session. This form caters to non-POJO entities, by allowing the entity-name to be passed in
-
contains
public boolean contains(java.lang.Object object)
- Specified by:
containsin interfaceEntityManager
-
getLockMode
public LockModeType getLockMode(java.lang.Object entity)
- Specified by:
getLockModein interfaceEntityManager
-
setProperty
public void setProperty(java.lang.String propertyName, java.lang.Object value)- Specified by:
setPropertyin interfaceEntityManager
-
getProperties
public java.util.Map<java.lang.String,java.lang.Object> getProperties()
- Specified by:
getPropertiesin interfaceEntityManager
-
evict
public void evict(java.lang.Object object)
Description copied from interface:SessionRemove this instance from the session cache. Changes to the instance will not be synchronized with the database. This operation cascades to associated instances if the association is mapped with cascade="evict".
-
load
public <T> T load(java.lang.Class<T> theClass, java.io.Serializable id, LockMode lockMode)Description copied from interface:SessionReturn the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists. Convenient form ofSession.load(Class, Serializable, LockOptions)- Specified by:
loadin interfaceSession- Parameters:
theClass- a persistent classid- a valid identifier of an existing persistent instance of the classlockMode- the lock level- Returns:
- the persistent instance or proxy
- See Also:
Session.load(Class, Serializable, LockOptions)
-
load
public <T> T load(java.lang.Class<T> theClass, java.io.Serializable id, LockOptions lockOptions)Description copied from interface:SessionReturn the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists.
-
load
public java.lang.Object load(java.lang.String entityName, java.io.Serializable id, LockMode lockMode)Description copied from interface:SessionReturn the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists. Convenient form ofSession.load(String, Serializable, LockOptions)- Specified by:
loadin interfaceSession- Parameters:
entityName- a persistent classid- a valid identifier of an existing persistent instance of the classlockMode- the lock level- Returns:
- the persistent instance or proxy
- See Also:
Session.load(String, Serializable, LockOptions)
-
load
public java.lang.Object load(java.lang.String entityName, java.io.Serializable id, LockOptions lockOptions)Description copied from interface:SessionReturn the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists.
-
load
public <T> T load(java.lang.Class<T> theClass, java.io.Serializable id)Description copied from interface:SessionReturn the persistent instance of the given entity class with the given identifier, assuming that the instance exists. This method might return a proxied instance that is initialized on-demand, when a non-identifier method is accessed.
You should not use this method to determine if an instance exists (use get() instead). Use this only to retrieve an instance that you assume exists, where non-existence would be an actual error.
-
load
public java.lang.Object load(java.lang.String entityName, java.io.Serializable id)Description copied from interface:SessionReturn the persistent instance of the given entity class with the given identifier, assuming that the instance exists. This method might return a proxied instance that is initialized on-demand, when a non-identifier method is accessed.
You should not use this method to determine if an instance exists (use get() instead). Use this only to retrieve an instance that you assume exists, where non-existence would be an actual error.
-
load
public void load(java.lang.Object object, java.io.Serializable id)Description copied from interface:SessionRead the persistent state associated with the given identifier into the given transient instance.
-
replicate
public void replicate(java.lang.Object object, ReplicationMode replicationMode)Description copied from interface:SessionPersist the state of the given detached instance, reusing the current identifier value. This operation cascades to associated instances if the association is mapped withcascade="replicate"
-
replicate
public void replicate(java.lang.String entityName, java.lang.Object object, ReplicationMode replicationMode)Description copied from interface:SessionPersist the state of the given detached instance, reusing the current identifier value. This operation cascades to associated instances if the association is mapped withcascade="replicate"
-
save
public java.io.Serializable save(java.lang.Object object)
Description copied from interface:SessionPersist the given transient instance, first assigning a generated identifier. (Or using the current value of the identifier property if the assigned generator is used.) This operation cascades to associated instances if the association is mapped withcascade="save-update"
-
save
public java.io.Serializable save(java.lang.String entityName, java.lang.Object object)Description copied from interface:SessionPersist the given transient instance, first assigning a generated identifier. (Or using the current value of the identifier property if the assigned generator is used.) This operation cascades to associated instances if the association is mapped withcascade="save-update"
-
saveOrUpdate
public void saveOrUpdate(java.lang.Object object)
Description copied from interface:SessionEitherSession.save(Object)orSession.update(Object)the given instance, depending upon resolution of the unsaved-value checks (see the manual for discussion of unsaved-value checking). This operation cascades to associated instances if the association is mapped withcascade="save-update"- Specified by:
saveOrUpdatein interfaceSession- Parameters:
object- a transient or detached instance containing new or updated state- See Also:
Session.save(java.lang.Object),Session.update(Object object)
-
saveOrUpdate
public void saveOrUpdate(java.lang.String entityName, java.lang.Object object)Description copied from interface:SessionEitherSession.save(String, Object)orSession.update(String, Object)the given instance, depending upon resolution of the unsaved-value checks (see the manual for discussion of unsaved-value checking). This operation cascades to associated instances if the association is mapped withcascade="save-update"- Specified by:
saveOrUpdatein interfaceSession- Parameters:
entityName- The entity nameobject- a transient or detached instance containing new or updated state- See Also:
Session.save(String,Object),Session.update(String,Object)
-
update
public void update(java.lang.Object object)
Description copied from interface:SessionUpdate the persistent instance with the identifier of the given detached instance. If there is a persistent instance with the same identifier, an exception is thrown. This operation cascades to associated instances if the association is mapped withcascade="save-update"
-
update
public void update(java.lang.String entityName, java.lang.Object object)Description copied from interface:SessionUpdate the persistent instance with the identifier of the given detached instance. If there is a persistent instance with the same identifier, an exception is thrown. This operation cascades to associated instances if the association is mapped withcascade="save-update"
-
merge
public java.lang.Object merge(java.lang.Object object)
Description copied from interface:SessionCopy the state of the given object onto the persistent object with the same identifier. If there is no persistent instance currently associated with the session, it will be loaded. Return the persistent instance. If the given instance is unsaved, save a copy of and return it as a newly persistent instance. The given instance does not become associated with the session. This operation cascades to associated instances if the association is mapped withcascade="merge"The semantics of this method are defined by JSR-220.- Specified by:
mergein interfaceEntityManager- Specified by:
mergein interfaceSession- Parameters:
object- a detached instance with state to be copied- Returns:
- an updated persistent instance
-
merge
public java.lang.Object merge(java.lang.String entityName, java.lang.Object object)Description copied from interface:SessionCopy the state of the given object onto the persistent object with the same identifier. If there is no persistent instance currently associated with the session, it will be loaded. Return the persistent instance. If the given instance is unsaved, save a copy of and return it as a newly persistent instance. The given instance does not become associated with the session. This operation cascades to associated instances if the association is mapped withcascade="merge"The semantics of this method are defined by JSR-220.
-
persist
public void persist(java.lang.Object object)
Description copied from interface:SessionMake a transient instance persistent. This operation cascades to associated instances if the association is mapped withcascade="persist"The semantics of this method are defined by JSR-220.- Specified by:
persistin interfaceEntityManager- Specified by:
persistin interfaceSession- Parameters:
object- a transient instance to be made persistent
-
remove
public void remove(java.lang.Object entity)
- Specified by:
removein interfaceEntityManager
-
find
public <T> T find(java.lang.Class<T> entityClass, java.lang.Object primaryKey)- Specified by:
findin interfaceEntityManager
-
find
public <T> T find(java.lang.Class<T> entityClass, java.lang.Object primaryKey, java.util.Map<java.lang.String,java.lang.Object> properties)- Specified by:
findin interfaceEntityManager
-
find
public <T> T find(java.lang.Class<T> entityClass, java.lang.Object primaryKey, LockModeType lockMode)- Specified by:
findin interfaceEntityManager
-
find
public <T> T find(java.lang.Class<T> entityClass, java.lang.Object primaryKey, LockModeType lockMode, java.util.Map<java.lang.String,java.lang.Object> properties)- Specified by:
findin interfaceEntityManager
-
getReference
public <T> T getReference(java.lang.Class<T> entityClass, java.lang.Object primaryKey)- Specified by:
getReferencein interfaceEntityManager
-
persist
public void persist(java.lang.String entityName, java.lang.Object object)Description copied from interface:SessionMake a transient instance persistent. This operation cascades to associated instances if the association is mapped withcascade="persist"The semantics of this method are defined by JSR-220.
-
delete
public void delete(java.lang.Object object)
Description copied from interface:SessionRemove a persistent instance from the datastore. The argument may be an instance associated with the receiving Session or a transient instance with an identifier associated with existing persistent state. This operation cascades to associated instances if the association is mapped withcascade="delete"
-
delete
public void delete(java.lang.String entityName, java.lang.Object object)Description copied from interface:SessionRemove a persistent instance from the datastore. The object argument may be an instance associated with the receiving Session or a transient instance with an identifier associated with existing persistent state. This operation cascades to associated instances if the association is mapped withcascade="delete"
-
lock
public void lock(java.lang.Object object, LockMode lockMode)Description copied from interface:SessionObtain the specified lock level upon the given object. This may be used to perform a version check (LockMode.READ), to upgrade to a pessimistic lock (LockMode.PESSIMISTIC_WRITE), or to simply reassociate a transient instance with a session (LockMode.NONE). This operation cascades to associated instances if the association is mapped with cascade="lock". Convenient form ofSession.LockRequest.lock(Object)viaSession.buildLockRequest(LockOptions)- Specified by:
lockin interfaceSession- Parameters:
object- a persistent or transient instancelockMode- the lock level- See Also:
Session.buildLockRequest(LockOptions),Session.LockRequest.lock(Object)
-
lock
public void lock(java.lang.String entityName, java.lang.Object object, LockMode lockMode)Description copied from interface:SessionObtain the specified lock level upon the given object. This may be used to perform a version check (LockMode.OPTIMISTIC), to upgrade to a pessimistic lock (LockMode.PESSIMISTIC_WRITE), or to simply reassociate a transient instance with a session (LockMode.NONE). This operation cascades to associated instances if the association is mapped with cascade="lock". Convenient form ofSession.LockRequest.lock(String, Object)viaSession.buildLockRequest(LockOptions)- Specified by:
lockin interfaceSession- Parameters:
entityName- The name of the entityobject- a persistent or transient instancelockMode- the lock level- See Also:
Session.buildLockRequest(LockOptions),Session.LockRequest.lock(String, Object)
-
buildLockRequest
public Session.LockRequest buildLockRequest(LockOptions lockOptions)
Description copied from interface:SessionBuild a LockRequest that specifies the LockMode, pessimistic lock timeout and lock scope. timeout and scope is ignored for optimistic locking. After building the LockRequest, call LockRequest.lock to perform the requested locking. Example usage:session.buildLockRequest().setLockMode(LockMode.PESSIMISTIC_WRITE).setTimeOut(60000).lock(entity);- Specified by:
buildLockRequestin interfaceSession- Parameters:
lockOptions- contains the lock level- Returns:
- a lockRequest that can be used to lock the passed object.
-
refresh
public void refresh(java.lang.Object object)
Description copied from interface:SessionRe-read the state of the given instance from the underlying database. It is inadvisable to use this to implement long-running sessions that span many business tasks. This method is, however, useful in certain special circumstances. For example- where a database trigger alters the object state upon insert or update
- after executing direct SQL (eg. a mass update) in the same session
- after inserting a Blob or Clob
- Specified by:
refreshin interfaceEntityManager- Specified by:
refreshin interfaceSession- Parameters:
object- a persistent or detached instance
-
refresh
public void refresh(java.lang.Object entity, java.util.Map<java.lang.String,java.lang.Object> properties)- Specified by:
refreshin interfaceEntityManager
-
refresh
public void refresh(java.lang.Object entity, LockModeType lockMode)- Specified by:
refreshin interfaceEntityManager
-
refresh
public void refresh(java.lang.Object entity, LockModeType lockMode, java.util.Map<java.lang.String,java.lang.Object> properties)- Specified by:
refreshin interfaceEntityManager
-
refresh
public void refresh(java.lang.String entityName, java.lang.Object object)Description copied from interface:SessionRe-read the state of the given instance from the underlying database. It is inadvisable to use this to implement long-running sessions that span many business tasks. This method is, however, useful in certain special circumstances. For example- where a database trigger alters the object state upon insert or update
- after executing direct SQL (eg. a mass update) in the same session
- after inserting a Blob or Clob
-
refresh
public void refresh(java.lang.Object object, LockMode lockMode)Description copied from interface:SessionRe-read the state of the given instance from the underlying database, with the given LockMode. It is inadvisable to use this to implement long-running sessions that span many business tasks. This method is, however, useful in certain special circumstances. Convenient form ofSession.refresh(Object, LockOptions)- Specified by:
refreshin interfaceSession- Parameters:
object- a persistent or detached instancelockMode- the lock mode to use- See Also:
Session.refresh(Object, LockOptions)
-
refresh
public void refresh(java.lang.Object object, LockOptions lockOptions)Description copied from interface:SessionRe-read the state of the given instance from the underlying database, with the given LockMode. It is inadvisable to use this to implement long-running sessions that span many business tasks. This method is, however, useful in certain special circumstances.
-
refresh
public void refresh(java.lang.String entityName, java.lang.Object object, LockOptions lockOptions)Description copied from interface:SessionRe-read the state of the given instance from the underlying database, with the given LockMode. It is inadvisable to use this to implement long-running sessions that span many business tasks. This method is, however, useful in certain special circumstances.
-
getCurrentLockMode
public LockMode getCurrentLockMode(java.lang.Object object)
Description copied from interface:SessionDetermine the current lock mode of the given object.- Specified by:
getCurrentLockModein interfaceSession- Parameters:
object- a persistent instance- Returns:
- the current lock mode
-
createFilter
public Query createFilter(java.lang.Object collection, java.lang.String queryString)
Description copied from interface:SessionCreate aQueryinstance for the given collection and filter string. Contains an implicitFROMelement namedthiswhich refers to the defined table for the collection elements, as well as an implicitWHERErestriction for this particular collection instance's key value.- Specified by:
createFilterin interfaceSession- Parameters:
collection- a persistent collectionqueryString- a Hibernate query fragment.- Returns:
- The query instance for manipulation and execution
-
clear
public void clear()
Description copied from interface:SessionCompletely clear the session. Evict all loaded instances and cancel all pending saves, updates and deletions. Do not close open iterators or instances of ScrollableResults.- Specified by:
clearin interfaceEntityManager- Specified by:
clearin interfaceSession
-
detach
public void detach(java.lang.Object entity)
- Specified by:
detachin interfaceEntityManager
-
get
public <T> T get(java.lang.Class<T> theClass, java.io.Serializable id)Description copied from interface:SessionReturn the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance. (If the instance is already associated with the session, return that instance. This method never returns an uninitialized instance.)
-
get
public <T> T get(java.lang.Class<T> theClass, java.io.Serializable id, LockMode lockMode)Description copied from interface:SessionReturn the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance. (If the instance is already associated with the session, return that instance. This method never returns an uninitialized instance.) Obtain the specified lock mode if the instance exists. Convenient form ofSession.get(Class, Serializable, LockOptions)- Specified by:
getin interfaceSession- Parameters:
theClass- The entity typeid- an identifierlockMode- the lock mode- Returns:
- a persistent instance or null
- See Also:
Session.get(Class, Serializable, LockOptions)
-
get
public <T> T get(java.lang.Class<T> theClass, java.io.Serializable id, LockOptions lockOptions)Description copied from interface:SessionReturn the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance. (If the instance is already associated with the session, return that instance. This method never returns an uninitialized instance.) Obtain the specified lock mode if the instance exists.
-
get
public java.lang.Object get(java.lang.String entityName, java.io.Serializable id)Description copied from interface:SessionReturn the persistent instance of the given named entity with the given identifier, or null if there is no such persistent instance. (If the instance is already associated with the session, return that instance. This method never returns an uninitialized instance.)
-
get
public java.lang.Object get(java.lang.String entityName, java.io.Serializable id, LockMode lockMode)Description copied from interface:SessionReturn the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance. (If the instance is already associated with the session, return that instance. This method never returns an uninitialized instance.) Obtain the specified lock mode if the instance exists. Convenient form ofSession.get(String, Serializable, LockOptions)- Specified by:
getin interfaceSession- Parameters:
entityName- the entity nameid- an identifierlockMode- the lock mode- Returns:
- a persistent instance or null
- See Also:
Session.get(String, Serializable, LockOptions)
-
get
public java.lang.Object get(java.lang.String entityName, java.io.Serializable id, LockOptions lockOptions)Description copied from interface:SessionReturn the persistent instance of the given entity class with the given identifier, or null if there is no such persistent instance. (If the instance is already associated with the session, return that instance. This method never returns an uninitialized instance.) Obtain the specified lock mode if the instance exists.
-
getEntityName
public java.lang.String getEntityName(java.lang.Object object)
Description copied from interface:SessionReturn the entity name for a persistent entity.- Specified by:
getEntityNamein interfaceSession- Parameters:
object- a persistent entity- Returns:
- the entity name
-
getReference
public <T> T getReference(T object)
Description copied from interface:SessionReturn a reference to the persistent instance with the same identity as the given instance, which might be detached, making the assumption that the instance is still persistent in the database. This method never results in access to the underlying data store, and thus might return a proxy that is initialized on-demand, when a non-identifier method is accessed.- Specified by:
getReferencein interfaceSession- Parameters:
object- a detached persistent instance- Returns:
- the persistent instance or proxy
-
byId
public IdentifierLoadAccess byId(java.lang.String entityName)
Description copied from interface:SessionCreate anIdentifierLoadAccessinstance to retrieve the specified entity type by primary key.
-
byMultipleIds
public <T> MultiIdentifierLoadAccess<T> byMultipleIds(java.lang.Class<T> entityClass)
Description copied from interface:SessionCreate aMultiIdentifierLoadAccessinstance to retrieve multiple entities at once as specified by primary key values.- Specified by:
byMultipleIdsin interfaceSession- Parameters:
entityClass- The entity type to be retrieved- Returns:
- load delegate for loading the specified entity type by primary key values
-
byMultipleIds
public MultiIdentifierLoadAccess byMultipleIds(java.lang.String entityName)
Description copied from interface:SessionCreate aMultiIdentifierLoadAccessinstance to retrieve multiple entities at once as specified by primary key values.- Specified by:
byMultipleIdsin interfaceSession- Parameters:
entityName- The entity name of the entity type to be retrieved- Returns:
- load delegate for loading the specified entity type by primary key values
-
byId
public <T> IdentifierLoadAccess<T> byId(java.lang.Class<T> entityClass)
Description copied from interface:SessionCreate anIdentifierLoadAccessinstance to retrieve the specified entity by primary key.
-
byNaturalId
public NaturalIdLoadAccess byNaturalId(java.lang.String entityName)
Description copied from interface:SessionCreate aNaturalIdLoadAccessinstance to retrieve the specified entity by its natural id.- Specified by:
byNaturalIdin interfaceSession- Parameters:
entityName- The entity name of the entity type to be retrieved- Returns:
- load delegate for loading the specified entity type by natural id
-
byNaturalId
public <T> NaturalIdLoadAccess<T> byNaturalId(java.lang.Class<T> entityClass)
Description copied from interface:SessionCreate aNaturalIdLoadAccessinstance to retrieve the specified entity by its natural id.- Specified by:
byNaturalIdin interfaceSession- Parameters:
entityClass- The entity type to be retrieved- Returns:
- load delegate for loading the specified entity type by natural id
-
bySimpleNaturalId
public SimpleNaturalIdLoadAccess bySimpleNaturalId(java.lang.String entityName)
Description copied from interface:SessionCreate aSimpleNaturalIdLoadAccessinstance to retrieve the specified entity by its natural id.- Specified by:
bySimpleNaturalIdin interfaceSession- Parameters:
entityName- The entity name of the entity type to be retrieved- Returns:
- load delegate for loading the specified entity type by natural id
-
bySimpleNaturalId
public <T> SimpleNaturalIdLoadAccess<T> bySimpleNaturalId(java.lang.Class<T> entityClass)
Description copied from interface:SessionCreate aSimpleNaturalIdLoadAccessinstance to retrieve the specified entity by its simple (single attribute) natural id.- Specified by:
bySimpleNaturalIdin interfaceSession- Parameters:
entityClass- The entity type to be retrieved- Returns:
- load delegate for loading the specified entity type by natural id
-
enableFilter
public Filter enableFilter(java.lang.String filterName)
Description copied from interface:SessionEnable the named filter for this current session.- Specified by:
enableFilterin interfaceSession- Parameters:
filterName- The name of the filter to be enabled.- Returns:
- The Filter instance representing the enabled filter.
-
getEnabledFilter
public Filter getEnabledFilter(java.lang.String filterName)
Description copied from interface:SessionRetrieve a currently enabled filter by name.- Specified by:
getEnabledFilterin interfaceSession- Parameters:
filterName- The name of the filter to be retrieved.- Returns:
- The Filter instance representing the enabled filter.
-
disableFilter
public void disableFilter(java.lang.String filterName)
Description copied from interface:SessionDisable the named filter for the current session.- Specified by:
disableFilterin interfaceSession- Parameters:
filterName- The name of the filter to be disabled.
-
getStatistics
public SessionStatistics getStatistics()
Description copied from interface:SessionGet the statistics for this session.- Specified by:
getStatisticsin interfaceSession- Returns:
- The session statistics being collected for this session
-
isReadOnly
public boolean isReadOnly(java.lang.Object entityOrProxy)
Description copied from interface:SessionIs the specified entity or proxy read-only? To get the default read-only/modifiable setting used for entities and proxies that are loaded into the session:- Specified by:
isReadOnlyin interfaceSession- Parameters:
entityOrProxy- an entity or HibernateProxy- Returns:
trueif the entity or proxy is read-only,falseif the entity or proxy is modifiable.- See Also:
Session.isDefaultReadOnly()
-
setReadOnly
public void setReadOnly(java.lang.Object entityOrProxy, boolean readOnly)Description copied from interface:SessionSet an unmodified persistent object to read-only mode, or a read-only object to modifiable mode. In read-only mode, no snapshot is maintained, the instance is never dirty checked, and changes are not persisted. If the entity or proxy already has the specified read-only/modifiable setting, then this method does nothing. To set the default read-only/modifiable setting used for entities and proxies that are loaded into the session:- Specified by:
setReadOnlyin interfaceSession- Parameters:
entityOrProxy- an entity or HibernateProxyreadOnly-trueif the entity or proxy should be made read-only;falseif the entity or proxy should be made modifiable- See Also:
To override this session's read-only/modifiable setting for entities and proxies loaded by a Query:,Query.setReadOnly(boolean)
-
doWork
public void doWork(Work work) throws HibernateException
Description copied from interface:SharedSessionContractController for allowing users to perform JDBC related work using the Connection managed by this Session.- Specified by:
doWorkin interfaceSharedSessionContract- Parameters:
work- The work to be performed.- Throws:
HibernateException- Generally indicates wrappedSQLException
-
doReturningWork
public <T> T doReturningWork(ReturningWork<T> work) throws HibernateException
Description copied from interface:SharedSessionContractController for allowing users to perform JDBC related work using the Connection managed by this Session. After execution returns the result of theReturningWork.execute(java.sql.Connection)call.- Specified by:
doReturningWorkin interfaceSharedSessionContract- Type Parameters:
T- The type of the result returned from the work- Parameters:
work- The work to be performed.- Returns:
- the result from calling
ReturningWork.execute(java.sql.Connection). - Throws:
HibernateException- Generally indicates wrappedSQLException
-
disconnect
public java.sql.Connection disconnect()
Description copied from interface:SessionDisconnect the session from its underlying JDBC connection. This is intended for use in cases where the application has supplied the JDBC connection to the session and which require long-sessions (aka, conversations). It is considered an error to call this method on a session which was not opened by supplying the JDBC connection and an exception will be thrown. For non-user-supplied scenarios, normal transaction management already handles disconnection and reconnection automatically.- Specified by:
disconnectin interfaceSession- Returns:
- the application-supplied connection or
null - See Also:
Session.reconnect(Connection)
-
reconnect
public void reconnect(java.sql.Connection connection)
Description copied from interface:SessionReconnect to the given JDBC connection.- Specified by:
reconnectin interfaceSession- Parameters:
connection- a JDBC connection- See Also:
Session.disconnect()
-
isFetchProfileEnabled
public boolean isFetchProfileEnabled(java.lang.String name) throws UnknownProfileExceptionDescription copied from interface:SessionIs a particular fetch profile enabled on this session?- Specified by:
isFetchProfileEnabledin interfaceSession- Parameters:
name- The name of the profile to be checked.- Returns:
- True if fetch profile is enabled; false if not.
- Throws:
UnknownProfileException- Indicates that the given name does not match any known profile names- See Also:
for discussion of this feature
-
enableFetchProfile
public void enableFetchProfile(java.lang.String name) throws UnknownProfileExceptionDescription copied from interface:SessionEnable a particular fetch profile on this session. No-op if requested profile is already enabled.- Specified by:
enableFetchProfilein interfaceSession- Parameters:
name- The name of the fetch profile to be enabled.- Throws:
UnknownProfileException- Indicates that the given name does not match any known profile names- See Also:
for discussion of this feature
-
disableFetchProfile
public void disableFetchProfile(java.lang.String name) throws UnknownProfileExceptionDescription copied from interface:SessionDisable a particular fetch profile on this session. No-op if requested profile is already disabled.- Specified by:
disableFetchProfilein interfaceSession- Parameters:
name- The name of the fetch profile to be disabled.- Throws:
UnknownProfileException- Indicates that the given name does not match any known profile names- See Also:
for discussion of this feature
-
getTypeHelper
public TypeHelper getTypeHelper()
Description copied from interface:SessionConvenience access to theTypeHelperassociated with this session'sSessionFactory. Equivalent to callingSession.getSessionFactory().getTypeHelper()- Specified by:
getTypeHelperin interfaceSession- Returns:
- The
TypeHelperassociated with this session'sSessionFactory
-
getLobHelper
public LobHelper getLobHelper()
Description copied from interface:SessionRetrieve this session's helper/delegate for creating LOB instances.- Specified by:
getLobHelperin interfaceSession- Returns:
- This session's LOB helper
-
addEventListeners
public void addEventListeners(SessionEventListener... listeners)
Description copied from interface:SessionAdd one or more listeners to the Session- Specified by:
addEventListenersin interfaceSession- Parameters:
listeners- The listener(s) to add
-
isFlushBeforeCompletionEnabled
public boolean isFlushBeforeCompletionEnabled()
- Specified by:
isFlushBeforeCompletionEnabledin interfaceSessionImplementor
-
getActionQueue
public ActionQueue getActionQueue()
- Specified by:
getActionQueuein interfaceSessionImplementor
-
instantiate
public java.lang.Object instantiate(EntityPersister persister, java.io.Serializable id) throws HibernateException
Description copied from interface:SharedSessionContractImplementorInstantiate the entity class of an EntityPersister, initializing with the given identifier. This is more efficient thanSharedSessionContractImplementor.instantiate(String, Serializable)but not always interchangeable: a single persister might be responsible for multiple types.- Specified by:
instantiatein interfaceSharedSessionContractImplementor- Throws:
HibernateException
-
forceFlush
public void forceFlush(EntityEntry e) throws HibernateException
- Specified by:
forceFlushin interfaceSessionImplementor- Throws:
HibernateException
-
merge
public void merge(java.lang.String entityName, java.lang.Object object, java.util.Map copiedAlready) throws HibernateException- Specified by:
mergein interfaceSessionImplementor- Throws:
HibernateException
-
persist
public void persist(java.lang.String entityName, java.lang.Object object, java.util.Map createdAlready) throws HibernateException- Specified by:
persistin interfaceSessionImplementor- Throws:
HibernateException
-
persistOnFlush
public void persistOnFlush(java.lang.String entityName, java.lang.Object object, java.util.Map copiedAlready)- Specified by:
persistOnFlushin interfaceSessionImplementor
-
refresh
public void refresh(java.lang.String entityName, java.lang.Object object, java.util.Map refreshedAlready) throws HibernateException- Specified by:
refreshin interfaceSessionImplementor- Throws:
HibernateException
-
delete
public void delete(java.lang.String entityName, java.lang.Object child, boolean isCascadeDeleteEnabled, java.util.Set transientEntities)- Specified by:
deletein interfaceSessionImplementor
-
removeOrphanBeforeUpdates
public void removeOrphanBeforeUpdates(java.lang.String entityName, java.lang.Object child)- Specified by:
removeOrphanBeforeUpdatesin interfaceSessionImplementor
-
getSession
public SessionImplementor getSession()
Description copied from interface:HibernateEntityManagerRetrieve a reference to the HibernateSessionused by thisEntityManager.- Specified by:
getSessionin interfaceHibernateEntityManager- Specified by:
getSessionin interfaceHibernateEntityManagerImplementor- Returns:
- The session
-
useStreamForLobBinding
public boolean useStreamForLobBinding()
Description copied from interface:WrapperOptionsShould streams be used for binding LOB values.- Specified by:
useStreamForLobBindingin interfaceWrapperOptions- Returns:
true/false
-
getLobCreator
public LobCreator getLobCreator()
Description copied from interface:WrapperOptionsObtain access to theLobCreator- Specified by:
getLobCreatorin interfaceWrapperOptions- Returns:
- The LOB creator
-
remapSqlTypeDescriptor
public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor)
Description copied from interface:WrapperOptionsAllow remapping of descriptors for dealing with sql type.- Specified by:
remapSqlTypeDescriptorin interfaceWrapperOptions- Parameters:
sqlTypeDescriptor- The known descriptor- Returns:
- The remapped descriptor. May be the same as the known descriptor indicating no remapping.
-
getJdbcBatchSize
public java.lang.Integer getJdbcBatchSize()
Description copied from interface:SharedSessionContractGet the Session-level JDBC batch size for the current Session. Overrides the SessionFactory JDBC batch size defined by thehibernate.default_batch_fetch_sizeconfiguration property for the scope of the currentSession.- Specified by:
getJdbcBatchSizein interfaceJdbcSessionOwner- Specified by:
getJdbcBatchSizein interfaceSharedSessionContract- Returns:
- Session-level JDBC batch size
- See Also:
SessionFactoryOptions.getJdbcBatchSize(),SessionFactoryBuilder.applyJdbcBatchSize(int)
-
setJdbcBatchSize
public void setJdbcBatchSize(java.lang.Integer jdbcBatchSize)
Description copied from interface:SharedSessionContractSet the Session-level JDBC batch size. Overrides the SessionFactory JDBC batch size defined by thehibernate.default_batch_fetch_sizeconfiguration property for the scope of the currentSession.- Specified by:
setJdbcBatchSizein interfaceSharedSessionContract- Parameters:
jdbcBatchSize- Session-level JDBC batch size- See Also:
SessionFactoryOptions.getJdbcBatchSize(),SessionFactoryBuilder.applyJdbcBatchSize(int)
-
getJdbcTimeZone
public java.util.TimeZone getJdbcTimeZone()
Description copied from interface:WrapperOptionsThe JDBCTimeZoneused when persisting Timestamp and DateTime properties into the database. This setting is used when storing timestamps using thePreparedStatement.setTimestamp(int, Timestamp, Calendar)method. This way, the storageTimeZonecan differ from the default JVM TimeZone given byTimeZone.getDefault().- Specified by:
getJdbcTimeZonein interfaceWrapperOptions- Returns:
- JDBC
TimeZone
-
-