类 SessionImpl
- java.lang.Object
-
- org.hibernate.internal.AbstractSharedSessionContract
-
- org.hibernate.internal.AbstractSessionImpl
-
- org.hibernate.internal.SessionImpl
-
- 所有已实现的接口:
Closeable,Serializable,AutoCloseable,javax.persistence.EntityManager,HibernateEntityManager,LobCreationContext,SessionImplementor,SharedSessionContractImplementor,EventSource,HibernateEntityManager,HibernateEntityManagerFactoryAware,HibernateEntityManagerImplementor,QueryProducer,QueryProducerImplementor,JdbcSessionOwner,TransactionCoordinatorBuilder.Options,Session,SharedSessionContract,WrapperOptions
public class SessionImpl extends AbstractSessionImpl implements EventSource, SessionImplementor, HibernateEntityManagerImplementor
Concrete implementation of a Session. Exposes two interfaces:Sessionto the applicationSessionImplementorto other Hibernate components (SPI)
- 作者:
- Gavin King, Steve Ebersole, Brett Meyer, Chris Cranford, Sanne Grinovero
- 另请参阅:
- 序列化表格
-
-
嵌套类概要
-
从接口继承的嵌套类/接口 org.hibernate.jpa.spi.HibernateEntityManagerImplementor
HibernateEntityManagerImplementor.QueryOptions
-
从接口继承的嵌套类/接口 org.hibernate.engine.jdbc.LobCreationContext
LobCreationContext.Callback<T>
-
从接口继承的嵌套类/接口 org.hibernate.Session
Session.LockRequest
-
-
字段概要
-
从类继承的字段 org.hibernate.internal.AbstractSharedSessionContract
closed, fastSessionServices, waitingForAutoClose
-
-
构造器概要
构造器 构造器 说明 SessionImpl(SessionFactoryImpl factory, SessionCreationOptions options)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddEventListeners(SessionEventListener... listeners)Add one or more listeners to the Sessionprotected voidaddSharedSessionTransactionObserver(TransactionCoordinator transactionCoordinator)voidafterOperation(boolean success)Check if there is a Hibernate or JTA transaction in progress and, if there is not, flush if necessary, make sure the connection has been committed (if it is not in autocommit mode) and run the after completion processingvoidafterScrollOperation()voidafterTransactionBegin()A after-begin callback from the coordinator to its owner.voidafterTransactionCompletion(boolean successful, boolean delayed)An after-completion callback to the owner.protected voidapplyQuerySettingsAndHints(Query query)protected booleanautoFlushIfRequired(Set querySpaces)detect in-memory changes, determine if the changes are to tables named in the query and, if so, complete execution the flushvoidbeforeTransactionCompletion()A before-completion callback to the owner.StringbestGuessEntityName(Object object)The best guess entity name for an entity not in an associationSession.LockRequestbuildLockRequest(LockOptions lockOptions)Build a LockRequest that specifies the LockMode, pessimistic lock timeout and lock scope.<T> org.hibernate.internal.SessionImpl.IdentifierLoadAccessImpl<T>byId(Class<T> entityClass)Create anIdentifierLoadAccessinstance to retrieve the specified entity by primary key.org.hibernate.internal.SessionImpl.IdentifierLoadAccessImplbyId(String entityName)Create anIdentifierLoadAccessinstance to retrieve the specified entity type by primary key.<T> MultiIdentifierLoadAccess<T>byMultipleIds(Class<T> entityClass)Create aMultiIdentifierLoadAccessinstance to retrieve multiple entities at once as specified by primary key values.MultiIdentifierLoadAccessbyMultipleIds(String entityName)Create aMultiIdentifierLoadAccessinstance to retrieve multiple entities at once as specified by primary key values.<T> NaturalIdLoadAccess<T>byNaturalId(Class<T> entityClass)Create aNaturalIdLoadAccessinstance to retrieve the specified entity by its natural id.NaturalIdLoadAccessbyNaturalId(String entityName)Create aNaturalIdLoadAccessinstance to retrieve the specified entity by its natural id.<T> SimpleNaturalIdLoadAccess<T>bySimpleNaturalId(Class<T> entityClass)Create aSimpleNaturalIdLoadAccessinstance to retrieve the specified entity by its simple (single attribute) natural id.SimpleNaturalIdLoadAccessbySimpleNaturalId(String entityName)Create aSimpleNaturalIdLoadAccessinstance to retrieve the specified entity by its natural id.voidcancelQuery()Cancel the execution of the current query.protected voidcheckNoUnresolvedActionsAfterOperation()protected voidcheckNoUnresolvedActionsBeforeOperation()protected voidcheckSessionFactoryOpen()protected voidcleanupOnClose()clear all the internal collections, just to help the garbage collector, does not clear anything that is needed during the afterTransactionCompletion() phasevoidclear()Completely clear the session.voidclose()End the session by releasing the JDBC connection and cleaning up.voidcloseWithoutOpenChecks()Connectionconnection()booleancontains(Object object)booleancontains(String entityName, Object object)Check if this entity is associated with this Session.CriteriacreateCriteria(Class persistentClass)CreateCriteriainstance for the given class (entity or subclasses/implementors).CriteriacreateCriteria(Class persistentClass, String alias)CreateCriteriainstance for the given class (entity or subclasses/implementors), using a specific alias.CriteriacreateCriteria(String entityName)CreateCriteriainstance for the given entity name.CriteriacreateCriteria(String entityName, String alias)CreateCriteriainstance for the given entity name, using a specific alias.<T> RootGraphImplementor<T>createEntityGraph(Class<T> rootType)RootGraphImplementor<?>createEntityGraph(String graphName)QuerycreateFilter(Object collection, String queryString)Create aQueryinstance for the given collection and filter string.javax.persistence.StoredProcedureQuerycreateNamedStoredProcedureQuery(String name)ProcedureCallcreateStoredProcedureCall(String procedureName)Creates a call to a stored procedure.ProcedureCallcreateStoredProcedureCall(String procedureName, Class... resultClasses)Creates a call to a stored procedure with specific result set entity mappings.ProcedureCallcreateStoredProcedureCall(String procedureName, String... resultSetMappings)Creates a call to a stored procedure with specific result set entity mappings.javax.persistence.StoredProcedureQuerycreateStoredProcedureQuery(String procedureName)javax.persistence.StoredProcedureQuerycreateStoredProcedureQuery(String procedureName, Class... resultClasses)javax.persistence.StoredProcedureQuerycreateStoredProcedureQuery(String procedureName, String... resultSetMappings)protected voiddelayedAfterCompletion()voiddelete(Object object)Remove a persistent instance from the datastore.voiddelete(String entityName, Object object)Remove a persistent instance from the datastore.voiddelete(String entityName, Object object, boolean isCascadeDeleteEnabled, Set transientEntities)Cascade delete an entity instancevoiddetach(Object entity)protected CacheModedetermineAppropriateLocalCacheMode(Map<String,Object> localProperties)voiddisableFetchProfile(String name)Disable a particular fetch profile on this session.voiddisableFilter(String filterName)Disable the named filter for the current session.Connectiondisconnect()Disconnect the session from its underlying JDBC connection.voidenableFetchProfile(String name)Enable a particular fetch profile on this session.FilterenableFilter(String filterName)Enable the named filter for this current session.voidevict(Object object)remove any hard references to the entity that are held by the infrastructure (references held by application or other persistent instances are okay)intexecuteNativeUpdate(NativeSQLQuerySpecification nativeQuerySpecification, QueryParameters queryParameters)Execute a native SQL update or delete queryintexecuteUpdate(String query, QueryParameters queryParameters)Execute a HQL update or delete query<T> Tfind(Class<T> entityClass, Object primaryKey)<T> Tfind(Class<T> entityClass, Object primaryKey, Map<String,Object> properties)<T> Tfind(Class<T> entityClass, Object primaryKey, javax.persistence.LockModeType lockModeType)<T> Tfind(Class<T> entityClass, Object primaryKey, javax.persistence.LockModeType lockModeType, Map<String,Object> properties)voidflush()Force this session to flush.voidflushBeforeTransactionCompletion()voidforceFlush(EntityEntry entityEntry)Force an immediate flush<T> Tget(Class<T> entityClass, 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(Class<T> entityClass, 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(Class<T> entityClass, 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.Objectget(String entityName, Serializable id)Return the persistent instance of the given named entity with the given identifier, or null if there is no such persistent instance.Objectget(String entityName, 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.Objectget(String entityName, 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()Get the ActionQueue for this sessionSerializablegetContextEntityIdentifier(Object object)Get the id value for an object that is actually associated with the session.javax.persistence.criteria.CriteriaBuildergetCriteriaBuilder()LockModegetCurrentLockMode(Object object)Determine the current lock mode of the given object.ObjectgetDelegate()intgetDontFlushFromFind()FiltergetEnabledFilter(String filterName)Retrieve a currently enabled filter by name.RootGraphImplementor<?>getEntityGraph(String graphName)ListgetEntityGraphs(Class entityClass)SessionFactoryImplementorgetEntityManagerFactory()StringgetEntityName(Object object)Return the entity name for a persistent entity.EntityPersistergetEntityPersister(String entityName, Object object)Get the EntityPersister for any instanceObjectgetEntityUsingInterceptor(EntityKey key)Get the entity instance associated with the given Key, calling the Interceptor if necessaryGraphImplementorgetFetchGraphLoadContext()Get the current fetch graph context (eitherRootGraphImplementororSubGraphImplementor.SerializablegetIdentifier(Object object)Return the identifier value of the given entity as associated with this session.LoadQueryInfluencersgetLoadQueryInfluencers()Get the load query influencers associated with this session.LobHelpergetLobHelper()Retrieve this session's helper/delegate for creating LOB instances.javax.persistence.LockModeTypegetLockMode(Object entity)LockOptionsgetLockRequest(javax.persistence.LockModeType lockModeType, Map<String,Object> properties)Convert from JPA 2LockModeType& properties intoLockOptionsMetamodelImplementorgetMetamodel()PersistenceContextgetPersistenceContext()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.Map<String,Object>getProperties()<T> TgetReference(Class<T> entityClass, Object primaryKey)SessionImplementorgetSession()Retrieve a reference to the HibernateSessionused by thisEntityManager.SessionFactoryImplementorgetSessionFactory()Get the session factory which created this session.SessionStatisticsgetStatistics()Get the statistics for this session.TypeHelpergetTypeHelper()Convenience access to theTypeHelperassociated with this session'sSessionFactory.StringguessEntityName(Object object)The guessed entity name for an entity not in an associationObjectimmediateLoad(String entityName, Serializable id)Load the data for the object with the specified id into a newly created object.voidinitializeCollection(PersistentCollection collection, boolean writing)Initialize the collection (if not already initialized)protected voidinitQueryFromNamedDefinition(Query query, NamedQueryDefinition namedQueryDefinition)Objectinstantiate(String entityName, Serializable id)Instantiate the entity class, initializing with the given identifierObjectinstantiate(EntityPersister persister, Serializable id)give the interceptor an opportunity to override the default instantiationObjectinternalLoad(String entityName, Serializable id, boolean eager, boolean nullable)Load an instance without checking if it was deleted.booleanisAutoCloseSessionEnabled()booleanisDefaultReadOnly()Will entities and proxies that are loaded into this session be made read-only by default?booleanisDirty()Does this session contain any changes which must be synchronized with the database?booleanisEventSource()booleanisFetchProfileEnabled(String name)Is a particular fetch profile enabled on this session?booleanisFlushBeforeCompletionEnabled()booleanisJoinedToTransaction()booleanisOpen()Check if the session is still open.booleanisQueryParametersValidationEnabled()booleanisReadOnly(Object entityOrProxy)Is the specified entity or proxy read-only?Iteratoriterate(String query, QueryParameters queryParameters)Execute an iterate() queryIteratoriterateFilter(Object collection, String filter, QueryParameters queryParameters)Iterate a filtervoidjoinTransaction()Listlist(String query, QueryParameters queryParameters)Execute a find() queryListlist(Criteria criteria)Execute a criteria queryListlistCustomQuery(CustomQuery customQuery, QueryParameters queryParameters)Execute an SQL QueryListlistFilter(Object collection, String filter, QueryParameters queryParameters)Execute a filter<T> Tload(Class<T> entityClass, Serializable id)Return the persistent instance of the given entity class with the given identifier, assuming that the instance exists.<T> Tload(Class<T> entityClass, 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(Class<T> entityClass, 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(Object object, Serializable id)Read the persistent state associated with the given identifier into the given transient instance.Objectload(String entityName, Serializable id)Return the persistent instance of the given entity class with the given identifier, assuming that the instance exists.Objectload(String entityName, Serializable id, LockMode lockMode)Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists.Objectload(String entityName, Serializable id, LockOptions lockOptions)Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists.voidlock(Object entity, javax.persistence.LockModeType lockModeType)voidlock(Object entity, javax.persistence.LockModeType lockModeType, Map<String,Object> properties)voidlock(Object object, LockMode lockMode)Obtain the specified lock level upon the given object.voidlock(String entityName, Object object, LockMode lockMode)Obtain the specified lock level upon the given object.Objectmerge(Object object)Copy the state of the given object onto the persistent object with the same identifier.Objectmerge(String entityName, Object object)Copy the state of the given object onto the persistent object with the same identifier.voidmerge(String entityName, Object object, Map copiedAlready)Cascade merge an entity instancevoidpersist(Object object)Make a transient instance persistent.voidpersist(String entityName, Object object)Make a transient instance persistent.voidpersist(String entityName, Object object, Map copiedAlready)Cascade persist an entity instancevoidpersistOnFlush(String entityName, Object object, Map copiedAlready)Cascade persist an entity instance during the flush processvoidreconnect(Connection conn)Reconnect to the given JDBC connection.voidrefresh(Object object)Re-read the state of the given instance from the underlying database.voidrefresh(Object entity, Map<String,Object> properties)voidrefresh(Object entity, javax.persistence.LockModeType lockModeType)voidrefresh(Object entity, javax.persistence.LockModeType lockModeType, Map<String,Object> properties)voidrefresh(Object object, LockMode lockMode)Re-read the state of the given instance from the underlying database, with the given LockMode.voidrefresh(Object object, LockOptions lockOptions)Re-read the state of the given instance from the underlying database, with the given LockMode.voidrefresh(String entityName, Object object)Re-read the state of the given instance from the underlying database.voidrefresh(String entityName, Object object, Map refreshedAlready)Cascade refresh an entity instancevoidrefresh(String entityName, Object object, LockOptions lockOptions)Re-read the state of the given instance from the underlying database, with the given LockMode.voidremove(Object entity)voidremoveOrphanBeforeUpdates(String entityName, Object child)A specialized type of deletion for orphan removal that must occur prior to queued inserts and updates.protected voidremoveSharedSessionTransactionObserver(TransactionCoordinator transactionCoordinator)voidreplicate(Object obj, ReplicationMode replicationMode)Persist the state of the given detached instance, reusing the current identifier value.voidreplicate(String entityName, Object obj, ReplicationMode replicationMode)Persist the state of the given detached instance, reusing the current identifier value.Serializablesave(Object obj)Persist the given transient instance, first assigning a generated identifier.Serializablesave(String entityName, Object object)Persist the given transient instance, first assigning a generated identifier.voidsaveOrUpdate(Object object)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(String entityName, Object obj)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(String query, QueryParameters queryParameters)Execute a scroll() queryScrollableResultsImplementorscroll(Criteria criteria, ScrollMode scrollMode)Execute a criteria queryScrollableResultsImplementorscrollCustomQuery(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)voidsetDefaultReadOnly(boolean defaultReadOnly)Change the default for entities and proxies loaded into this session from modifiable to read-only mode, or from modifiable to read-only mode.voidsetFetchGraphLoadContext(GraphImplementor fetchGraphLoadContext)Set the current fetch graph context (eitherRootGraphImplementororSubGraphImplementor.voidsetFlushMode(javax.persistence.FlushModeType flushModeType)voidsetProperty(String propertyName, Object value)voidsetReadOnly(Object entity, boolean readOnly)Set an unmodified persistent object to read-only mode, or a read-only object to modifiable mode.booleanshouldAutoClose()protected booleanshouldCloseJdbcCoordinatorOnClose(boolean isTransactionCoordinatorShared)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 TransactionStringtoString()<T> Tunwrap(Class<T> clazz)voidupdate(Object obj)Update the persistent instance with the identifier of the given detached instance.voidupdate(String entityName, Object object)Update the persistent instance with the identifier of the given detached instance.-
从类继承的方法 org.hibernate.internal.AbstractSharedSessionContract
accessTransaction, beginTransaction, buildQueryFromName, checkOpen, checkOpenOrWaitingForAutoClose, checkTransactionNeededForUpdateOperation, checkTransactionSynchStatus, createNamedQuery, createNamedQuery, createNativeQuery, createNativeQuery, createNativeQuery, createNativeQuery, createQuery, createQuery, createQuery, createQuery, createQuery, createQuery, createQuery, createQuery, createSQLQuery, criteriaCompiler, doReturningWork, doWork, errorIfClosed, execute, generateEntityKey, getCacheMode, getCacheTransactionSynchronization, getCurrentTransaction, getEntityNameResolver, getEventListenerManager, getExceptionConverter, getFactory, getFlushMode, getHibernateFlushMode, getInterceptor, getJdbcBatchSize, getJdbcConnectionAccess, getJdbcCoordinator, getJdbcServices, getJdbcSessionContext, getJdbcTimeZone, getLobCreator, getNamedNativeQuery, getNamedProcedureCall, getNamedQuery, getNamedSQLQuery, getNativeQueryImplementor, getNativeQueryPlan, getQueryPlan, getSessionIdentifier, getTenantIdentifier, getTransaction, getTransactionCoordinator, getTransactionStartTimestamp, isClosed, isConnected, isOpenOrWaitingForAutoClose, isTransactionInProgress, list, markForRollbackOnly, pulseTransactionCoordinator, remapSqlTypeDescriptor, resultClassChecking, resultClassChecking, scroll, setCacheMode, setClosed, setFlushMode, setHibernateFlushMode, setJdbcBatchSize, shouldAutoJoinTransaction, useStreamForLobBinding
-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
从接口继承的方法 javax.persistence.EntityManager
createNamedQuery, createQuery, createQuery, createQuery, createQuery, createQuery, getTransaction
-
从接口继承的方法 org.hibernate.jpa.spi.HibernateEntityManagerFactoryAware
getFactory
-
从接口继承的方法 org.hibernate.jpa.spi.HibernateEntityManagerImplementor
buildLockOptions, checkOpen, createQuery, isTransactionInProgress, markForRollbackOnly
-
从接口继承的方法 org.hibernate.resource.jdbc.spi.JdbcSessionOwner
getJdbcBatchSize, getJdbcConnectionAccess, getJdbcSessionContext, getTransactionCoordinator
-
从接口继承的方法 org.hibernate.engine.jdbc.LobCreationContext
execute
-
从接口继承的方法 org.hibernate.query.spi.QueryProducerImplementor
createNamedQuery, createNamedQuery, createNativeQuery, createNativeQuery, createNativeQuery, createQuery, createQuery, createSQLQuery, getNamedQuery
-
从接口继承的方法 org.hibernate.Session
getCacheMode, getFlushMode, getHibernateFlushMode, setCacheMode, setFlushMode, setHibernateFlushMode
-
从接口继承的方法 org.hibernate.engine.spi.SessionImplementor
createNamedQuery, createNamedQuery, createNativeQuery, createNativeQuery, createNativeQuery, createQuery, createQuery, createQuery, createQuery, createQuery, createQuery, createSQLQuery, getNamedNativeQuery, getNamedQuery, getNamedSQLQuery
-
从接口继承的方法 org.hibernate.SharedSessionContract
beginTransaction, doReturningWork, doWork, getJdbcBatchSize, getNamedProcedureCall, getTransaction, isConnected, setJdbcBatchSize
-
从接口继承的方法 org.hibernate.engine.spi.SharedSessionContractImplementor
accessTransaction, checkOpen, checkOpen, checkTransactionNeededForUpdateOperation, generateEntityKey, getCacheMode, getCacheTransactionSynchronization, getConfiguredJdbcBatchSize, getEventListenerManager, getExceptionConverter, getFactory, getFlushMode, getHibernateFlushMode, getInterceptor, getJdbcCoordinator, getJdbcServices, getSessionIdentifier, getTenantIdentifier, getTimestamp, getTransactionStartTimestamp, isClosed, isOpenOrWaitingForAutoClose, isTransactionInProgress, list, markForRollbackOnly, scroll, setCacheMode, setFlushMode, setHibernateFlushMode
-
从接口继承的方法 org.hibernate.resource.transaction.spi.TransactionCoordinatorBuilder.Options
shouldAutoJoinTransaction
-
从接口继承的方法 org.hibernate.type.descriptor.WrapperOptions
getJdbcTimeZone, getLobCreator, remapSqlTypeDescriptor, useStreamForLobBinding
-
-
-
-
构造器详细资料
-
SessionImpl
public SessionImpl(SessionFactoryImpl factory, SessionCreationOptions options)
-
-
方法详细资料
-
applyQuerySettingsAndHints
protected void applyQuerySettingsAndHints(Query query)
-
sessionWithOptions
public SharedSessionBuilder sessionWithOptions()
从接口复制的说明:SessionObtain aSessionbuilder with the ability to grab certain information from this session.- 指定者:
sessionWithOptions在接口中Session- 返回:
- The session builder
-
clear
public void clear()
从接口复制的说明: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.
-
close
public void close() throws HibernateException从接口复制的说明:SharedSessionContractEnd the session by releasing the JDBC connection and cleaning up.- 指定者:
close在接口中AutoCloseable- 指定者:
close在接口中Closeable- 指定者:
close在接口中javax.persistence.EntityManager- 指定者:
close在接口中SharedSessionContract- 覆盖:
close在类中AbstractSharedSessionContract- 抛出:
HibernateException- Indicates problems cleaning up.
-
closeWithoutOpenChecks
public void closeWithoutOpenChecks() throws HibernateException
-
shouldCloseJdbcCoordinatorOnClose
protected boolean shouldCloseJdbcCoordinatorOnClose(boolean isTransactionCoordinatorShared)
-
isAutoCloseSessionEnabled
public boolean isAutoCloseSessionEnabled()
-
isQueryParametersValidationEnabled
public boolean isQueryParametersValidationEnabled()
-
isOpen
public boolean isOpen()
从接口复制的说明:SharedSessionContractCheck if the session is still open.- 指定者:
isOpen在接口中javax.persistence.EntityManager- 指定者:
isOpen在接口中SharedSessionContract- 覆盖:
isOpen在类中AbstractSharedSessionContract- 返回:
- boolean
-
checkSessionFactoryOpen
protected void checkSessionFactoryOpen()
-
shouldAutoClose
public boolean shouldAutoClose()
-
connection
public Connection connection() throws HibernateException
- 指定者:
connection在接口中SharedSessionContractImplementor- 抛出:
HibernateException
-
disconnect
public Connection disconnect() throws HibernateException
从接口复制的说明: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.- 指定者:
disconnect在接口中Session- 返回:
- the application-supplied connection or
null - 抛出:
HibernateException- 另请参阅:
Session.reconnect(Connection)
-
reconnect
public void reconnect(Connection conn) throws HibernateException
从接口复制的说明:SessionReconnect to the given JDBC connection.- 指定者:
reconnect在接口中Session- 参数:
conn- a JDBC connection- 抛出:
HibernateException- 另请参阅:
Session.disconnect()
-
setAutoClear
public void setAutoClear(boolean enabled)
从接口复制的说明:SharedSessionContractImplementorEnable/disable automatic cache clearing from after transaction completion (for EJB3)- 指定者:
setAutoClear在接口中SharedSessionContractImplementor
-
afterOperation
public void afterOperation(boolean success)
Check if there is a Hibernate or JTA transaction in progress and, if there is not, flush if necessary, make sure the connection has been committed (if it is not in autocommit mode) and run the after completion processing- 参数:
success- Was the operation a success
-
addEventListeners
public void addEventListeners(SessionEventListener... listeners)
从接口复制的说明:SessionAdd one or more listeners to the Session- 指定者:
addEventListeners在接口中Session- 参数:
listeners- The listener(s) to add
-
cleanupOnClose
protected void cleanupOnClose()
clear all the internal collections, just to help the garbage collector, does not clear anything that is needed during the afterTransactionCompletion() phase
-
getCurrentLockMode
public LockMode getCurrentLockMode(Object object) throws HibernateException
从接口复制的说明:SessionDetermine the current lock mode of the given object.- 指定者:
getCurrentLockMode在接口中Session- 参数:
object- a persistent instance- 返回:
- the current lock mode
- 抛出:
HibernateException
-
getEntityUsingInterceptor
public Object getEntityUsingInterceptor(EntityKey key) throws HibernateException
从接口复制的说明:SharedSessionContractImplementorGet the entity instance associated with the given Key, calling the Interceptor if necessary
-
checkNoUnresolvedActionsBeforeOperation
protected void checkNoUnresolvedActionsBeforeOperation()
-
checkNoUnresolvedActionsAfterOperation
protected void checkNoUnresolvedActionsAfterOperation()
-
delayedAfterCompletion
protected void delayedAfterCompletion()
-
saveOrUpdate
public void saveOrUpdate(Object object) throws HibernateException
从接口复制的说明: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"- 指定者:
saveOrUpdate在接口中Session- 参数:
object- a transient or detached instance containing new or updated state- 抛出:
HibernateException- 另请参阅:
Session.save(java.lang.Object),Session.update(Object object)
-
saveOrUpdate
public void saveOrUpdate(String entityName, Object obj) throws HibernateException
从接口复制的说明: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"- 指定者:
saveOrUpdate在接口中Session- 参数:
entityName- The entity nameobj- a transient or detached instance containing new or updated state- 抛出:
HibernateException- 另请参阅:
Session.save(String,Object),Session.update(String,Object)
-
save
public Serializable save(Object obj) throws HibernateException
从接口复制的说明: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在接口中Session- 参数:
obj- a transient instance of a persistent class- 返回:
- the generated identifier
- 抛出:
HibernateException
-
save
public Serializable save(String entityName, Object object) throws HibernateException
从接口复制的说明: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在接口中Session- 参数:
entityName- The entity nameobject- a transient instance of a persistent class- 返回:
- the generated identifier
- 抛出:
HibernateException
-
update
public void update(Object obj) throws HibernateException
从接口复制的说明: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在接口中Session- 参数:
obj- a detached instance containing updated state- 抛出:
HibernateException
-
update
public void update(String entityName, Object object) throws HibernateException
从接口复制的说明: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在接口中Session- 参数:
entityName- The entity nameobject- a detached instance containing updated state- 抛出:
HibernateException
-
lock
public void lock(String entityName, Object object, LockMode lockMode) throws HibernateException
从接口复制的说明: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)- 指定者:
lock在接口中Session- 参数:
entityName- The name of the entityobject- a persistent or transient instancelockMode- the lock level- 抛出:
HibernateException- 另请参阅:
Session.buildLockRequest(LockOptions),Session.LockRequest.lock(String, Object)
-
buildLockRequest
public Session.LockRequest buildLockRequest(LockOptions lockOptions)
从接口复制的说明: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);- 指定者:
buildLockRequest在接口中Session- 参数:
lockOptions- contains the lock level- 返回:
- a lockRequest that can be used to lock the passed object.
-
lock
public void lock(Object object, LockMode lockMode) throws HibernateException
从接口复制的说明: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)- 指定者:
lock在接口中Session- 参数:
object- a persistent or transient instancelockMode- the lock level- 抛出:
HibernateException- 另请参阅:
Session.buildLockRequest(LockOptions),Session.LockRequest.lock(Object)
-
persist
public void persist(String entityName, Object object) throws HibernateException
从接口复制的说明: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.- 指定者:
persist在接口中Session- 参数:
entityName- The entity nameobject- a transient instance to be made persistent- 抛出:
HibernateException
-
persist
public void persist(Object object) throws HibernateException
从接口复制的说明: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.- 指定者:
persist在接口中javax.persistence.EntityManager- 指定者:
persist在接口中Session- 参数:
object- a transient instance to be made persistent- 抛出:
HibernateException
-
persist
public void persist(String entityName, Object object, Map copiedAlready) throws HibernateException
从接口复制的说明:EventSourceCascade persist an entity instance- 指定者:
persist在接口中EventSource- 指定者:
persist在接口中SessionImplementor- 抛出:
HibernateException
-
persistOnFlush
public void persistOnFlush(String entityName, Object object, Map copiedAlready)
从接口复制的说明:EventSourceCascade persist an entity instance during the flush process- 指定者:
persistOnFlush在接口中EventSource- 指定者:
persistOnFlush在接口中SessionImplementor
-
merge
public Object merge(String entityName, Object object) throws HibernateException
从接口复制的说明: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.- 指定者:
merge在接口中Session- 参数:
entityName- The entity nameobject- a detached instance with state to be copied- 返回:
- an updated persistent instance
- 抛出:
HibernateException
-
merge
public Object merge(Object object) throws HibernateException
从接口复制的说明: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.- 指定者:
merge在接口中javax.persistence.EntityManager- 指定者:
merge在接口中Session- 参数:
object- a detached instance with state to be copied- 返回:
- an updated persistent instance
- 抛出:
HibernateException
-
merge
public void merge(String entityName, Object object, Map copiedAlready) throws HibernateException
从接口复制的说明:EventSourceCascade merge an entity instance- 指定者:
merge在接口中EventSource- 指定者:
merge在接口中SessionImplementor- 抛出:
HibernateException
-
delete
public void delete(Object object) throws HibernateException
从接口复制的说明: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在接口中Session- 参数:
object- the instance to be removed- 抛出:
HibernateException
-
delete
public void delete(String entityName, Object object) throws HibernateException
从接口复制的说明: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"- 指定者:
delete在接口中Session- 参数:
entityName- The entity name for the instance to be removed.object- the instance to be removed- 抛出:
HibernateException
-
delete
public void delete(String entityName, Object object, boolean isCascadeDeleteEnabled, Set transientEntities) throws HibernateException
从接口复制的说明:EventSourceCascade delete an entity instance- 指定者:
delete在接口中EventSource- 指定者:
delete在接口中SessionImplementor- 抛出:
HibernateException
-
removeOrphanBeforeUpdates
public void removeOrphanBeforeUpdates(String entityName, Object child)
从接口复制的说明:EventSourceA specialized type of deletion for orphan removal that must occur prior to queued inserts and updates.- 指定者:
removeOrphanBeforeUpdates在接口中EventSource- 指定者:
removeOrphanBeforeUpdates在接口中SessionImplementor
-
load
public void load(Object object, Serializable id) throws HibernateException
从接口复制的说明:SessionRead the persistent state associated with the given identifier into the given transient instance.- 指定者:
load在接口中Session- 参数:
object- an "empty" instance of the persistent classid- a valid identifier of an existing persistent instance of the class- 抛出:
HibernateException
-
load
public <T> T load(Class<T> entityClass, Serializable id) throws HibernateException
从接口复制的说明: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在接口中Session- 参数:
entityClass- a persistent classid- a valid identifier of an existing persistent instance of the class- 返回:
- the persistent instance or proxy
- 抛出:
HibernateException
-
load
public Object load(String entityName, Serializable id) throws HibernateException
从接口复制的说明: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在接口中Session- 指定者:
load在类中AbstractSharedSessionContract- 参数:
entityName- a persistent classid- a valid identifier of an existing persistent instance of the class- 返回:
- the persistent instance or proxy
- 抛出:
HibernateException
-
get
public <T> T get(Class<T> entityClass, Serializable id) throws HibernateException
从接口复制的说明: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在接口中Session- 参数:
entityClass- The entity typeid- an identifier- 返回:
- a persistent instance or null
- 抛出:
HibernateException
-
get
public Object get(String entityName, Serializable id) throws HibernateException
从接口复制的说明: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在接口中Session- 参数:
entityName- the entity nameid- an identifier- 返回:
- a persistent instance or null
- 抛出:
HibernateException
-
immediateLoad
public Object immediateLoad(String entityName, Serializable id) throws HibernateException
Load the data for the object with the specified id into a newly created object. This is only called when lazily initializing a proxy. Do NOT return a proxy.- 指定者:
immediateLoad在接口中SharedSessionContractImplementor- 抛出:
HibernateException
-
internalLoad
public final Object internalLoad(String entityName, Serializable id, boolean eager, boolean nullable)
从接口复制的说明: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- 指定者:
internalLoad在接口中SharedSessionContractImplementor
-
load
public <T> T load(Class<T> entityClass, Serializable id, LockMode lockMode) throws HibernateException
从接口复制的说明: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)- 指定者:
load在接口中Session- 参数:
entityClass- a persistent classid- a valid identifier of an existing persistent instance of the classlockMode- the lock level- 返回:
- the persistent instance or proxy
- 抛出:
HibernateException- 另请参阅:
Session.load(Class, Serializable, LockOptions)
-
load
public <T> T load(Class<T> entityClass, Serializable id, LockOptions lockOptions) throws HibernateException
从接口复制的说明:SessionReturn the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists.- 指定者:
load在接口中Session- 参数:
entityClass- a persistent classid- a valid identifier of an existing persistent instance of the classlockOptions- contains the lock level- 返回:
- the persistent instance or proxy
- 抛出:
HibernateException
-
load
public Object load(String entityName, Serializable id, LockMode lockMode) throws HibernateException
从接口复制的说明: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)- 指定者:
load在接口中Session- 参数:
entityName- a persistent classid- a valid identifier of an existing persistent instance of the classlockMode- the lock level- 返回:
- the persistent instance or proxy
- 抛出:
HibernateException- 另请参阅:
Session.load(String, Serializable, LockOptions)
-
load
public Object load(String entityName, Serializable id, LockOptions lockOptions) throws HibernateException
从接口复制的说明:SessionReturn the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists.- 指定者:
load在接口中Session- 参数:
entityName- a persistent classid- a valid identifier of an existing persistent instance of the classlockOptions- contains the lock level- 返回:
- the persistent instance or proxy
- 抛出:
HibernateException
-
get
public <T> T get(Class<T> entityClass, Serializable id, LockMode lockMode) throws HibernateException
从接口复制的说明: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)- 指定者:
get在接口中Session- 参数:
entityClass- The entity typeid- an identifierlockMode- the lock mode- 返回:
- a persistent instance or null
- 抛出:
HibernateException- 另请参阅:
Session.get(Class, Serializable, LockOptions)
-
get
public <T> T get(Class<T> entityClass, Serializable id, LockOptions lockOptions) throws HibernateException
从接口复制的说明: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在接口中Session- 参数:
entityClass- The entity typeid- an identifierlockOptions- the lock mode- 返回:
- a persistent instance or null
- 抛出:
HibernateException
-
get
public Object get(String entityName, Serializable id, LockMode lockMode) throws HibernateException
从接口复制的说明: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)- 指定者:
get在接口中Session- 参数:
entityName- the entity nameid- an identifierlockMode- the lock mode- 返回:
- a persistent instance or null
- 抛出:
HibernateException- 另请参阅:
Session.get(String, Serializable, LockOptions)
-
get
public Object get(String entityName, Serializable id, LockOptions lockOptions) throws HibernateException
从接口复制的说明: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在接口中Session- 参数:
entityName- the entity nameid- an identifierlockOptions- contains the lock mode- 返回:
- a persistent instance or null
- 抛出:
HibernateException
-
byId
public org.hibernate.internal.SessionImpl.IdentifierLoadAccessImpl byId(String entityName)
从接口复制的说明:SessionCreate anIdentifierLoadAccessinstance to retrieve the specified entity type by primary key.
-
byId
public <T> org.hibernate.internal.SessionImpl.IdentifierLoadAccessImpl<T> byId(Class<T> entityClass)
从接口复制的说明:SessionCreate anIdentifierLoadAccessinstance to retrieve the specified entity by primary key.
-
byMultipleIds
public <T> MultiIdentifierLoadAccess<T> byMultipleIds(Class<T> entityClass)
从接口复制的说明:SessionCreate aMultiIdentifierLoadAccessinstance to retrieve multiple entities at once as specified by primary key values.- 指定者:
byMultipleIds在接口中Session- 参数:
entityClass- The entity type to be retrieved- 返回:
- load delegate for loading the specified entity type by primary key values
-
byMultipleIds
public MultiIdentifierLoadAccess byMultipleIds(String entityName)
从接口复制的说明:SessionCreate aMultiIdentifierLoadAccessinstance to retrieve multiple entities at once as specified by primary key values.- 指定者:
byMultipleIds在接口中Session- 参数:
entityName- The entity name of the entity type to be retrieved- 返回:
- load delegate for loading the specified entity type by primary key values
-
byNaturalId
public NaturalIdLoadAccess byNaturalId(String entityName)
从接口复制的说明:SessionCreate aNaturalIdLoadAccessinstance to retrieve the specified entity by its natural id.- 指定者:
byNaturalId在接口中Session- 参数:
entityName- The entity name of the entity type to be retrieved- 返回:
- load delegate for loading the specified entity type by natural id
-
byNaturalId
public <T> NaturalIdLoadAccess<T> byNaturalId(Class<T> entityClass)
从接口复制的说明:SessionCreate aNaturalIdLoadAccessinstance to retrieve the specified entity by its natural id.- 指定者:
byNaturalId在接口中Session- 参数:
entityClass- The entity type to be retrieved- 返回:
- load delegate for loading the specified entity type by natural id
-
bySimpleNaturalId
public SimpleNaturalIdLoadAccess bySimpleNaturalId(String entityName)
从接口复制的说明:SessionCreate aSimpleNaturalIdLoadAccessinstance to retrieve the specified entity by its natural id.- 指定者:
bySimpleNaturalId在接口中Session- 参数:
entityName- The entity name of the entity type to be retrieved- 返回:
- load delegate for loading the specified entity type by natural id
-
bySimpleNaturalId
public <T> SimpleNaturalIdLoadAccess<T> bySimpleNaturalId(Class<T> entityClass)
从接口复制的说明:SessionCreate aSimpleNaturalIdLoadAccessinstance to retrieve the specified entity by its simple (single attribute) natural id.- 指定者:
bySimpleNaturalId在接口中Session- 参数:
entityClass- The entity type to be retrieved- 返回:
- load delegate for loading the specified entity type by natural id
-
refresh
public void refresh(Object object) throws HibernateException
从接口复制的说明: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在接口中javax.persistence.EntityManager- 指定者:
refresh在接口中Session- 参数:
object- a persistent or detached instance- 抛出:
HibernateException
-
refresh
public void refresh(String entityName, Object object) throws HibernateException
从接口复制的说明: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在接口中Session- 参数:
entityName- a persistent classobject- a persistent or detached instance- 抛出:
HibernateException
-
refresh
public void refresh(Object object, LockMode lockMode) throws HibernateException
从接口复制的说明: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)- 指定者:
refresh在接口中Session- 参数:
object- a persistent or detached instancelockMode- the lock mode to use- 抛出:
HibernateException- 另请参阅:
Session.refresh(Object, LockOptions)
-
refresh
public void refresh(Object object, LockOptions lockOptions) throws HibernateException
从接口复制的说明: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在接口中Session- 参数:
object- a persistent or detached instancelockOptions- contains the lock mode to use- 抛出:
HibernateException
-
refresh
public void refresh(String entityName, Object object, LockOptions lockOptions) throws HibernateException
从接口复制的说明: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在接口中Session- 参数:
entityName- a persistent classobject- a persistent or detached instancelockOptions- contains the lock mode to use- 抛出:
HibernateException
-
refresh
public void refresh(String entityName, Object object, Map refreshedAlready) throws HibernateException
从接口复制的说明:EventSourceCascade refresh an entity instance- 指定者:
refresh在接口中EventSource- 指定者:
refresh在接口中SessionImplementor- 抛出:
HibernateException
-
replicate
public void replicate(Object obj, ReplicationMode replicationMode) throws HibernateException
从接口复制的说明: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在接口中Session- 参数:
obj- a detached instance of a persistent classreplicationMode- The replication mode to use- 抛出:
HibernateException
-
replicate
public void replicate(String entityName, Object obj, ReplicationMode replicationMode) throws HibernateException
从接口复制的说明: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在接口中Session- 参数:
entityName- The entity nameobj- a detached instance of a persistent classreplicationMode- The replication mode to use- 抛出:
HibernateException
-
evict
public void evict(Object object) throws HibernateException
remove any hard references to the entity that are held by the infrastructure (references held by application or other persistent instances are okay)- 指定者:
evict在接口中Session- 参数:
object- The entity to evict- 抛出:
HibernateException
-
autoFlushIfRequired
protected boolean autoFlushIfRequired(Set querySpaces) throws HibernateException
detect in-memory changes, determine if the changes are to tables named in the query and, if so, complete execution the flush
-
isDirty
public boolean isDirty() throws HibernateException从接口复制的说明: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?- 指定者:
isDirty在接口中Session- 返回:
- True if the session contains pending changes; false otherwise.
- 抛出:
HibernateException- could not perform dirtying checking
-
flush
public void flush() throws HibernateException从接口复制的说明: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.- 指定者:
flush在接口中javax.persistence.EntityManager- 指定者:
flush在接口中Session- 指定者:
flush在接口中SharedSessionContractImplementor- 抛出:
HibernateException- Indicates problems flushing the session or talking to the database.
-
setFlushMode
public void setFlushMode(javax.persistence.FlushModeType flushModeType)
- 指定者:
setFlushMode在接口中javax.persistence.EntityManager
-
forceFlush
public void forceFlush(EntityEntry entityEntry) throws HibernateException
从接口复制的说明:EventSourceForce an immediate flush- 指定者:
forceFlush在接口中EventSource- 指定者:
forceFlush在接口中SessionImplementor- 抛出:
HibernateException
-
list
public List list(String query, QueryParameters queryParameters) throws HibernateException
从接口复制的说明:SharedSessionContractImplementorExecute a find() query- 指定者:
list在接口中SharedSessionContractImplementor- 抛出:
HibernateException
-
executeUpdate
public int executeUpdate(String query, QueryParameters queryParameters) throws HibernateException
从接口复制的说明:SharedSessionContractImplementorExecute a HQL update or delete query- 指定者:
executeUpdate在接口中SharedSessionContractImplementor- 抛出:
HibernateException
-
executeNativeUpdate
public int executeNativeUpdate(NativeSQLQuerySpecification nativeQuerySpecification, QueryParameters queryParameters) throws HibernateException
从接口复制的说明:SharedSessionContractImplementorExecute a native SQL update or delete query
-
iterate
public Iterator iterate(String query, QueryParameters queryParameters) throws HibernateException
从接口复制的说明:SharedSessionContractImplementorExecute an iterate() query- 指定者:
iterate在接口中SharedSessionContractImplementor- 抛出:
HibernateException
-
scroll
public ScrollableResultsImplementor scroll(String query, QueryParameters queryParameters) throws HibernateException
从接口复制的说明:SharedSessionContractImplementorExecute a scroll() query- 指定者:
scroll在接口中SharedSessionContractImplementor- 抛出:
HibernateException
-
createFilter
public Query createFilter(Object collection, String queryString)
从接口复制的说明: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.- 指定者:
createFilter在接口中Session- 参数:
collection- a persistent collectionqueryString- a Hibernate query fragment.- 返回:
- The query instance for manipulation and execution
-
instantiate
public Object instantiate(String entityName, Serializable id) throws HibernateException
从接口复制的说明:SharedSessionContractImplementorInstantiate the entity class, initializing with the given identifier- 指定者:
instantiate在接口中SharedSessionContractImplementor- 抛出:
HibernateException
-
instantiate
public Object instantiate(EntityPersister persister, Serializable id) throws HibernateException
give the interceptor an opportunity to override the default instantiation- 指定者:
instantiate在接口中EventSource- 指定者:
instantiate在接口中SessionImplementor- 抛出:
HibernateException
-
getEntityPersister
public EntityPersister getEntityPersister(String entityName, Object object)
从接口复制的说明:SharedSessionContractImplementorGet the EntityPersister for any instance- 指定者:
getEntityPersister在接口中SharedSessionContractImplementor- 参数:
entityName- optional entity nameobject- the entity instance
-
getIdentifier
public Serializable getIdentifier(Object object) throws HibernateException
从接口复制的说明: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.- 指定者:
getIdentifier在接口中Session- 参数:
object- a persistent instance- 返回:
- the identifier
- 抛出:
TransientObjectException- if the instance is transient or associated with a different sessionHibernateException
-
getContextEntityIdentifier
public Serializable getContextEntityIdentifier(Object object)
Get the id value for an object that is actually associated with the session. This is a bit stricter than getEntityIdentifierIfNotUnsaved().
-
listFilter
public List listFilter(Object collection, String filter, QueryParameters queryParameters)
从接口复制的说明:SharedSessionContractImplementorExecute a filter- 指定者:
listFilter在接口中SharedSessionContractImplementor
-
iterateFilter
public Iterator iterateFilter(Object collection, String filter, QueryParameters queryParameters)
从接口复制的说明:SharedSessionContractImplementorIterate a filter
-
createCriteria
public Criteria createCriteria(Class persistentClass, String alias)
从接口复制的说明:SharedSessionContractCreateCriteriainstance for the given class (entity or subclasses/implementors), using a specific alias.- 指定者:
createCriteria在接口中SharedSessionContract- 参数:
persistentClass- The class, which is an entity, or has entity subclasses/implementorsalias- The alias to use- 返回:
- The criteria instance for manipulation and execution
-
createCriteria
public Criteria createCriteria(String entityName, String alias)
从接口复制的说明:SharedSessionContractCreateCriteriainstance for the given entity name, using a specific alias.- 指定者:
createCriteria在接口中SharedSessionContract- 参数:
entityName- The entity namealias- The alias to use- 返回:
- The criteria instance for manipulation and execution
-
createCriteria
public Criteria createCriteria(Class persistentClass)
从接口复制的说明:SharedSessionContractCreateCriteriainstance for the given class (entity or subclasses/implementors).- 指定者:
createCriteria在接口中SharedSessionContract- 参数:
persistentClass- The class, which is an entity, or has entity subclasses/implementors- 返回:
- The criteria instance for manipulation and execution
-
createCriteria
public Criteria createCriteria(String entityName)
从接口复制的说明:SharedSessionContractCreateCriteriainstance for the given entity name.- 指定者:
createCriteria在接口中SharedSessionContract- 参数:
entityName- The entity name- 返回:
- The criteria instance for manipulation and execution
-
scroll
public ScrollableResultsImplementor scroll(Criteria criteria, ScrollMode scrollMode)
从接口复制的说明:SharedSessionContractImplementorExecute a criteria query- 指定者:
scroll在接口中SharedSessionContractImplementor
-
list
public List list(Criteria criteria) throws HibernateException
从接口复制的说明:SharedSessionContractImplementorExecute a criteria query- 指定者:
list在接口中SharedSessionContractImplementor- 抛出:
HibernateException
-
contains
public boolean contains(Object object)
- 指定者:
contains在接口中javax.persistence.EntityManager
-
contains
public boolean contains(String entityName, Object object)
从接口复制的说明: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
-
createStoredProcedureCall
public ProcedureCall createStoredProcedureCall(String procedureName)
从接口复制的说明:SharedSessionContractCreates a call to a stored procedure.- 指定者:
createStoredProcedureCall在接口中SharedSessionContract- 覆盖:
createStoredProcedureCall在类中AbstractSharedSessionContract- 参数:
procedureName- The name of the procedure.- 返回:
- The representation of the procedure call.
-
createStoredProcedureCall
public ProcedureCall createStoredProcedureCall(String procedureName, String... resultSetMappings)
从接口复制的说明:SharedSessionContractCreates a call to a stored procedure with specific result set entity mappings.- 指定者:
createStoredProcedureCall在接口中SharedSessionContract- 覆盖:
createStoredProcedureCall在类中AbstractSharedSessionContract- 参数:
procedureName- The name of the procedure.resultSetMappings- The explicit result set mapping(s) to use for mapping the results- 返回:
- The representation of the procedure call.
-
createStoredProcedureCall
public ProcedureCall createStoredProcedureCall(String procedureName, Class... resultClasses)
从接口复制的说明:SharedSessionContractCreates a call to a stored procedure with specific result set entity mappings. Each class named is considered a "root return".- 指定者:
createStoredProcedureCall在接口中SharedSessionContract- 覆盖:
createStoredProcedureCall在类中AbstractSharedSessionContract- 参数:
procedureName- The name of the procedure.resultClasses- The entity(s) to map the result on to.- 返回:
- The representation of the procedure call.
-
scrollCustomQuery
public ScrollableResultsImplementor scrollCustomQuery(CustomQuery customQuery, QueryParameters queryParameters)
从接口复制的说明:SharedSessionContractImplementorExecute an SQL Query
-
listCustomQuery
public List listCustomQuery(CustomQuery customQuery, QueryParameters queryParameters)
从接口复制的说明:SharedSessionContractImplementorExecute an SQL Query
-
getSessionFactory
public SessionFactoryImplementor getSessionFactory()
从接口复制的说明:SessionGet the session factory which created this session.- 指定者:
getSessionFactory在接口中Session- 指定者:
getSessionFactory在接口中SessionImplementor- 返回:
- The session factory.
- 另请参阅:
SessionFactory
-
initializeCollection
public void initializeCollection(PersistentCollection collection, boolean writing)
从接口复制的说明:SharedSessionContractImplementorInitialize the collection (if not already initialized)
-
bestGuessEntityName
public String bestGuessEntityName(Object object)
从接口复制的说明:SharedSessionContractImplementorThe best guess entity name for an entity not in an association
-
getEntityName
public String getEntityName(Object object)
从接口复制的说明:SessionReturn the entity name for a persistent entity.- 指定者:
getEntityName在接口中Session- 参数:
object- a persistent entity- 返回:
- the entity name
-
guessEntityName
public String guessEntityName(Object object) throws HibernateException
从接口复制的说明:SharedSessionContractImplementorThe guessed entity name for an entity not in an association
-
cancelQuery
public void cancelQuery() throws HibernateException从接口复制的说明:SessionCancel the execution of the current query. This is the sole method on session which may be safely called from another thread.- 指定者:
cancelQuery在接口中Session- 抛出:
HibernateException- There was a problem canceling the query
-
getDontFlushFromFind
public int getDontFlushFromFind()
-
getActionQueue
public ActionQueue getActionQueue()
从接口复制的说明:EventSourceGet the ActionQueue for this session- 指定者:
getActionQueue在接口中EventSource- 指定者:
getActionQueue在接口中SessionImplementor
-
getPersistenceContext
public PersistenceContext getPersistenceContext()
从接口复制的说明: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.
-
getPersistenceContextInternal
public PersistenceContext getPersistenceContextInternal()
从接口复制的说明: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.- 指定者:
getPersistenceContextInternal在接口中SharedSessionContractImplementor- 返回:
- the PersistenceContext associated to this session.
-
getStatistics
public SessionStatistics getStatistics()
从接口复制的说明:SessionGet the statistics for this session.- 指定者:
getStatistics在接口中Session- 返回:
- The session statistics being collected for this session
-
isEventSource
public boolean isEventSource()
-
isDefaultReadOnly
public boolean isDefaultReadOnly()
从接口复制的说明: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:- 指定者:
isDefaultReadOnly在接口中Session- 返回:
- true, loaded entities/proxies will be made read-only by default; false, loaded entities/proxies will be made modifiable by default.
- 另请参阅:
Session.isReadOnly(Object)
-
setDefaultReadOnly
public void setDefaultReadOnly(boolean defaultReadOnly)
从接口复制的说明: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:- 指定者:
setDefaultReadOnly在接口中Session- 参数:
defaultReadOnly- true, the default for loaded entities/proxies is read-only; false, the default for loaded entities/proxies is modifiable- 另请参阅:
To override this session's read-only/modifiable setting for entities and proxies loaded by a Query:,Query.setReadOnly(boolean)
-
isReadOnly
public boolean isReadOnly(Object entityOrProxy)
从接口复制的说明: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:- 指定者:
isReadOnly在接口中Session- 参数:
entityOrProxy- an entity or HibernateProxy- 返回:
trueif the entity or proxy is read-only,falseif the entity or proxy is modifiable.- 另请参阅:
Session.isDefaultReadOnly()
-
setReadOnly
public void setReadOnly(Object entity, boolean readOnly)
从接口复制的说明: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:- 指定者:
setReadOnly在接口中Session- 参数:
entity- an entity or HibernateProxyreadOnly-trueif the entity or proxy should be made read-only;falseif the entity or proxy should be made modifiable- 另请参阅:
To override this session's read-only/modifiable setting for entities and proxies loaded by a Query:,Query.setReadOnly(boolean)
-
afterScrollOperation
public void afterScrollOperation()
-
getLoadQueryInfluencers
public LoadQueryInfluencers getLoadQueryInfluencers()
从接口复制的说明:SharedSessionContractImplementorGet the load query influencers associated with this session.- 指定者:
getLoadQueryInfluencers在接口中SharedSessionContractImplementor- 返回:
- the load query influencers associated with this session; should never be null.
-
getEnabledFilter
public Filter getEnabledFilter(String filterName)
从接口复制的说明:SessionRetrieve a currently enabled filter by name.- 指定者:
getEnabledFilter在接口中Session- 参数:
filterName- The name of the filter to be retrieved.- 返回:
- The Filter instance representing the enabled filter.
-
enableFilter
public Filter enableFilter(String filterName)
从接口复制的说明:SessionEnable the named filter for this current session.- 指定者:
enableFilter在接口中Session- 参数:
filterName- The name of the filter to be enabled.- 返回:
- The Filter instance representing the enabled filter.
-
disableFilter
public void disableFilter(String filterName)
从接口复制的说明:SessionDisable the named filter for the current session.- 指定者:
disableFilter在接口中Session- 参数:
filterName- The name of the filter to be disabled.
-
isFetchProfileEnabled
public boolean isFetchProfileEnabled(String name) throws UnknownProfileException
从接口复制的说明:SessionIs a particular fetch profile enabled on this session?- 指定者:
isFetchProfileEnabled在接口中Session- 参数:
name- The name of the profile to be checked.- 返回:
- True if fetch profile is enabled; false if not.
- 抛出:
UnknownProfileException- Indicates that the given name does not match any known profile names- 另请参阅:
for discussion of this feature
-
enableFetchProfile
public void enableFetchProfile(String name) throws UnknownProfileException
从接口复制的说明:SessionEnable a particular fetch profile on this session. No-op if requested profile is already enabled.- 指定者:
enableFetchProfile在接口中Session- 参数:
name- The name of the fetch profile to be enabled.- 抛出:
UnknownProfileException- Indicates that the given name does not match any known profile names- 另请参阅:
for discussion of this feature
-
disableFetchProfile
public void disableFetchProfile(String name) throws UnknownProfileException
从接口复制的说明:SessionDisable a particular fetch profile on this session. No-op if requested profile is already disabled.- 指定者:
disableFetchProfile在接口中Session- 参数:
name- The name of the fetch profile to be disabled.- 抛出:
UnknownProfileException- Indicates that the given name does not match any known profile names- 另请参阅:
for discussion of this feature
-
getTypeHelper
public TypeHelper getTypeHelper()
从接口复制的说明:SessionConvenience access to theTypeHelperassociated with this session'sSessionFactory. Equivalent to callingSession.getSessionFactory().getTypeHelper()- 指定者:
getTypeHelper在接口中Session- 返回:
- The
TypeHelperassociated with this session'sSessionFactory
-
getLobHelper
public LobHelper getLobHelper()
从接口复制的说明:SessionRetrieve this session's helper/delegate for creating LOB instances.- 指定者:
getLobHelper在接口中Session- 返回:
- This session's LOB helper
-
beforeTransactionCompletion
public void beforeTransactionCompletion()
从接口复制的说明:JdbcSessionOwnerA before-completion callback to the owner.
-
afterTransactionCompletion
public void afterTransactionCompletion(boolean successful, boolean delayed)从接口复制的说明:JdbcSessionOwnerAn after-completion callback to the owner.- 指定者:
afterTransactionCompletion在接口中JdbcSessionOwner- 覆盖:
afterTransactionCompletion在类中AbstractSharedSessionContract- 参数:
successful- Was the transaction successful?delayed- Is this a delayed after transaction completion call (aka after a timeout)?
-
addSharedSessionTransactionObserver
protected void addSharedSessionTransactionObserver(TransactionCoordinator transactionCoordinator)
-
removeSharedSessionTransactionObserver
protected void removeSharedSessionTransactionObserver(TransactionCoordinator transactionCoordinator)
-
startTransactionBoundary
public void startTransactionBoundary()
从接口复制的说明: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
-
afterTransactionBegin
public void afterTransactionBegin()
从接口复制的说明:JdbcSessionOwnerA after-begin callback from the coordinator to its owner.- 指定者:
afterTransactionBegin在接口中JdbcSessionOwner
-
flushBeforeTransactionCompletion
public void flushBeforeTransactionCompletion()
-
isFlushBeforeCompletionEnabled
public boolean isFlushBeforeCompletionEnabled()
-
getSession
public SessionImplementor getSession()
从接口复制的说明:HibernateEntityManagerRetrieve a reference to the HibernateSessionused by thisEntityManager.- 指定者:
getSession在接口中HibernateEntityManager- 指定者:
getSession在接口中HibernateEntityManagerImplementor- 返回:
- The session
-
getLockRequest
public LockOptions getLockRequest(javax.persistence.LockModeType lockModeType, Map<String,Object> properties)
从接口复制的说明:HibernateEntityManagerImplementorConvert from JPA 2LockModeType& properties intoLockOptions- 指定者:
getLockRequest在接口中HibernateEntityManagerImplementor- 参数:
lockModeType- is the requested lock typeproperties- are the lock properties- 返回:
- the LockOptions
-
remove
public void remove(Object entity)
- 指定者:
remove在接口中javax.persistence.EntityManager
-
find
public <T> T find(Class<T> entityClass, Object primaryKey)
- 指定者:
find在接口中javax.persistence.EntityManager
-
find
public <T> T find(Class<T> entityClass, Object primaryKey, Map<String,Object> properties)
- 指定者:
find在接口中javax.persistence.EntityManager
-
find
public <T> T find(Class<T> entityClass, Object primaryKey, javax.persistence.LockModeType lockModeType)
- 指定者:
find在接口中javax.persistence.EntityManager
-
find
public <T> T find(Class<T> entityClass, Object primaryKey, javax.persistence.LockModeType lockModeType, Map<String,Object> properties)
- 指定者:
find在接口中javax.persistence.EntityManager
-
determineAppropriateLocalCacheMode
protected CacheMode determineAppropriateLocalCacheMode(Map<String,Object> localProperties)
-
getReference
public <T> T getReference(Class<T> entityClass, Object primaryKey)
- 指定者:
getReference在接口中javax.persistence.EntityManager
-
lock
public void lock(Object entity, javax.persistence.LockModeType lockModeType)
- 指定者:
lock在接口中javax.persistence.EntityManager
-
lock
public void lock(Object entity, javax.persistence.LockModeType lockModeType, Map<String,Object> properties)
- 指定者:
lock在接口中javax.persistence.EntityManager
-
refresh
public void refresh(Object entity, Map<String,Object> properties)
- 指定者:
refresh在接口中javax.persistence.EntityManager
-
refresh
public void refresh(Object entity, javax.persistence.LockModeType lockModeType)
- 指定者:
refresh在接口中javax.persistence.EntityManager
-
refresh
public void refresh(Object entity, javax.persistence.LockModeType lockModeType, Map<String,Object> properties)
- 指定者:
refresh在接口中javax.persistence.EntityManager
-
detach
public void detach(Object entity)
- 指定者:
detach在接口中javax.persistence.EntityManager
-
getLockMode
public javax.persistence.LockModeType getLockMode(Object entity)
- 指定者:
getLockMode在接口中javax.persistence.EntityManager
-
setProperty
public void setProperty(String propertyName, Object value)
- 指定者:
setProperty在接口中javax.persistence.EntityManager
-
getProperties
public Map<String,Object> getProperties()
- 指定者:
getProperties在接口中javax.persistence.EntityManager
-
initQueryFromNamedDefinition
protected void initQueryFromNamedDefinition(Query query, NamedQueryDefinition namedQueryDefinition)
-
createNamedStoredProcedureQuery
public javax.persistence.StoredProcedureQuery createNamedStoredProcedureQuery(String name)
- 指定者:
createNamedStoredProcedureQuery在接口中javax.persistence.EntityManager
-
createStoredProcedureQuery
public javax.persistence.StoredProcedureQuery createStoredProcedureQuery(String procedureName)
- 指定者:
createStoredProcedureQuery在接口中javax.persistence.EntityManager
-
createStoredProcedureQuery
public javax.persistence.StoredProcedureQuery createStoredProcedureQuery(String procedureName, Class... resultClasses)
- 指定者:
createStoredProcedureQuery在接口中javax.persistence.EntityManager
-
createStoredProcedureQuery
public javax.persistence.StoredProcedureQuery createStoredProcedureQuery(String procedureName, String... resultSetMappings)
- 指定者:
createStoredProcedureQuery在接口中javax.persistence.EntityManager
-
joinTransaction
public void joinTransaction()
- 指定者:
joinTransaction在接口中javax.persistence.EntityManager
-
isJoinedToTransaction
public boolean isJoinedToTransaction()
- 指定者:
isJoinedToTransaction在接口中javax.persistence.EntityManager
-
unwrap
public <T> T unwrap(Class<T> clazz)
- 指定者:
unwrap在接口中javax.persistence.EntityManager
-
getDelegate
public Object getDelegate()
- 指定者:
getDelegate在接口中javax.persistence.EntityManager
-
getEntityManagerFactory
public SessionFactoryImplementor getEntityManagerFactory()
- 指定者:
getEntityManagerFactory在接口中javax.persistence.EntityManager
-
getCriteriaBuilder
public javax.persistence.criteria.CriteriaBuilder getCriteriaBuilder()
- 指定者:
getCriteriaBuilder在接口中javax.persistence.EntityManager
-
getMetamodel
public MetamodelImplementor getMetamodel()
- 指定者:
getMetamodel在接口中javax.persistence.EntityManager
-
createEntityGraph
public <T> RootGraphImplementor<T> createEntityGraph(Class<T> rootType)
- 指定者:
createEntityGraph在接口中javax.persistence.EntityManager- 指定者:
createEntityGraph在接口中Session- 指定者:
createEntityGraph在接口中SessionImplementor
-
createEntityGraph
public RootGraphImplementor<?> createEntityGraph(String graphName)
- 指定者:
createEntityGraph在接口中javax.persistence.EntityManager- 指定者:
createEntityGraph在接口中Session- 指定者:
createEntityGraph在接口中SessionImplementor
-
getEntityGraph
public RootGraphImplementor<?> getEntityGraph(String graphName)
- 指定者:
getEntityGraph在接口中javax.persistence.EntityManager- 指定者:
getEntityGraph在接口中Session- 指定者:
getEntityGraph在接口中SessionImplementor
-
getEntityGraphs
public List getEntityGraphs(Class entityClass)
- 指定者:
getEntityGraphs在接口中javax.persistence.EntityManager- 指定者:
getEntityGraphs在接口中Session
-
getFetchGraphLoadContext
public GraphImplementor getFetchGraphLoadContext()
从接口复制的说明:SharedSessionContractImplementorGet the current fetch graph context (eitherRootGraphImplementororSubGraphImplementor. Suppose fetch graph is "a(b(c))", then duringTwoPhaseLoad:- 指定者:
getFetchGraphLoadContext在接口中SharedSessionContractImplementor- 返回:
- current fetch graph context; can be null if fetch graph is not effective or the graph eager loading is done.
- 另请参阅:
SharedSessionContractImplementor.setFetchGraphLoadContext(GraphImplementor),TwoPhaseLoad
-
setFetchGraphLoadContext
public void setFetchGraphLoadContext(GraphImplementor fetchGraphLoadContext)
从接口复制的说明:SharedSessionContractImplementorSet the current fetch graph context (eitherRootGraphImplementororSubGraphImplementor.- 指定者:
setFetchGraphLoadContext在接口中SharedSessionContractImplementor- 参数:
fetchGraphLoadContext- new fetch graph context; can be null (this field will be set to null after root entity loading is done).- 另请参阅:
SharedSessionContractImplementor.getFetchGraphLoadContext()
-
-