类 AbstractSharedSessionContract
- java.lang.Object
-
- org.hibernate.internal.AbstractSharedSessionContract
-
- 所有已实现的接口:
Serializable,LobCreationContext,SharedSessionContractImplementor,QueryProducer,QueryProducerImplementor,JdbcSessionOwner,TransactionCoordinatorBuilder.Options,SharedSessionContract,WrapperOptions
- 直接已知子类:
AbstractSessionImpl,StatelessSessionImpl
public abstract class AbstractSharedSessionContract extends Object implements SharedSessionContractImplementor
Base class for SharedSessionContract/SharedSessionContractImplementor implementations. Intended for Session and StatelessSession implementations NOTE: This implementation defines access to a number of instance state values in a manner that is not exactly concurrent-access safe. However, a Session/EntityManager is never intended to be used concurrently; therefore the condition is not expected and so a more synchronized/concurrency-safe is not defined to be as negligent (performance-wise) as possible. Some of these methods include:getEventListenerManager()getJdbcConnectionAccess()getJdbcServices()getTransaction()(and therefore related methods such asbeginTransaction(), etc)
- 作者:
- Steve Ebersole
- 另请参阅:
- 序列化表格
-
-
嵌套类概要
-
从接口继承的嵌套类/接口 org.hibernate.engine.jdbc.LobCreationContext
LobCreationContext.Callback<T>
-
-
字段概要
字段 修饰符和类型 字段 说明 protected booleanclosedprotected org.hibernate.internal.FastSessionServicesfastSessionServicesprotected booleanwaitingForAutoClose
-
构造器概要
构造器 构造器 说明 AbstractSharedSessionContract(SessionFactoryImpl factory, SessionCreationOptions options)
-
方法概要
所有方法 实例方法 抽象方法 具体方法 已过时的方法 修饰符和类型 方法 说明 TransactionaccessTransaction()Provides access to the underlying transaction or creates a new transaction if one does not already exist or is active.protected voidaddSharedSessionTransactionObserver(TransactionCoordinator transactionCoordinator)voidafterTransactionCompletion(boolean successful, boolean delayed)An after-completion callback to the owner.protected voidapplyQuerySettingsAndHints(Query query)voidbeforeTransactionCompletion()A before-completion callback to the owner.TransactionbeginTransaction()Begin a unit of work and return the associatedTransactionobject.protected <T> QueryImplementor<T>buildQueryFromName(String name, Class<T> resultType)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)protected voidcheckOpenOrWaitingForAutoClose()voidcheckTransactionNeededForUpdateOperation(String exceptionMessage)Check if an active Transaction is necessary for the update operation to be executed.protected voidcheckTransactionSynchStatus()protected voidcleanupOnClose()voidclose()End the session by releasing the JDBC connection and cleaning up.QueryImplementorcreateNamedQuery(String name)The JPA-defined named query creation method.<R> QueryImplementor<R>createNamedQuery(String name, Class<R> resultClass)The JPA-defined named, typed query creation method.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.protected <T> NativeQueryImplementorcreateNativeQuery(NamedSQLQueryDefinition queryDefinition, Class<T> resultType)QueryImplementorcreateQuery(String queryString)Create aQueryinstance for the given HQL/JPQL query string.<T> QueryImplementor<T>createQuery(String queryString, Class<T> resultClass)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)QueryImplementorcreateQuery(javax.persistence.criteria.CriteriaDelete criteriaDelete)<T> QueryImplementor<T>createQuery(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery)QueryImplementorcreateQuery(javax.persistence.criteria.CriteriaUpdate criteriaUpdate)protected QueryImplementorcreateQuery(NamedQueryDefinition queryDefinition)protected <T> QueryImplementor<T>createQuery(NamedQueryDefinition namedQueryDefinition, Class<T> resultType)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.protected CriteriaCompilercriteriaCompiler()protected voiddelayedAfterCompletion()<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.protected voiderrorIfClosed()已过时。(since 5.2) useSharedSessionContractImplementor.checkOpen()instead<T> Texecute(LobCreationContext.Callback<T> callback)Execute the given callback, making sure it has access to a viable JDBCConnection.EntityKeygenerateEntityKey(Serializable id, EntityPersister persister)Hide the changing requirements of entity key creationCacheModegetCacheMode()CacheTransactionSynchronizationgetCacheTransactionSynchronization()The current CacheTransactionContext associated with the Session.protected TransactionImplementorgetCurrentTransaction()EntityNameResolvergetEntityNameResolver()SessionEventListenerManagergetEventListenerManager()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()Get the flush mode for this session.FlushModegetHibernateFlushMode()Get the current flush mode for 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.LobCreatorgetLobCreator()Obtain access to theLobCreatorNativeQueryImplementorgetNamedNativeQuery(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 queryprotected NativeQueryImplementorgetNativeQueryImplementor(String queryString, boolean isOrdinalParameterZeroBased)protected NativeSQLQueryPlangetNativeQueryPlan(NativeSQLQuerySpecification spec)protected HQLQueryPlangetQueryPlan(String query, boolean shallow)UUIDgetSessionIdentifier()A UUID associated with each Session.StringgetTenantIdentifier()The multi-tenancy tenant identifier, if one.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.protected voidinitQueryFromNamedDefinition(Query query, NamedQueryDefinition nqd)booleanisClosed()Checks whether the session is closed.booleanisConnected()Check if the session is currently connected.booleanisOpen()Check if the session is still open.booleanisOpenOrWaitingForAutoClose()Checks whether the session is open or is waiting for auto-closebooleanisTransactionInProgress()Does this Session have an active Hibernate transaction or is there a JTA transaction in progress?Listlist(NativeSQLQuerySpecification spec, QueryParameters queryParameters)Execute a native SQL query, and return the results as a fully built list.protected abstract Objectload(String entityName, Serializable identifier)voidmarkForRollbackOnly()Marks current transaction (if one) for rollback onlyprotected voidpulseTransactionCoordinator()SqlTypeDescriptorremapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor)Allow remapping of descriptors for dealing with sql type.protected voidremoveSharedSessionTransactionObserver(TransactionCoordinator transactionCoordinator)protected voidresultClassChecking(Class resultType, NamedSQLQueryDefinition namedQueryDefinition)protected voidresultClassChecking(Class resultClass, Query hqlQuery)ScrollableResultsImplementorscroll(NativeSQLQuerySpecification spec, QueryParameters queryParameters)Execute a native SQL query, and return the results as a scrollable result.voidsetCacheMode(CacheMode cacheMode)protected voidsetClosed()voidsetFlushMode(FlushMode flushMode)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.booleanshouldAutoJoinTransaction()Indicates whether an active transaction should be automatically joined.protected booleanshouldCloseJdbcCoordinatorOnClose(boolean isTransactionCoordinatorShared)voidstartTransactionBoundary()Callback indicating recognition of entering into a transactional context whether that is explicitly via the HibernateTransactionAPI or via registration of Hibernate's JTA Synchronization impl with a JTA TransactionbooleanuseStreamForLobBinding()Should streams be used for binding LOB values.-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 org.hibernate.resource.jdbc.spi.JdbcSessionOwner
afterTransactionBegin, flushBeforeTransactionCompletion
-
从接口继承的方法 org.hibernate.SharedSessionContract
createCriteria, createCriteria, createCriteria, createCriteria
-
从接口继承的方法 org.hibernate.engine.spi.SharedSessionContractImplementor
afterScrollOperation, bestGuessEntityName, checkOpen, connection, executeNativeUpdate, executeUpdate, flush, getConfiguredJdbcBatchSize, getContextEntityIdentifier, getDontFlushFromFind, getEntityPersister, getEntityUsingInterceptor, getFetchGraphLoadContext, getLoadQueryInfluencers, getPersistenceContext, getPersistenceContextInternal, getTimestamp, guessEntityName, immediateLoad, initializeCollection, instantiate, internalLoad, isAutoCloseSessionEnabled, isEventSource, isQueryParametersValidationEnabled, iterate, iterateFilter, list, list, listCustomQuery, listFilter, scroll, scroll, scrollCustomQuery, setAutoClear, setFetchGraphLoadContext, shouldAutoClose
-
-
-
-
构造器详细资料
-
AbstractSharedSessionContract
public AbstractSharedSessionContract(SessionFactoryImpl factory, SessionCreationOptions options)
-
-
方法详细资料
-
addSharedSessionTransactionObserver
protected void addSharedSessionTransactionObserver(TransactionCoordinator transactionCoordinator)
-
removeSharedSessionTransactionObserver
protected void removeSharedSessionTransactionObserver(TransactionCoordinator transactionCoordinator)
-
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).
-
getFactory
public SessionFactoryImplementor getFactory()
从接口复制的说明:SharedSessionContractImplementorGet the creating SessionFactoryImplementor- 指定者:
getFactory在接口中QueryProducerImplementor- 指定者:
getFactory在接口中SharedSessionContractImplementor
-
getInterceptor
public Interceptor getInterceptor()
从接口复制的说明:SharedSessionContractImplementorRetrieves the interceptor currently in use by this event source.- 指定者:
getInterceptor在接口中SharedSessionContractImplementor- 返回:
- The interceptor.
-
getJdbcCoordinator
public JdbcCoordinator getJdbcCoordinator()
-
getTransactionCoordinator
public TransactionCoordinator getTransactionCoordinator()
从接口复制的说明:JdbcSessionOwnerObtain the builder for TransactionCoordinator instances- 指定者:
getTransactionCoordinator在接口中JdbcSessionOwner- 返回:
- The TransactionCoordinatorBuilder
-
getJdbcSessionContext
public JdbcSessionContext getJdbcSessionContext()
- 指定者:
getJdbcSessionContext在接口中JdbcSessionOwner
-
getEntityNameResolver
public EntityNameResolver getEntityNameResolver()
-
getEventListenerManager
public SessionEventListenerManager getEventListenerManager()
-
getSessionIdentifier
public UUID getSessionIdentifier()
从接口复制的说明:SharedSessionContractImplementorA UUID associated with each Session. Useful mainly for logging.- 指定者:
getSessionIdentifier在接口中SharedSessionContractImplementor- 返回:
- The UUID
-
getTenantIdentifier
public String getTenantIdentifier()
从接口复制的说明:SharedSessionContractImplementorThe multi-tenancy tenant identifier, if one.- 指定者:
getTenantIdentifier在接口中SharedSessionContract- 指定者:
getTenantIdentifier在接口中SharedSessionContractImplementor- 返回:
- The tenant identifier; may be
null
-
isOpen
public boolean isOpen()
从接口复制的说明:SharedSessionContractCheck if the session is still open.- 指定者:
isOpen在接口中SharedSessionContract- 返回:
- boolean
-
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.
-
close
public void close()
从接口复制的说明:SharedSessionContractEnd the session by releasing the JDBC connection and cleaning up.- 指定者:
close在接口中SharedSessionContract
-
setClosed
protected void setClosed()
-
shouldCloseJdbcCoordinatorOnClose
protected boolean shouldCloseJdbcCoordinatorOnClose(boolean isTransactionCoordinatorShared)
-
cleanupOnClose
protected void cleanupOnClose()
-
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.
-
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在接口中SharedSessionContractImplementor
- if
-
checkOpenOrWaitingForAutoClose
protected void checkOpenOrWaitingForAutoClose()
-
errorIfClosed
@Deprecated protected void errorIfClosed()
已过时。(since 5.2) useSharedSessionContractImplementor.checkOpen()instead
-
markForRollbackOnly
public void markForRollbackOnly()
从接口复制的说明:SharedSessionContractImplementorMarks current transaction (if one) for rollback only
-
isTransactionInProgress
public boolean isTransactionInProgress()
从接口复制的说明:SharedSessionContractImplementorDoes this Session have an active Hibernate transaction or is there a JTA transaction in progress?
-
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
-
getTransaction
public Transaction getTransaction() throws HibernateException
从接口复制的说明:SharedSessionContractGet theTransactioninstance associated with this session. The concrete type of the returnedTransactionobject is determined by thehibernate.transaction_factoryproperty.- 指定者:
getTransaction在接口中SharedSessionContract- 返回:
- a Transaction instance
- 抛出:
HibernateException
-
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
-
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
-
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)?
-
getCacheTransactionSynchronization
public CacheTransactionSynchronization getCacheTransactionSynchronization()
从接口复制的说明:SharedSessionContractImplementorThe current CacheTransactionContext associated with the Session. This may returnnullwhen the Session is not currently part of a transaction.
-
getTransactionStartTimestamp
public long getTransactionStartTimestamp()
从接口复制的说明:SharedSessionContractImplementorA "timestamp" at or before the start of the current 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()
-
checkTransactionSynchStatus
protected void checkTransactionSynchStatus()
-
pulseTransactionCoordinator
protected void pulseTransactionCoordinator()
-
delayedAfterCompletion
protected void delayedAfterCompletion()
-
getCurrentTransaction
protected TransactionImplementor getCurrentTransaction()
-
isConnected
public boolean isConnected()
从接口复制的说明:SharedSessionContractCheck if the session is currently connected.- 指定者:
isConnected在接口中SharedSessionContract- 返回:
- boolean
-
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
-
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
-
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.
-
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.
-
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
-
getJdbcServices
public JdbcServices getJdbcServices()
-
setFlushMode
public void setFlushMode(FlushMode flushMode)
从接口复制的说明:SharedSessionContractImplementorSet 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在接口中SharedSessionContractImplementor- 参数:
flushMode- the new flush mode
-
getFlushMode
public javax.persistence.FlushModeType getFlushMode()
从接口复制的说明:SharedSessionContractImplementorGet the flush mode for this session. For users of the Hibernate native APIs, we've had to rename this method as defined by Hibernate historically because the JPA contract defines a method of the same name, but returning the JPAFlushModeTyperather than Hibernate'sFlushMode. For the former behavior, useSharedSessionContractImplementor.getHibernateFlushMode()instead.- 指定者:
getFlushMode在接口中SharedSessionContractImplementor- 返回:
- The FlushModeType in effect for this Session.
-
setHibernateFlushMode
public void setHibernateFlushMode(FlushMode flushMode)
从接口复制的说明:SharedSessionContractImplementorSet 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在接口中SharedSessionContractImplementor- 参数:
flushMode- the new flush mode
-
getHibernateFlushMode
public FlushMode getHibernateFlushMode()
从接口复制的说明:SharedSessionContractImplementorGet the current flush mode for this session.- 指定者:
getHibernateFlushMode在接口中QueryProducerImplementor- 指定者:
getHibernateFlushMode在接口中SharedSessionContractImplementor- 返回:
- The flush mode
-
getCacheMode
public CacheMode getCacheMode()
- 指定者:
getCacheMode在接口中QueryProducerImplementor- 指定者:
getCacheMode在接口中SharedSessionContractImplementor
-
setCacheMode
public void setCacheMode(CacheMode cacheMode)
- 指定者:
setCacheMode在接口中SharedSessionContractImplementor
-
getQueryPlan
protected HQLQueryPlan getQueryPlan(String query, boolean shallow) throws HibernateException
-
getNativeQueryPlan
protected NativeSQLQueryPlan getNativeQueryPlan(NativeSQLQuerySpecification spec) throws HibernateException
-
getNamedQuery
public QueryImplementor getNamedQuery(String name)
从接口复制的说明:QueryProducerCreate aQueryinstance for the named query.- 指定者:
getNamedQuery在接口中QueryProducer- 指定者:
getNamedQuery在接口中QueryProducerImplementor- 指定者:
getNamedQuery在接口中SharedSessionContract- 参数:
name- the name of a pre-defined, named query- 返回:
- The Query instance for manipulation and execution
-
createQuery
protected QueryImplementor createQuery(NamedQueryDefinition queryDefinition)
-
initQueryFromNamedDefinition
protected void initQueryFromNamedDefinition(Query query, NamedQueryDefinition nqd)
-
createQuery
public QueryImplementor createQuery(String queryString)
从接口复制的说明:QueryProducerCreate aQueryinstance for the given HQL/JPQL query string.- 指定者:
createQuery在接口中QueryProducer- 指定者:
createQuery在接口中QueryProducerImplementor- 指定者:
createQuery在接口中SharedSessionContract- 参数:
queryString- The HQL/JPQL query- 返回:
- The Query instance for manipulation and execution
- 另请参阅:
EntityManager.createQuery(String)
-
criteriaCompiler
protected CriteriaCompiler criteriaCompiler()
-
createQuery
public <T> QueryImplementor<T> createQuery(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery)
- 指定者:
createQuery在接口中QueryProducer
-
createQuery
public QueryImplementor createQuery(javax.persistence.criteria.CriteriaUpdate criteriaUpdate)
- 指定者:
createQuery在接口中QueryProducer
-
createQuery
public QueryImplementor createQuery(javax.persistence.criteria.CriteriaDelete criteriaDelete)
- 指定者:
createQuery在接口中QueryProducer
-
createQuery
public <T> QueryImplementor<T> createQuery(String jpaqlString, Class<T> resultClass, javax.persistence.criteria.Selection selection, HibernateEntityManagerImplementor.QueryOptions queryOptions)
- 指定者:
createQuery在接口中SharedSessionContractImplementor- 返回:
- The typed query
-
applyQuerySettingsAndHints
protected void applyQuerySettingsAndHints(Query query)
-
createQuery
public <T> QueryImplementor<T> createQuery(String queryString, Class<T> resultClass)
从接口复制的说明:QueryProducerCreate a typedQueryinstance for the given HQL/JPQL query string.- 指定者:
createQuery在接口中QueryProducer- 指定者:
createQuery在接口中QueryProducerImplementor- 参数:
queryString- The HQL/JPQL query- 返回:
- The Query instance for manipulation and execution
- 另请参阅:
EntityManager.createQuery(String,Class)
-
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在接口中QueryProducer- 指定者:
createNamedQuery在接口中QueryProducerImplementor- 参数:
name- the name of a pre-defined, named query- 返回:
- The Query instance for manipulation and execution
- 另请参阅:
EntityManager.createNamedQuery(String)
-
buildQueryFromName
protected <T> QueryImplementor<T> buildQueryFromName(String name, Class<T> resultType)
-
createQuery
protected <T> QueryImplementor<T> createQuery(NamedQueryDefinition namedQueryDefinition, Class<T> resultType)
-
createNativeQuery
protected <T> NativeQueryImplementor createNativeQuery(NamedSQLQueryDefinition queryDefinition, Class<T> resultType)
-
resultClassChecking
protected void resultClassChecking(Class resultType, NamedSQLQueryDefinition namedQueryDefinition)
-
createNamedQuery
public <R> QueryImplementor<R> createNamedQuery(String name, Class<R> resultClass)
从接口复制的说明:QueryProducerThe JPA-defined named, typed query creation method. This form can only represent an HQL/JPQL query (not a native query).- 指定者:
createNamedQuery在接口中QueryProducer- 指定者:
createNamedQuery在接口中QueryProducerImplementor- 参数:
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在接口中QueryProducer- 指定者:
createNativeQuery在接口中QueryProducerImplementor- 参数:
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在接口中QueryProducer- 指定者:
createNativeQuery在接口中QueryProducerImplementor- 参数:
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在接口中QueryProducer- 指定者:
createNativeQuery在接口中QueryProducerImplementor- 参数:
sqlString- Native (SQL) query stringresultSetMapping- The explicit (named) result mapping- 返回:
- The NativeQuery instance for manipulation and execution
- 另请参阅:
EntityManager.createNativeQuery(String,Class),SqlResultSetMapping
-
getNamedNativeQuery
public NativeQueryImplementor getNamedNativeQuery(String name)
从接口复制的说明:QueryProducerGet a NativeQuery instance for a named native SQL query- 指定者:
getNamedNativeQuery在接口中QueryProducer- 指定者:
getNamedNativeQuery在接口中QueryProducerImplementor- 参数:
name- The name of the pre-defined query- 返回:
- The NativeQuery instance for manipulation and execution
-
createSQLQuery
public NativeQueryImplementor createSQLQuery(String queryString)
从接口复制的说明:QueryProducerCreate aNativeQueryinstance for the given SQL query string.- 指定者:
createSQLQuery在接口中QueryProducer- 指定者:
createSQLQuery在接口中QueryProducerImplementor- 参数:
queryString- The SQL query- 返回:
- The query instance for manipulation and execution
-
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
-
getNativeQueryImplementor
protected NativeQueryImplementor getNativeQueryImplementor(String queryString, boolean isOrdinalParameterZeroBased)
-
getNamedSQLQuery
public NativeQueryImplementor getNamedSQLQuery(String name)
从接口复制的说明:QueryProducerGet a NativeQuery instance for a named native SQL query- 指定者:
getNamedSQLQuery在接口中QueryProducer- 指定者:
getNamedSQLQuery在接口中QueryProducerImplementor- 参数:
name- The name of the pre-defined query- 返回:
- The NativeQuery 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.
-
load
protected abstract Object load(String entityName, Serializable identifier)
-
list
public List list(NativeSQLQuerySpecification spec, QueryParameters queryParameters)
从接口复制的说明: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.
-
scroll
public ScrollableResultsImplementor scroll(NativeSQLQuerySpecification spec, QueryParameters queryParameters)
从接口复制的说明: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.
-
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.
-
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)
-
-