类 SessionDelegatorBaseImpl
- java.lang.Object
-
- org.hibernate.engine.spi.SessionDelegatorBaseImpl
-
- 所有已实现的接口:
Closeable,Serializable,AutoCloseable,javax.persistence.EntityManager,HibernateEntityManager,LobCreationContext,SessionImplementor,SharedSessionContractImplementor,HibernateEntityManager,HibernateEntityManagerFactoryAware,HibernateEntityManagerImplementor,QueryProducer,QueryProducerImplementor,JdbcSessionOwner,TransactionCoordinatorBuilder.Options,Session,SharedSessionContract,WrapperOptions
public class SessionDelegatorBaseImpl extends 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).- 作者:
- Sanne Grinovero
(C) 2012 Red Hat Inc. - 另请参阅:
- 序列化表格
-
-
嵌套类概要
-
从接口继承的嵌套类/接口 org.hibernate.jpa.spi.HibernateEntityManagerImplementor
HibernateEntityManagerImplementor.QueryOptions
-
从接口继承的嵌套类/接口 org.hibernate.engine.jdbc.LobCreationContext
LobCreationContext.Callback<T>
-
从接口继承的嵌套类/接口 org.hibernate.Session
Session.LockRequest
-
-
字段概要
字段 修饰符和类型 字段 说明 protected SessionImplementordelegate
-
构造器概要
构造器 构造器 说明 SessionDelegatorBaseImpl(SessionImplementor delegate)SessionDelegatorBaseImpl(SessionImplementor delegate, Session session)已过时。(since 5.3) SessionDelegatorBaseImpl should take just one argument, the SessionImplementor.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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.StringbestGuessEntityName(Object object)The best guess entity name for an entity not in an associationLockOptionsbuildLockOptions(javax.persistence.LockModeType lockModeType, Map<String,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(Class<T> entityClass)Create anIdentifierLoadAccessinstance to retrieve the specified entity by primary key.IdentifierLoadAccessbyId(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.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(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.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.QueryImplementorcreateNamedQuery(String name)The JPA-defined named query creation method.<T> QueryImplementor<T>createNamedQuery(String name, Class<T> resultClass)The JPA-defined named, typed query creation method.javax.persistence.StoredProcedureQuerycreateNamedStoredProcedureQuery(String name)NativeQueryImplementorcreateNativeQuery(String sqlString)Create a NativeQuery instance for the given native (SQL) queryNativeQueryImplementorcreateNativeQuery(String sqlString, Class resultClass)Create a NativeQuery instance for the given native (SQL) query using implicit mapping to the specified Java type.NativeQueryImplementorcreateNativeQuery(String sqlString, String resultSetMapping)Create a NativeQuery instance for the given native (SQL) query using implicit mapping to the specified Java type.QueryImplementorcreateQuery(String queryString)Create aQueryinstance for the given HQL/JPQL query string.<T> QueryImplementor<T>createQuery(String queryString, Class<T> resultType)Create a typedQueryinstance for the given HQL/JPQL query string.<T> QueryImplementor<T>createQuery(String jpaqlString, Class<T> resultClass, javax.persistence.criteria.Selection selection, HibernateEntityManagerImplementor.QueryOptions queryOptions)Used during "compiling" a JPA criteria query.QueryImplementorcreateQuery(javax.persistence.criteria.CriteriaDelete deleteQuery)<T> QueryImplementor<T>createQuery(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery)QueryImplementorcreateQuery(javax.persistence.criteria.CriteriaUpdate updateQuery)NativeQueryImplementorcreateSQLQuery(String queryString)Create aNativeQueryinstance for the given SQL query string.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 SessionImplementordelegate()Returns the underlying delegate.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 child, boolean isCascadeDeleteEnabled, Set transientEntities)voiddetach(Object entity)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.<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(String name)Enable a particular fetch profile on this session.FilterenableFilter(String filterName)Enable the named filter for this current session.voidevict(Object object)Remove this instance from the session cache.<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(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 lockMode)<T> Tfind(Class<T> entityClass, Object primaryKey, javax.persistence.LockModeType lockMode, Map<String,Object> properties)voidflush()Force this session to flush.voidflushBeforeTransactionCompletion()voidforceFlush(EntityEntry e)EntityKeygenerateEntityKey(Serializable id, EntityPersister persister)Hide the changing requirements of entity key creation<T> Tget(Class<T> theClass, 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> theClass, 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> theClass, 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()CacheModegetCacheMode()Get the current cache mode.CacheTransactionSynchronizationgetCacheTransactionSynchronization()The current CacheTransactionContext associated with the Session.SerializablegetContextEntityIdentifier(Object object)Return the identifier of the persistent object, or null if not associated with the sessionjavax.persistence.criteria.CriteriaBuildergetCriteriaBuilder()LockModegetCurrentLockMode(Object object)Determine the current lock mode of the given object.ObjectgetDelegate()This is an implementation of EntityManager#getDelegate().intgetDontFlushFromFind()FiltergetEnabledFilter(String filterName)Retrieve a currently enabled filter by name.RootGraphImplementor<?>getEntityGraph(String graphName)<T> List<javax.persistence.EntityGraph<? super T>>getEntityGraphs(Class<T> entityClass)javax.persistence.EntityManagerFactorygetEntityManagerFactory()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 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 SessionFactoryImplementorjavax.persistence.FlushModeTypegetFlushMode()FlushModegetHibernateFlushMode()Get the current flush mode for this session.SerializablegetIdentifier(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.IntegergetJdbcBatchSize()Get the Session-level JDBC batch size for the current Session.JdbcConnectionAccessgetJdbcConnectionAccess()JdbcCoordinatorgetJdbcCoordinator()JdbcServicesgetJdbcServices()JdbcSessionContextgetJdbcSessionContext()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.javax.persistence.LockModeTypegetLockMode(Object entity)LockOptionsgetLockRequest(javax.persistence.LockModeType lockModeType, Map<String,Object> properties)Convert from JPA 2LockModeType& properties intoLockOptionsjavax.persistence.metamodel.MetamodelgetMetamodel()NativeQueryImplementorgetNamedNativeQuery(String name)Get a NativeQuery instance for a named native SQL queryProcedureCallgetNamedProcedureCall(String name)Gets a ProcedureCall based on a named templateQueryImplementorgetNamedQuery(String name)Create aQueryinstance for the named query.NativeQueryImplementorgetNamedSQLQuery(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.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.UUIDgetSessionIdentifier()A UUID associated with each Session.SessionStatisticsgetStatistics()Get the statistics for this session.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.StringguessEntityName(Object entity)The guessed entity name for an entity not in an associationObjectimmediateLoad(String entityName, Serializable id)Load an instance immediately.voidinitializeCollection(PersistentCollection collection, boolean writing)Initialize the collection (if not already initialized)Objectinstantiate(String entityName, Serializable id)Instantiate the entity class, initializing with the given identifierObjectinstantiate(EntityPersister persister, Serializable id)ObjectinternalLoad(String entityName, 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?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.booleanisOpenOrWaitingForAutoClose()Checks whether the session is open or is waiting for auto-closebooleanisQueryParametersValidationEnabled()booleanisReadOnly(Object entityOrProxy)Is the specified entity or proxy read-only?booleanisTransactionInProgress()Does this Session have an active Hibernate transaction or is there a JTA transaction in progress?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 queryListlist(NativeSQLQuerySpecification spec, QueryParameters queryParameters)Execute a native SQL query, and return the results as a fully built list.ListlistCustomQuery(CustomQuery customQuery, QueryParameters queryParameters)Execute an SQL QueryListlistFilter(Object collection, String filter, QueryParameters queryParameters)Execute a filter<T> Tload(Class<T> theClass, Serializable id)Return the persistent instance of the given entity class with the given identifier, assuming that the instance exists.<T> Tload(Class<T> theClass, Serializable id, LockMode lockMode)Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists.<T> Tload(Class<T> theClass, Serializable id, LockOptions lockOptions)Return the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists.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 lockMode)voidlock(Object entity, javax.persistence.LockModeType lockMode, 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.voidmarkForRollbackOnly()Marks current transaction (if one) for rollback onlyObjectmerge(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)voidpersist(Object object)Make a transient instance persistent.voidpersist(String entityName, Object object)Make a transient instance persistent.voidpersist(String entityName, Object object, Map createdAlready)voidpersistOnFlush(String entityName, Object object, Map copiedAlready)voidreconnect(Connection connection)Reconnect to the given JDBC connection.voidrefresh(Object object)Re-read the state of the given instance from the underlying database.voidrefresh(Object entity, Map<String,Object> properties)voidrefresh(Object entity, javax.persistence.LockModeType lockMode)voidrefresh(Object entity, javax.persistence.LockModeType lockMode, 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)voidrefresh(String entityName, 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(Object entity)voidremoveOrphanBeforeUpdates(String entityName, Object child)voidreplicate(Object object, ReplicationMode replicationMode)Persist the state of the given detached instance, reusing the current identifier value.voidreplicate(String entityName, Object object, ReplicationMode replicationMode)Persist the state of the given detached instance, reusing the current identifier value.Serializablesave(Object object)Persist the given transient instance, first assigning a generated identifier.Serializablesave(String entityName, Object object)Persist the given transient instance, first assigning a generated identifier.voidsaveOrUpdate(Object object)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 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(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(javax.persistence.FlushModeType flushModeType)voidsetFlushMode(FlushMode fm)Set the flush mode for this session.voidsetHibernateFlushMode(FlushMode flushMode)Set the flush mode for this session.voidsetJdbcBatchSize(Integer jdbcBatchSize)Set the Session-level JDBC batch size.voidsetProperty(String propertyName, Object value)voidsetReadOnly(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(Class<T> cls)voidupdate(Object object)Update the persistent instance with the identifier of the given detached instance.voidupdate(String entityName, Object object)Update the persistent instance with the identifier of the given detached instance.booleanuseStreamForLobBinding()Should streams be used for binding LOB values.-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 org.hibernate.engine.spi.SharedSessionContractImplementor
getConfiguredJdbcBatchSize, getFetchGraphLoadContext, setFetchGraphLoadContext
-
-
-
-
字段详细资料
-
delegate
protected final SessionImplementor delegate
-
-
构造器详细资料
-
SessionDelegatorBaseImpl
@Deprecated public SessionDelegatorBaseImpl(SessionImplementor delegate, Session session)
已过时。(since 5.3) SessionDelegatorBaseImpl should take just one argument, the SessionImplementor. Use theSessionDelegatorBaseImpl(SessionImplementor)form instead
-
SessionDelegatorBaseImpl
public SessionDelegatorBaseImpl(SessionImplementor delegate)
-
-
方法详细资料
-
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.- 另请参阅:
getDelegate()
-
execute
public <T> T execute(LobCreationContext.Callback<T> callback)
从接口复制的说明:LobCreationContextExecute the given callback, making sure it has access to a viable JDBCConnection.- 指定者:
execute在接口中LobCreationContext- 类型参数:
T- The Java type of the type of LOB being created. One ofBlob,Clob,NClob- 参数:
callback- The callback to execute .- 返回:
- The LOB created by the callback.
-
getTenantIdentifier
public String getTenantIdentifier()
从接口复制的说明:SharedSessionContractObtain the tenant identifier associated with this session.- 指定者:
getTenantIdentifier在接口中SharedSessionContract- 指定者:
getTenantIdentifier在接口中SharedSessionContractImplementor- 返回:
- The tenant identifier associated with this session, or
null
-
getSessionIdentifier
public UUID getSessionIdentifier()
从接口复制的说明:SharedSessionContractImplementorA UUID associated with each Session. Useful mainly for logging.- 指定者:
getSessionIdentifier在接口中SharedSessionContractImplementor- 返回:
- The UUID
-
getJdbcConnectionAccess
public JdbcConnectionAccess getJdbcConnectionAccess()
- 指定者:
getJdbcConnectionAccess在接口中JdbcSessionOwner
-
generateEntityKey
public EntityKey generateEntityKey(Serializable id, EntityPersister persister)
从接口复制的说明:SharedSessionContractImplementorHide the changing requirements of entity key creation- 指定者:
generateEntityKey在接口中SharedSessionContractImplementor- 参数:
id- The entity idpersister- The entity persister- 返回:
- The entity key
-
getInterceptor
public Interceptor getInterceptor()
从接口复制的说明:SharedSessionContractImplementorRetrieves the interceptor currently in use by this event source.- 指定者:
getInterceptor在接口中SharedSessionContractImplementor- 返回:
- The interceptor.
-
setAutoClear
public void setAutoClear(boolean enabled)
从接口复制的说明:SharedSessionContractImplementorEnable/disable automatic cache clearing from after transaction completion (for EJB3)- 指定者:
setAutoClear在接口中SharedSessionContractImplementor
-
isTransactionInProgress
public boolean isTransactionInProgress()
从接口复制的说明:SharedSessionContractImplementorDoes this Session have an active Hibernate transaction or is there a JTA transaction in progress?- 指定者:
isTransactionInProgress在接口中HibernateEntityManagerImplementor- 指定者:
isTransactionInProgress在接口中SharedSessionContractImplementor- 返回:
- True if a transaction is considered currently in progress; false otherwise.
-
checkTransactionNeededForUpdateOperation
public void checkTransactionNeededForUpdateOperation(String exceptionMessage)
从接口复制的说明: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.- 指定者:
checkTransactionNeededForUpdateOperation在接口中SharedSessionContractImplementor- 参数:
exceptionMessage- the message to use for the TransactionRequiredException
-
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
-
buildLockOptions
public LockOptions buildLockOptions(javax.persistence.LockModeType lockModeType, Map<String,Object> properties)
从接口复制的说明:HibernateEntityManagerImplementorGiven a JPALockModeTypeand properties, build a HibernateLockOptions- 指定者:
buildLockOptions在接口中HibernateEntityManagerImplementor- 参数:
lockModeType- the requested LockModeTypeproperties- the lock properties- 返回:
- the LockOptions
-
createQuery
public <T> QueryImplementor<T> createQuery(String jpaqlString, Class<T> resultClass, javax.persistence.criteria.Selection selection, HibernateEntityManagerImplementor.QueryOptions queryOptions)
从接口复制的说明:SessionImplementorUsed during "compiling" a JPA criteria query.- 指定者:
createQuery在接口中HibernateEntityManagerImplementor- 指定者:
createQuery在接口中SessionImplementor- 指定者:
createQuery在接口中SharedSessionContractImplementor- 类型参数:
T- The query type- 参数:
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.- 返回:
- The typed query
-
initializeCollection
public void initializeCollection(PersistentCollection collection, boolean writing) throws HibernateException
从接口复制的说明:SharedSessionContractImplementorInitialize the collection (if not already initialized)
-
internalLoad
public Object internalLoad(String entityName, Serializable id, boolean eager, boolean nullable) throws HibernateException
从接口复制的说明: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- 抛出:
HibernateException
-
immediateLoad
public Object immediateLoad(String entityName, Serializable id) throws HibernateException
从接口复制的说明:SharedSessionContractImplementorLoad an instance immediately. This method is only called when lazily initializing a proxy. Do not return the proxy.- 指定者:
immediateLoad在接口中SharedSessionContractImplementor- 抛出:
HibernateException
-
getTimestamp
public long getTimestamp()
- 指定者:
getTimestamp在接口中SharedSessionContractImplementor
-
getFactory
public SessionFactoryImplementor getFactory()
从接口复制的说明:SharedSessionContractImplementorGet the creating SessionFactoryImplementor- 指定者:
getFactory在接口中HibernateEntityManagerFactoryAware- 指定者:
getFactory在接口中QueryProducerImplementor- 指定者:
getFactory在接口中SharedSessionContractImplementor- 返回:
- The Hibernate EMF contract for this EM.
-
list
public List list(String query, QueryParameters queryParameters) throws HibernateException
从接口复制的说明:SharedSessionContractImplementorExecute a find() query- 指定者:
list在接口中SharedSessionContractImplementor- 抛出:
HibernateException
-
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
-
scroll
public ScrollableResultsImplementor scroll(Criteria criteria, ScrollMode scrollMode)
从接口复制的说明:SharedSessionContractImplementorExecute a criteria query- 指定者:
scroll在接口中SharedSessionContractImplementor
-
list
public List list(Criteria criteria)
从接口复制的说明:SharedSessionContractImplementorExecute a criteria query- 指定者:
list在接口中SharedSessionContractImplementor
-
listFilter
public List listFilter(Object collection, String filter, QueryParameters queryParameters) throws HibernateException
从接口复制的说明:SharedSessionContractImplementorExecute a filter- 指定者:
listFilter在接口中SharedSessionContractImplementor- 抛出:
HibernateException
-
iterateFilter
public Iterator iterateFilter(Object collection, String filter, QueryParameters queryParameters) throws HibernateException
从接口复制的说明:SharedSessionContractImplementorIterate a filter- 指定者:
iterateFilter在接口中SharedSessionContractImplementor- 抛出:
HibernateException
-
getEntityPersister
public EntityPersister getEntityPersister(String entityName, Object object) throws HibernateException
从接口复制的说明:SharedSessionContractImplementorGet the EntityPersister for any instance- 指定者:
getEntityPersister在接口中SharedSessionContractImplementor- 参数:
entityName- optional entity nameobject- the entity instance- 抛出:
HibernateException
-
getEntityUsingInterceptor
public Object getEntityUsingInterceptor(EntityKey key) throws HibernateException
从接口复制的说明:SharedSessionContractImplementorGet the entity instance associated with the given Key, calling the Interceptor if necessary
-
getContextEntityIdentifier
public Serializable getContextEntityIdentifier(Object object)
从接口复制的说明:SharedSessionContractImplementorReturn the identifier of the persistent object, or null if not associated with the session
-
bestGuessEntityName
public String bestGuessEntityName(Object object)
从接口复制的说明:SharedSessionContractImplementorThe best guess entity name for an entity not in an association
-
guessEntityName
public String guessEntityName(Object entity) throws HibernateException
从接口复制的说明:SharedSessionContractImplementorThe guessed entity name for an entity not in an association
-
instantiate
public Object instantiate(String entityName, Serializable id) throws HibernateException
从接口复制的说明:SharedSessionContractImplementorInstantiate the entity class, initializing with the given identifier- 指定者:
instantiate在接口中SharedSessionContractImplementor- 抛出:
HibernateException
-
listCustomQuery
public List listCustomQuery(CustomQuery customQuery, QueryParameters queryParameters) throws HibernateException
从接口复制的说明:SharedSessionContractImplementorExecute an SQL Query
-
scrollCustomQuery
public ScrollableResultsImplementor scrollCustomQuery(CustomQuery customQuery, QueryParameters queryParameters) throws HibernateException
从接口复制的说明:SharedSessionContractImplementorExecute an SQL Query
-
list
public List list(NativeSQLQuerySpecification spec, QueryParameters queryParameters) throws HibernateException
从接口复制的说明:SharedSessionContractImplementorExecute a native SQL query, and return the results as a fully built list.- 指定者:
list在接口中SharedSessionContractImplementor- 参数:
spec- The specification of the native SQL query to execute.queryParameters- The parameters by which to perform the execution.- 返回:
- The result list.
- 抛出:
HibernateException
-
scroll
public ScrollableResultsImplementor scroll(NativeSQLQuerySpecification spec, QueryParameters queryParameters) throws HibernateException
从接口复制的说明:SharedSessionContractImplementorExecute a native SQL query, and return the results as a scrollable result.- 指定者:
scroll在接口中SharedSessionContractImplementor- 参数:
spec- The specification of the native SQL query to execute.queryParameters- The parameters by which to perform the execution.- 返回:
- The resulting scrollable result.
- 抛出:
HibernateException
-
getDontFlushFromFind
public int getDontFlushFromFind()
-
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.
-
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 specification, QueryParameters queryParameters) throws HibernateException
从接口复制的说明:SharedSessionContractImplementorExecute a native SQL update or delete query
-
getCacheMode
public CacheMode getCacheMode()
从接口复制的说明:SessionGet the current cache mode.- 指定者:
getCacheMode在接口中QueryProducerImplementor- 指定者:
getCacheMode在接口中Session- 指定者:
getCacheMode在接口中SharedSessionContractImplementor- 返回:
- The current cache mode.
-
setCacheMode
public void setCacheMode(CacheMode cm)
从接口复制的说明:SessionSet the cache mode. Cache mode determines the manner in which this session can interact with the second level cache.- 指定者:
setCacheMode在接口中Session- 指定者:
setCacheMode在接口中SharedSessionContractImplementor- 参数:
cm- The new cache mode.
-
isOpen
public boolean isOpen()
从接口复制的说明:SharedSessionContractCheck if the session is still open.- 指定者:
isOpen在接口中javax.persistence.EntityManager- 指定者:
isOpen在接口中SharedSessionContract- 返回:
- boolean
-
isConnected
public boolean isConnected()
从接口复制的说明:SharedSessionContractCheck if the session is currently connected.- 指定者:
isConnected在接口中SharedSessionContract- 返回:
- boolean
-
checkOpen
public void checkOpen(boolean markForRollbackIfClosed)
从接口复制的说明: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)
- 指定者:
checkOpen在接口中HibernateEntityManagerImplementor- 指定者:
checkOpen在接口中SharedSessionContractImplementor- 参数:
markForRollbackIfClosed- If the EM is closed, should the transaction (if one) be marked for rollback?
- if
-
markForRollbackOnly
public void markForRollbackOnly()
从接口复制的说明:SharedSessionContractImplementorMarks current transaction (if one) for rollback only
-
getTransactionStartTimestamp
public long getTransactionStartTimestamp()
从接口复制的说明:SharedSessionContractImplementorA "timestamp" at or before the start of the current transaction.
-
getFlushMode
public javax.persistence.FlushModeType getFlushMode()
从接口复制的说明: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.- 指定者:
getFlushMode在接口中javax.persistence.EntityManager- 指定者:
getFlushMode在接口中Session- 指定者:
getFlushMode在接口中SharedSessionContractImplementor- 返回:
- The FlushModeType in effect for this Session.
-
setFlushMode
public void setFlushMode(javax.persistence.FlushModeType flushModeType)
- 指定者:
setFlushMode在接口中javax.persistence.EntityManager
-
setHibernateFlushMode
public void setHibernateFlushMode(FlushMode flushMode)
从接口复制的说明: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).- 指定者:
setHibernateFlushMode在接口中Session- 指定者:
setHibernateFlushMode在接口中SharedSessionContractImplementor- 参数:
flushMode- the new flush mode
-
getHibernateFlushMode
public FlushMode getHibernateFlushMode()
从接口复制的说明:SessionGet the current flush mode for this session.- 指定者:
getHibernateFlushMode在接口中QueryProducerImplementor- 指定者:
getHibernateFlushMode在接口中Session- 指定者:
getHibernateFlushMode在接口中SharedSessionContractImplementor- 返回:
- The flush mode
-
setFlushMode
public void setFlushMode(FlushMode fm)
从接口复制的说明: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).- 指定者:
setFlushMode在接口中Session- 指定者:
setFlushMode在接口中SharedSessionContractImplementor- 参数:
fm- the new flush mode
-
lock
public void lock(Object entity, javax.persistence.LockModeType lockMode)
- 指定者:
lock在接口中javax.persistence.EntityManager
-
lock
public void lock(Object entity, javax.persistence.LockModeType lockMode, Map<String,Object> properties)
- 指定者:
lock在接口中javax.persistence.EntityManager
-
connection
public Connection connection()
- 指定者:
connection在接口中SharedSessionContractImplementor
-
flush
public void flush()
从接口复制的说明: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
-
isEventSource
public boolean isEventSource()
-
afterScrollOperation
public void afterScrollOperation()
-
getTransactionCoordinator
public TransactionCoordinator getTransactionCoordinator()
从接口复制的说明:JdbcSessionOwnerObtain the builder for TransactionCoordinator instances- 指定者:
getTransactionCoordinator在接口中JdbcSessionOwner- 返回:
- The TransactionCoordinatorBuilder
-
getJdbcCoordinator
public JdbcCoordinator getJdbcCoordinator()
-
getJdbcServices
public JdbcServices getJdbcServices()
-
getJdbcSessionContext
public JdbcSessionContext getJdbcSessionContext()
- 指定者:
getJdbcSessionContext在接口中JdbcSessionOwner
-
isClosed
public boolean isClosed()
从接口复制的说明: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.- 指定者:
isClosed在接口中SharedSessionContractImplementor- 返回:
trueif the session is closed;falseotherwise.
-
checkOpen
public void checkOpen()
从接口复制的说明: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)
- 指定者:
checkOpen在接口中SharedSessionContractImplementor
-
isOpenOrWaitingForAutoClose
public boolean isOpenOrWaitingForAutoClose()
从接口复制的说明:SharedSessionContractImplementorChecks whether the session is open or is waiting for auto-close- 指定者:
isOpenOrWaitingForAutoClose在接口中SharedSessionContractImplementor- 返回:
trueif the session is closed or if it's waiting for auto-close;falseotherwise.
-
shouldAutoClose
public boolean shouldAutoClose()
-
isAutoCloseSessionEnabled
public boolean isAutoCloseSessionEnabled()
-
isQueryParametersValidationEnabled
public boolean isQueryParametersValidationEnabled()
-
shouldAutoJoinTransaction
public boolean shouldAutoJoinTransaction()
从接口复制的说明:TransactionCoordinatorBuilder.OptionsIndicates whether an active transaction should be automatically joined. Only relevant for JTA-based TransactionCoordinator instances.- 指定者:
shouldAutoJoinTransaction在接口中TransactionCoordinatorBuilder.Options- 返回:
trueindicates the active transaction should be auto joined;falseindicates it should not (untilTransactionCoordinator.explicitJoin()is called).
-
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.
-
getExceptionConverter
public ExceptionConverter getExceptionConverter()
从接口复制的说明:SharedSessionContractImplementorThe converter associated to a Session might be lazily initialized: only invoke this getter when there is actual need to use it.- 指定者:
getExceptionConverter在接口中SharedSessionContractImplementor- 返回:
- the ExceptionConverter for this Session.
-
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.
-
getEventListenerManager
public SessionEventListenerManager getEventListenerManager()
-
accessTransaction
public Transaction accessTransaction()
从接口复制的说明: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.- 指定者:
accessTransaction在接口中SharedSessionContractImplementor- 返回:
- the transaction
-
beginTransaction
public Transaction beginTransaction()
从接口复制的说明: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.- 指定者:
beginTransaction在接口中SharedSessionContract- 返回:
- a Transaction instance
- 另请参阅:
SharedSessionContract.getTransaction()
-
getTransaction
public Transaction getTransaction()
从接口复制的说明:SharedSessionContractGet theTransactioninstance associated with this session. The concrete type of the returnedTransactionobject is determined by thehibernate.transaction_factoryproperty.- 指定者:
getTransaction在接口中javax.persistence.EntityManager- 指定者:
getTransaction在接口中SharedSessionContract- 返回:
- a Transaction instance
-
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- 指定者:
startTransactionBoundary在接口中JdbcSessionOwner
-
getCacheTransactionSynchronization
public CacheTransactionSynchronization getCacheTransactionSynchronization()
从接口复制的说明:SharedSessionContractImplementorThe current CacheTransactionContext associated with the Session. This may returnnullwhen the Session is not currently part of a transaction.
-
afterTransactionBegin
public void afterTransactionBegin()
从接口复制的说明:JdbcSessionOwnerA after-begin callback from the coordinator to its owner.- 指定者:
afterTransactionBegin在接口中JdbcSessionOwner
-
beforeTransactionCompletion
public void beforeTransactionCompletion()
从接口复制的说明:JdbcSessionOwnerA before-completion callback to the owner.- 指定者:
beforeTransactionCompletion在接口中JdbcSessionOwner
-
afterTransactionCompletion
public void afterTransactionCompletion(boolean successful, boolean delayed)从接口复制的说明:JdbcSessionOwnerAn after-completion callback to the owner.- 指定者:
afterTransactionCompletion在接口中JdbcSessionOwner- 参数:
successful- Was the transaction successful?delayed- Is this a delayed after transaction completion call (aka after a timeout)?
-
flushBeforeTransactionCompletion
public void flushBeforeTransactionCompletion()
-
getEntityManagerFactory
public javax.persistence.EntityManagerFactory getEntityManagerFactory()
- 指定者:
getEntityManagerFactory在接口中javax.persistence.EntityManager
-
getCriteriaBuilder
public javax.persistence.criteria.CriteriaBuilder getCriteriaBuilder()
- 指定者:
getCriteriaBuilder在接口中javax.persistence.EntityManager
-
getMetamodel
public javax.persistence.metamodel.Metamodel 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 <T> List<javax.persistence.EntityGraph<? super T>> getEntityGraphs(Class<T> entityClass)
- 指定者:
getEntityGraphs在接口中javax.persistence.EntityManager- 指定者:
getEntityGraphs在接口中Session
-
getNamedQuery
public QueryImplementor getNamedQuery(String name)
从接口复制的说明:QueryProducerCreate aQueryinstance for the named query.- 指定者:
getNamedQuery在接口中QueryProducer- 指定者:
getNamedQuery在接口中QueryProducerImplementor- 指定者:
getNamedQuery在接口中SessionImplementor- 指定者:
getNamedQuery在接口中SharedSessionContract- 参数:
name- the name of a pre-defined, named query- 返回:
- The Query instance for manipulation and execution
-
getNamedSQLQuery
public NativeQueryImplementor getNamedSQLQuery(String name)
从接口复制的说明:QueryProducerGet a NativeQuery instance for a named native SQL query- 指定者:
getNamedSQLQuery在接口中QueryProducer- 指定者:
getNamedSQLQuery在接口中QueryProducerImplementor- 指定者:
getNamedSQLQuery在接口中SessionImplementor- 参数:
name- The name of the pre-defined query- 返回:
- The NativeQuery instance for manipulation and execution
-
getNamedNativeQuery
public NativeQueryImplementor getNamedNativeQuery(String name)
从接口复制的说明:QueryProducerGet a NativeQuery instance for a named native SQL query- 指定者:
getNamedNativeQuery在接口中QueryProducer- 指定者:
getNamedNativeQuery在接口中QueryProducerImplementor- 指定者:
getNamedNativeQuery在接口中SessionImplementor- 参数:
name- The name of the pre-defined query- 返回:
- The NativeQuery instance for manipulation and execution
-
createQuery
public QueryImplementor createQuery(String queryString)
从接口复制的说明:QueryProducerCreate aQueryinstance for the given HQL/JPQL query string.- 指定者:
createQuery在接口中javax.persistence.EntityManager- 指定者:
createQuery在接口中QueryProducer- 指定者:
createQuery在接口中QueryProducerImplementor- 指定者:
createQuery在接口中SessionImplementor- 指定者:
createQuery在接口中SharedSessionContract- 参数:
queryString- The HQL/JPQL query- 返回:
- The Query instance for manipulation and execution
- 另请参阅:
EntityManager.createQuery(String)
-
createQuery
public <T> QueryImplementor<T> createQuery(String queryString, Class<T> resultType)
从接口复制的说明:QueryProducerCreate a typedQueryinstance for the given HQL/JPQL query string.- 指定者:
createQuery在接口中javax.persistence.EntityManager- 指定者:
createQuery在接口中QueryProducer- 指定者:
createQuery在接口中QueryProducerImplementor- 指定者:
createQuery在接口中Session- 指定者:
createQuery在接口中SessionImplementor- 参数:
queryString- The HQL/JPQL query- 返回:
- The Query instance for manipulation and execution
- 另请参阅:
EntityManager.createQuery(String,Class)
-
createQuery
public <T> QueryImplementor<T> createQuery(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery)
- 指定者:
createQuery在接口中javax.persistence.EntityManager- 指定者:
createQuery在接口中QueryProducer- 指定者:
createQuery在接口中Session- 指定者:
createQuery在接口中SessionImplementor
-
createQuery
public QueryImplementor createQuery(javax.persistence.criteria.CriteriaUpdate updateQuery)
- 指定者:
createQuery在接口中javax.persistence.EntityManager- 指定者:
createQuery在接口中QueryProducer- 指定者:
createQuery在接口中Session- 指定者:
createQuery在接口中SessionImplementor
-
createQuery
public QueryImplementor createQuery(javax.persistence.criteria.CriteriaDelete deleteQuery)
- 指定者:
createQuery在接口中javax.persistence.EntityManager- 指定者:
createQuery在接口中QueryProducer- 指定者:
createQuery在接口中Session- 指定者:
createQuery在接口中SessionImplementor
-
createNamedQuery
public QueryImplementor createNamedQuery(String name)
从接口复制的说明:QueryProducerThe JPA-defined named query creation method. This form can represent an HQL/JPQL query or a native query.- 指定者:
createNamedQuery在接口中javax.persistence.EntityManager- 指定者:
createNamedQuery在接口中QueryProducer- 指定者:
createNamedQuery在接口中QueryProducerImplementor- 指定者:
createNamedQuery在接口中SessionImplementor- 参数:
name- the name of a pre-defined, named query- 返回:
- The Query instance for manipulation and execution
- 另请参阅:
EntityManager.createNamedQuery(String)
-
createNamedQuery
public <T> QueryImplementor<T> createNamedQuery(String name, Class<T> resultClass)
从接口复制的说明:QueryProducerThe JPA-defined named, typed query creation method. This form can only represent an HQL/JPQL query (not a native query).- 指定者:
createNamedQuery在接口中javax.persistence.EntityManager- 指定者:
createNamedQuery在接口中QueryProducer- 指定者:
createNamedQuery在接口中QueryProducerImplementor- 指定者:
createNamedQuery在接口中Session- 指定者:
createNamedQuery在接口中SessionImplementor- 参数:
name- the name of a query defined in metadataresultClass- the type of the query result- 返回:
- The Query instance for manipulation and execution
- 另请参阅:
EntityManager.createNamedQuery(String,Class)
-
createNativeQuery
public NativeQueryImplementor createNativeQuery(String sqlString)
从接口复制的说明:QueryProducerCreate a NativeQuery instance for the given native (SQL) query- 指定者:
createNativeQuery在接口中javax.persistence.EntityManager- 指定者:
createNativeQuery在接口中QueryProducer- 指定者:
createNativeQuery在接口中QueryProducerImplementor- 指定者:
createNativeQuery在接口中SessionImplementor- 参数:
sqlString- a native SQL query string- 返回:
- The NativeQuery instance for manipulation and execution
- 另请参阅:
EntityManager.createNativeQuery(String)
-
createNativeQuery
public NativeQueryImplementor createNativeQuery(String sqlString, Class resultClass)
从接口复制的说明:QueryProducerCreate a NativeQuery instance for the given native (SQL) query using implicit mapping to the specified Java type.- 指定者:
createNativeQuery在接口中javax.persistence.EntityManager- 指定者:
createNativeQuery在接口中QueryProducer- 指定者:
createNativeQuery在接口中QueryProducerImplementor- 指定者:
createNativeQuery在接口中SessionImplementor- 参数:
sqlString- Native (SQL) query stringresultClass- The Java type to map results to- 返回:
- The NativeQuery instance for manipulation and execution
- 另请参阅:
EntityManager.createNativeQuery(String,Class)
-
createNativeQuery
public NativeQueryImplementor createNativeQuery(String sqlString, String resultSetMapping)
从接口复制的说明:QueryProducerCreate a NativeQuery instance for the given native (SQL) query using implicit mapping to the specified Java type.- 指定者:
createNativeQuery在接口中javax.persistence.EntityManager- 指定者:
createNativeQuery在接口中QueryProducer- 指定者:
createNativeQuery在接口中QueryProducerImplementor- 指定者:
createNativeQuery在接口中SessionImplementor- 参数:
sqlString- Native (SQL) query stringresultSetMapping- The explicit (named) result mapping- 返回:
- The NativeQuery instance for manipulation and execution
- 另请参阅:
EntityManager.createNativeQuery(String,Class),SqlResultSetMapping
-
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> cls)
- 指定者:
unwrap在接口中javax.persistence.EntityManager
-
getDelegate
public 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.- 指定者:
getDelegate在接口中javax.persistence.EntityManager- 另请参阅:
delegate()
-
createSQLQuery
public NativeQueryImplementor createSQLQuery(String queryString)
从接口复制的说明:QueryProducerCreate aNativeQueryinstance for the given SQL query string.- 指定者:
createSQLQuery在接口中QueryProducer- 指定者:
createSQLQuery在接口中QueryProducerImplementor- 指定者:
createSQLQuery在接口中Session- 指定者:
createSQLQuery在接口中SessionImplementor- 参数:
queryString- The SQL query- 返回:
- The query instance for manipulation and execution
-
getNamedProcedureCall
public ProcedureCall getNamedProcedureCall(String name)
从接口复制的说明:SharedSessionContractGets a ProcedureCall based on a named template- 指定者:
getNamedProcedureCall在接口中SharedSessionContract- 参数:
name- The name given to the template- 返回:
- The ProcedureCall
- 另请参阅:
NamedStoredProcedureQuery
-
createStoredProcedureCall
public ProcedureCall createStoredProcedureCall(String procedureName)
从接口复制的说明:SharedSessionContractCreates a call to a stored procedure.- 指定者:
createStoredProcedureCall在接口中SharedSessionContract- 参数:
procedureName- The name of the procedure.- 返回:
- 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- 参数:
procedureName- The name of the procedure.resultClasses- The entity(s) to map the result on to.- 返回:
- 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- 参数:
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.
-
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(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)
从接口复制的说明:SharedSessionContractCreateCriteriainstance for the given entity name.- 指定者:
createCriteria在接口中SharedSessionContract- 参数:
entityName- The entity name- 返回:
- 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
-
sessionWithOptions
public SharedSessionBuilder sessionWithOptions()
从接口复制的说明:SessionObtain aSessionbuilder with the ability to grab certain information from this session.- 指定者:
sessionWithOptions在接口中Session- 返回:
- The session builder
-
getSessionFactory
public SessionFactoryImplementor getSessionFactory()
从接口复制的说明:SessionGet the session factory which created this session.- 指定者:
getSessionFactory在接口中Session- 指定者:
getSessionFactory在接口中SessionImplementor- 返回:
- The session factory.
- 另请参阅:
SessionFactory
-
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- 抛出:
HibernateException- Indicates problems cleaning up.
-
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
-
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
-
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 readOnly)
从接口复制的说明: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- 参数:
readOnly- 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)
-
getIdentifier
public Serializable getIdentifier(Object object)
从接口复制的说明: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
-
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
-
contains
public boolean contains(Object object)
- 指定者:
contains在接口中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
-
evict
public void evict(Object object)
从接口复制的说明: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(Class<T> theClass, Serializable id, LockMode lockMode)
从接口复制的说明: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- 参数:
theClass- a persistent classid- a valid identifier of an existing persistent instance of the classlockMode- the lock level- 返回:
- the persistent instance or proxy
- 另请参阅:
Session.load(Class, Serializable, LockOptions)
-
load
public <T> T load(Class<T> theClass, Serializable id, LockOptions lockOptions)
从接口复制的说明:SessionReturn the persistent instance of the given entity class with the given identifier, obtaining the specified lock mode, assuming the instance exists.
-
load
public Object load(String entityName, Serializable id, LockMode lockMode)
从接口复制的说明: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
- 另请参阅:
Session.load(String, Serializable, LockOptions)
-
load
public Object load(String entityName, Serializable id, LockOptions lockOptions)
从接口复制的说明: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(Class<T> theClass, Serializable id)
从接口复制的说明: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 Object load(String entityName, Serializable id)
从接口复制的说明: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(Object object, Serializable id)
从接口复制的说明:SessionRead the persistent state associated with the given identifier into the given transient instance.
-
replicate
public void replicate(Object object, ReplicationMode replicationMode)
从接口复制的说明: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(String entityName, Object object, ReplicationMode replicationMode)
从接口复制的说明: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 Serializable save(Object object)
从接口复制的说明: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 Serializable save(String entityName, Object object)
从接口复制的说明: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(Object object)
从接口复制的说明: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- 另请参阅:
Session.save(java.lang.Object),Session.update(Object object)
-
saveOrUpdate
public void saveOrUpdate(String entityName, Object object)
从接口复制的说明: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 nameobject- a transient or detached instance containing new or updated state- 另请参阅:
Session.save(String,Object),Session.update(String,Object)
-
update
public void update(Object object)
从接口复制的说明: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(String entityName, Object object)
从接口复制的说明: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 Object merge(Object object)
从接口复制的说明: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
public Object merge(String entityName, Object object)
从接口复制的说明: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(Object object)
从接口复制的说明: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.
-
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 lockMode)
- 指定者:
find在接口中javax.persistence.EntityManager
-
find
public <T> T find(Class<T> entityClass, Object primaryKey, javax.persistence.LockModeType lockMode, Map<String,Object> properties)
- 指定者:
find在接口中javax.persistence.EntityManager
-
getReference
public <T> T getReference(Class<T> entityClass, Object primaryKey)
- 指定者:
getReference在接口中javax.persistence.EntityManager
-
persist
public void persist(String entityName, Object object)
从接口复制的说明: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(Object object)
从接口复制的说明: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(String entityName, Object object)
从接口复制的说明: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(Object object, LockMode lockMode)
从接口复制的说明: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- 另请参阅:
Session.buildLockRequest(LockOptions),Session.LockRequest.lock(Object)
-
lock
public void lock(String entityName, Object object, LockMode lockMode)
从接口复制的说明: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- 另请参阅:
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.
-
refresh
public void refresh(Object object)
从接口复制的说明: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(Object entity, Map<String,Object> properties)
- 指定者:
refresh在接口中javax.persistence.EntityManager
-
refresh
public void refresh(Object entity, javax.persistence.LockModeType lockMode)
- 指定者:
refresh在接口中javax.persistence.EntityManager
-
refresh
public void refresh(Object entity, javax.persistence.LockModeType lockMode, Map<String,Object> properties)
- 指定者:
refresh在接口中javax.persistence.EntityManager
-
refresh
public void refresh(String entityName, Object object)
从接口复制的说明: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(Object object, LockMode lockMode)
从接口复制的说明: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- 另请参阅:
Session.refresh(Object, LockOptions)
-
refresh
public void refresh(Object object, LockOptions lockOptions)
从接口复制的说明: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(String entityName, Object object, LockOptions lockOptions)
从接口复制的说明: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(Object object)
从接口复制的说明:SessionDetermine the current lock mode of the given object.- 指定者:
getCurrentLockMode在接口中Session- 参数:
object- a persistent instance- 返回:
- the current lock mode
-
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
-
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.
-
detach
public void detach(Object entity)
- 指定者:
detach在接口中javax.persistence.EntityManager
-
get
public <T> T get(Class<T> theClass, Serializable id)
从接口复制的说明: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(Class<T> theClass, Serializable id, LockMode lockMode)
从接口复制的说明: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- 参数:
theClass- The entity typeid- an identifierlockMode- the lock mode- 返回:
- a persistent instance or null
- 另请参阅:
Session.get(Class, Serializable, LockOptions)
-
get
public <T> T get(Class<T> theClass, Serializable id, LockOptions lockOptions)
从接口复制的说明: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 Object get(String entityName, Serializable id)
从接口复制的说明: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 Object get(String entityName, Serializable id, LockMode lockMode)
从接口复制的说明: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
- 另请参阅:
Session.get(String, Serializable, LockOptions)
-
get
public Object get(String entityName, Serializable id, LockOptions lockOptions)
从接口复制的说明: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 String getEntityName(Object object)
从接口复制的说明:SessionReturn the entity name for a persistent entity.- 指定者:
getEntityName在接口中Session- 参数:
object- a persistent entity- 返回:
- the entity name
-
byId
public IdentifierLoadAccess byId(String entityName)
从接口复制的说明:SessionCreate anIdentifierLoadAccessinstance to retrieve the specified entity type 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
-
byId
public <T> IdentifierLoadAccess<T> byId(Class<T> entityClass)
从接口复制的说明:SessionCreate anIdentifierLoadAccessinstance to retrieve the specified entity by primary key.
-
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
-
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.
-
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.
-
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.
-
getStatistics
public SessionStatistics getStatistics()
从接口复制的说明:SessionGet the statistics for this session.- 指定者:
getStatistics在接口中Session- 返回:
- The session statistics being collected for this session
-
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 entityOrProxy, 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- 参数:
entityOrProxy- 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)
-
doWork
public void doWork(Work work) throws HibernateException
从接口复制的说明:SharedSessionContractController for allowing users to perform JDBC related work using the Connection managed by this Session.- 指定者:
doWork在接口中SharedSessionContract- 参数:
work- The work to be performed.- 抛出:
HibernateException- Generally indicates wrappedSQLException
-
doReturningWork
public <T> T doReturningWork(ReturningWork<T> work) throws HibernateException
从接口复制的说明: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.- 指定者:
doReturningWork在接口中SharedSessionContract- 类型参数:
T- The type of the result returned from the work- 参数:
work- The work to be performed.- 返回:
- the result from calling
ReturningWork.execute(java.sql.Connection). - 抛出:
HibernateException- Generally indicates wrappedSQLException
-
disconnect
public Connection disconnect()
从接口复制的说明: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 - 另请参阅:
Session.reconnect(Connection)
-
reconnect
public void reconnect(Connection connection)
从接口复制的说明:SessionReconnect to the given JDBC connection.- 指定者:
reconnect在接口中Session- 参数:
connection- a JDBC connection- 另请参阅:
Session.disconnect()
-
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
-
addEventListeners
public void addEventListeners(SessionEventListener... listeners)
从接口复制的说明:SessionAdd one or more listeners to the Session- 指定者:
addEventListeners在接口中Session- 参数:
listeners- The listener(s) to add
-
isFlushBeforeCompletionEnabled
public boolean isFlushBeforeCompletionEnabled()
-
getActionQueue
public ActionQueue getActionQueue()
- 指定者:
getActionQueue在接口中SessionImplementor
-
instantiate
public Object instantiate(EntityPersister persister, Serializable id) throws HibernateException
- 指定者:
instantiate在接口中SessionImplementor- 抛出:
HibernateException
-
forceFlush
public void forceFlush(EntityEntry e) throws HibernateException
- 指定者:
forceFlush在接口中SessionImplementor- 抛出:
HibernateException
-
merge
public void merge(String entityName, Object object, Map copiedAlready) throws HibernateException
- 指定者:
merge在接口中SessionImplementor- 抛出:
HibernateException
-
persist
public void persist(String entityName, Object object, Map createdAlready) throws HibernateException
- 指定者:
persist在接口中SessionImplementor- 抛出:
HibernateException
-
persistOnFlush
public void persistOnFlush(String entityName, Object object, Map copiedAlready)
- 指定者:
persistOnFlush在接口中SessionImplementor
-
refresh
public void refresh(String entityName, Object object, Map refreshedAlready) throws HibernateException
- 指定者:
refresh在接口中SessionImplementor- 抛出:
HibernateException
-
delete
public void delete(String entityName, Object child, boolean isCascadeDeleteEnabled, Set transientEntities)
- 指定者:
delete在接口中SessionImplementor
-
removeOrphanBeforeUpdates
public void removeOrphanBeforeUpdates(String entityName, Object child)
- 指定者:
removeOrphanBeforeUpdates在接口中SessionImplementor
-
getSession
public SessionImplementor getSession()
从接口复制的说明:HibernateEntityManagerRetrieve a reference to the HibernateSessionused by thisEntityManager.- 指定者:
getSession在接口中HibernateEntityManager- 指定者:
getSession在接口中HibernateEntityManagerImplementor- 返回:
- The session
-
useStreamForLobBinding
public boolean useStreamForLobBinding()
从接口复制的说明:WrapperOptionsShould streams be used for binding LOB values.- 指定者:
useStreamForLobBinding在接口中WrapperOptions- 返回:
true/false
-
getLobCreator
public LobCreator getLobCreator()
从接口复制的说明:WrapperOptionsObtain access to theLobCreator- 指定者:
getLobCreator在接口中WrapperOptions- 返回:
- The LOB creator
-
remapSqlTypeDescriptor
public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor)
从接口复制的说明:WrapperOptionsAllow remapping of descriptors for dealing with sql type.- 指定者:
remapSqlTypeDescriptor在接口中WrapperOptions- 参数:
sqlTypeDescriptor- The known descriptor- 返回:
- The remapped descriptor. May be the same as the known descriptor indicating no remapping.
-
getJdbcBatchSize
public Integer getJdbcBatchSize()
从接口复制的说明: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.- 指定者:
getJdbcBatchSize在接口中JdbcSessionOwner- 指定者:
getJdbcBatchSize在接口中SharedSessionContract- 返回:
- Session-level JDBC batch size
- 另请参阅:
SessionFactoryOptions.getJdbcBatchSize(),SessionFactoryBuilder.applyJdbcBatchSize(int)
-
setJdbcBatchSize
public void setJdbcBatchSize(Integer jdbcBatchSize)
从接口复制的说明: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.- 指定者:
setJdbcBatchSize在接口中SharedSessionContract- 参数:
jdbcBatchSize- Session-level JDBC batch size- 另请参阅:
SessionFactoryOptions.getJdbcBatchSize(),SessionFactoryBuilder.applyJdbcBatchSize(int)
-
getJdbcTimeZone
public TimeZone getJdbcTimeZone()
从接口复制的说明: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().- 指定者:
getJdbcTimeZone在接口中WrapperOptions- 返回:
- JDBC
TimeZone
-
-