类 AbstractDelegatingSessionFactoryBuilder<T extends SessionFactoryBuilder>
- java.lang.Object
-
- org.hibernate.boot.spi.AbstractDelegatingSessionFactoryBuilder<T>
-
- 类型参数:
T- The type of a specific sub-class; Allows sub-classes to narrow down the return-type of the contract methods to a specialization ofSessionFactoryBuilder
- 所有已实现的接口:
SessionFactoryBuilder
public abstract class AbstractDelegatingSessionFactoryBuilder<T extends SessionFactoryBuilder> extends Object implements SessionFactoryBuilder
Convenience base class for custom implementors of SessionFactoryBuilder, using delegation- 作者:
- Steve Ebersole, Gunnar Morling, Guillaume Smet
-
-
构造器概要
构造器 构造器 说明 AbstractDelegatingSessionFactoryBuilder(SessionFactoryBuilder delegate)
-
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 TaddEntityNameResolver(EntityNameResolver... entityNameResolvers)Specifies one or more entity name resolvers to be applied to the SessionFactory (see theEntityNameResolvercontract for more information..TaddSessionFactoryObservers(SessionFactoryObserver... observers)Specifies one or more observers to be applied to the SessionFactory.TallowOutOfTransactionUpdateOperations(boolean allow)TapplyAutoClosing(boolean enabled)Applies whether Sessions should be automatically closed at the end of the transaction.TapplyAutoFlushing(boolean enabled)Applies whether Sessions should be automatically flushed at the end of the transaction.TapplyAutomaticEvictionOfCollectionCaches(boolean enabled)When using bi-directional many-to-one associations and caching the one-to-many side it is expected that both sides of the association are managed (actually that is true of all bi-directional associations).TapplyBatchFetchStyle(BatchFetchStyle style)What style of batching should be used?TapplyBeanManager(Object beanManager)Apply a CDI BeanManager to the SessionFactory being built.TapplyCacheRegionPrefix(String prefix)Apply a prefix to prepended to all cache region names for this SessionFactory.TapplyConnectionHandlingMode(PhysicalConnectionHandlingMode connectionHandlingMode)Apply the specified handling mode for JDBC connectionsSessionFactoryBuilderapplyConnectionProviderDisablesAutoCommit(boolean providerDisablesAutoCommit)TapplyConnectionReleaseMode(ConnectionReleaseMode connectionReleaseMode)Apply a ConnectionReleaseMode.TapplyCurrentTenantIdentifierResolver(CurrentTenantIdentifierResolver resolver)Specifies a strategy for resolving the notion of a "current" tenant-identifier when using multi-tenancy together with current sessionsTapplyCustomEntityDirtinessStrategy(CustomEntityDirtinessStrategy strategy)Specifies a custom entity dirtiness strategy to be applied to the SessionFactory.TapplyDefaultBatchFetchSize(int size)Allows specifying a default batch-fetch size for all entities and collections which do not otherwise specify a batch-fetch size.TapplyDefaultEntityMode(EntityMode entityMode)Applies the given entity mode as the default for the SessionFactory.TapplyDefaultNullPrecedence(NullPrecedence nullPrecedence)Apply a null precedence (NULLS FIRST, NULLS LAST) to be applied order-by clauses rendered into SQL queries.SessionFactoryBuilderapplyDelayedEntityLoaderCreations(boolean delay)Should entity Loaders be generated immediately?TapplyDirectReferenceCaching(boolean enabled)Generally, Hibernate will extract the information from an entity and put that extracted information into the second-level cache.TapplyEntityNotFoundDelegate(EntityNotFoundDelegate entityNotFoundDelegate)Names theEntityNotFoundDelegateto be applied to the SessionFactory.TapplyEntityTuplizer(EntityMode entityMode, Class<? extends EntityTuplizer> tuplizerClass)Register the defaultEntityTuplizerto be applied to the SessionFactory.TapplyEntityTuplizerFactory(EntityTuplizerFactory entityTuplizerFactory)Specify the EntityTuplizerFactory to use.TapplyGetGeneratedKeysSupport(boolean enabled)Should JDBCStatement.getGeneratedKeys()feature be used for retrieval of *insert-generated* ids?TapplyIdentifierRollbackSupport(boolean enabled)Should generated identifiers be "unset" on entities during a rollback?TapplyInterceptor(Interceptor interceptor)Names an interceptor to be applied to the SessionFactory, which in turn means it will be used by all Sessions unless one is explicitly specified inSessionBuilder.interceptor(org.hibernate.Interceptor)TapplyJdbcBatchingForVersionedEntities(boolean enabled)This setting controls whether versioned entities will be included in JDBC batching.TapplyJdbcBatchSize(int size)Specifies the maximum number of statements to batch together in a JDBC batch for insert, update and delete operations.TapplyJdbcFetchSize(int size)Apply a fetch size to the JDBC driver for fetching results.TapplyJtaTrackingByThread(boolean enabled)If using the built-in Hibernate JTA-based TransactionCoordinator/Builder, should it track JTA transactions by thread in an attempt to detect timeouts?TapplyLazyInitializationOutsideTransaction(boolean enabled)Should the application be allowed to initialize uninitialized lazy state outside the bounds of a transaction?TapplyMaximumFetchDepth(int depth)Apply a limit to the depth Hibernate will use for outer joins.TapplyMinimalPutsForCaching(boolean enabled)By default, Hibernate will always just push data into the cache without first checking if that data already exists.TapplyMultiTableBulkIdStrategy(MultiTableBulkIdStrategy strategy)How should updates and deletes that span multiple tables be handled?TapplyMultiTenancyStrategy(MultiTenancyStrategy strategy)Apply the form of multi-tenancy used by the applicationTapplyName(String sessionFactoryName)Applies a SessionFactory name.TapplyNameAsJndiName(boolean isJndiName)Applies a SessionFactory name.TapplyNamedQueryCheckingOnStartup(boolean enabled)Should named queries be checked on startup?TapplyNullabilityChecking(boolean enabled)Should attributes using columns marked as not-null be checked (by Hibernate) for nullness?TapplyOrderingOfInserts(boolean enabled)Apply whether ordering of inserts should be enabled.TapplyOrderingOfUpdates(boolean enabled)Apply whether ordering of updates should be enabled.TapplyPreferUserTransactions(boolean preferUserTransactions)If using the built-in Hibernate JTA-based TransactionCoordinator/Builder, should it prefer to useUserTransactionoverTransaction?TapplyQueryCacheSupport(boolean enabled)Should second level query caching support be enabled?TapplyQuerySubstitutions(Map substitutions)Apply query substitutions to use in HQL queries.TapplyResultSetsWrapping(boolean enabled)Hibernate currently accesses results from the JDBC ResultSet by name.TapplyScrollableResultsSupport(boolean enabled)Should scrollable results be supported in queries?TapplySecondLevelCacheSupport(boolean enabled)Should second level caching support be enabled?TapplySqlComments(boolean enabled)Should Hibernate apply comments to SQL it generates?TapplySqlFunction(String registrationName, SQLFunction sqlFunction)Apply a SQLFunction to the underlyingSQLFunctionRegistry.TapplyStatelessInterceptor(Class<? extends Interceptor> statelessInterceptorClass)Names an interceptor Class to be applied to the SessionFactory, which in turn means it will be used by all Sessions unless one is explicitly specified inSessionBuilder.interceptor(org.hibernate.Interceptor)TapplyStatelessInterceptor(Supplier<? extends Interceptor> statelessInterceptorSupplier)Names aSupplierinstance which is used to retrieve the interceptor to be applied to the SessionFactory, which in turn means it will be used by all Sessions unless one is explicitly specified inSessionBuilder.interceptor(org.hibernate.Interceptor)TapplyStatementInspector(StatementInspector statementInspector)Names a StatementInspector to be applied to the SessionFactory, which in turn means it will be used by all Sessions unless one is explicitly specified inSessionBuilder.statementInspector(org.hibernate.resource.jdbc.spi.StatementInspector)TapplyStatisticsSupport(boolean enabled)Applies whether statistics gathering is enabled.TapplyStrictJpaQueryLanguageCompliance(boolean enabled)Should we strictly adhere to JPA Query Language (JPQL) syntax, or more broadly support all of Hibernate's superset (HQL)?TapplyStructuredCacheEntries(boolean enabled)By default, Hibernate stores data in the cache in its own optimized format.TapplyTempTableDdlTransactionHandling(TempTableDdlTransactionHandling handling)SessionFactoryBuilderapplyTimestampsCacheFactory(TimestampsCacheFactory factory)Specifies a QueryCacheFactory to use for building query cache handlers.TapplyValidatorFactory(Object validatorFactory)Apply a Bean Validation ValidatorFactory to the SessionFactory being built.SessionFactorybuild()After all options have been set, build the SessionFactory.protected SessionFactoryBuilderdelegate()SessionFactoryBuilderenableJpaClosedCompliance(boolean enabled)SessionFactoryBuilderenableJpaListCompliance(boolean enabled)SessionFactoryBuilderenableJpaQueryCompliance(boolean enabled)SessionFactoryBuilderenableJpaTransactionCompliance(boolean enabled)TenableReleaseResourcesOnCloseEnabled(boolean enable)Should resources held byEntityManagerinstance be released immediately on close?protected abstract TgetThis()Returns a specific implementation.<S extends SessionFactoryBuilder>
Sunwrap(Class<S> type)Allows unwrapping this builder as another, more specific type.
-
-
-
构造器详细资料
-
AbstractDelegatingSessionFactoryBuilder
public AbstractDelegatingSessionFactoryBuilder(SessionFactoryBuilder delegate)
-
-
方法详细资料
-
getThis
protected abstract T getThis()
Returns a specific implementation. See the What is the "getThis trick?".
-
delegate
protected SessionFactoryBuilder delegate()
-
applyValidatorFactory
public T applyValidatorFactory(Object validatorFactory)
从接口复制的说明:SessionFactoryBuilderApply a Bean Validation ValidatorFactory to the SessionFactory being built. NOTE : De-typed to avoid hard dependency on Bean Validation jar at runtime.- 指定者:
applyValidatorFactory在接口中SessionFactoryBuilder- 参数:
validatorFactory- The Bean Validation ValidatorFactory to use- 返回:
this, for method chaining
-
applyBeanManager
public T applyBeanManager(Object beanManager)
从接口复制的说明:SessionFactoryBuilderApply a CDI BeanManager to the SessionFactory being built. NOTE : De-typed to avoid hard dependency on CDI jar at runtime.- 指定者:
applyBeanManager在接口中SessionFactoryBuilder- 参数:
beanManager- The CDI BeanManager to use- 返回:
this, for method chaining
-
applyName
public T applyName(String sessionFactoryName)
从接口复制的说明:SessionFactoryBuilderApplies a SessionFactory name.- 指定者:
applyName在接口中SessionFactoryBuilder- 参数:
sessionFactoryName- The name to use for the SessionFactory being built- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.SESSION_FACTORY_NAME
-
applyNameAsJndiName
public T applyNameAsJndiName(boolean isJndiName)
从接口复制的说明:SessionFactoryBuilderApplies a SessionFactory name.- 指定者:
applyNameAsJndiName在接口中SessionFactoryBuilder- 参数:
isJndiName-trueindicates that the name specified inSessionFactoryBuilder.applyName(java.lang.String)will be used for binding the SessionFactory into JNDI.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.SESSION_FACTORY_NAME_IS_JNDI
-
applyAutoClosing
public T applyAutoClosing(boolean enabled)
从接口复制的说明:SessionFactoryBuilderApplies whether Sessions should be automatically closed at the end of the transaction.- 指定者:
applyAutoClosing在接口中SessionFactoryBuilder- 参数:
enabled-trueindicates they should be auto-closed;falseindicates not.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.AUTO_CLOSE_SESSION
-
applyAutoFlushing
public T applyAutoFlushing(boolean enabled)
从接口复制的说明:SessionFactoryBuilderApplies whether Sessions should be automatically flushed at the end of the transaction.- 指定者:
applyAutoFlushing在接口中SessionFactoryBuilder- 参数:
enabled-trueindicates they should be auto-flushed;falseindicates not.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.FLUSH_BEFORE_COMPLETION
-
applyStatisticsSupport
public T applyStatisticsSupport(boolean enabled)
从接口复制的说明:SessionFactoryBuilderApplies whether statistics gathering is enabled.- 指定者:
applyStatisticsSupport在接口中SessionFactoryBuilder- 参数:
enabled-trueindicates that statistics gathering should be enabled;falseindicates not.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.GENERATE_STATISTICS
-
applyInterceptor
public T applyInterceptor(Interceptor interceptor)
从接口复制的说明:SessionFactoryBuilderNames an interceptor to be applied to the SessionFactory, which in turn means it will be used by all Sessions unless one is explicitly specified inSessionBuilder.interceptor(org.hibernate.Interceptor)- 指定者:
applyInterceptor在接口中SessionFactoryBuilder- 参数:
interceptor- The interceptor- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.INTERCEPTOR
-
applyStatementInspector
public T applyStatementInspector(StatementInspector statementInspector)
从接口复制的说明:SessionFactoryBuilderNames a StatementInspector to be applied to the SessionFactory, which in turn means it will be used by all Sessions unless one is explicitly specified inSessionBuilder.statementInspector(org.hibernate.resource.jdbc.spi.StatementInspector)- 指定者:
applyStatementInspector在接口中SessionFactoryBuilder- 参数:
statementInspector- The StatementInspector- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.STATEMENT_INSPECTOR
-
addSessionFactoryObservers
public T addSessionFactoryObservers(SessionFactoryObserver... observers)
从接口复制的说明:SessionFactoryBuilderSpecifies one or more observers to be applied to the SessionFactory. Can be called multiple times to add additional observers.- 指定者:
addSessionFactoryObservers在接口中SessionFactoryBuilder- 参数:
observers- The observers to add- 返回:
this, for method chaining
-
applyCustomEntityDirtinessStrategy
public T applyCustomEntityDirtinessStrategy(CustomEntityDirtinessStrategy strategy)
从接口复制的说明:SessionFactoryBuilderSpecifies a custom entity dirtiness strategy to be applied to the SessionFactory. See the contract ofCustomEntityDirtinessStrategyfor details.- 指定者:
applyCustomEntityDirtinessStrategy在接口中SessionFactoryBuilder- 参数:
strategy- The custom strategy to be used.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.CUSTOM_ENTITY_DIRTINESS_STRATEGY
-
addEntityNameResolver
public T addEntityNameResolver(EntityNameResolver... entityNameResolvers)
从接口复制的说明:SessionFactoryBuilderSpecifies one or more entity name resolvers to be applied to the SessionFactory (see theEntityNameResolvercontract for more information.. Can be called multiple times to add additional resolvers..- 指定者:
addEntityNameResolver在接口中SessionFactoryBuilder- 参数:
entityNameResolvers- The entityNameResolvers to add- 返回:
this, for method chaining
-
applyEntityNotFoundDelegate
public T applyEntityNotFoundDelegate(EntityNotFoundDelegate entityNotFoundDelegate)
从接口复制的说明:SessionFactoryBuilderNames theEntityNotFoundDelegateto be applied to the SessionFactory. EntityNotFoundDelegate is a strategy that accounts for different exceptions thrown between Hibernate and JPA when an entity cannot be found.- 指定者:
applyEntityNotFoundDelegate在接口中SessionFactoryBuilder- 参数:
entityNotFoundDelegate- The delegate/strategy to use.- 返回:
this, for method chaining
-
applyIdentifierRollbackSupport
public T applyIdentifierRollbackSupport(boolean enabled)
从接口复制的说明:SessionFactoryBuilderShould generated identifiers be "unset" on entities during a rollback?- 指定者:
applyIdentifierRollbackSupport在接口中SessionFactoryBuilder- 参数:
enabled-trueindicates identifiers should be unset;falseindicates not.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.USE_IDENTIFIER_ROLLBACK
-
applyDefaultEntityMode
public T applyDefaultEntityMode(EntityMode entityMode)
从接口复制的说明:SessionFactoryBuilderApplies the given entity mode as the default for the SessionFactory.- 指定者:
applyDefaultEntityMode在接口中SessionFactoryBuilder- 参数:
entityMode- The default entity mode to use.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.DEFAULT_ENTITY_MODE
-
applyNullabilityChecking
public T applyNullabilityChecking(boolean enabled)
从接口复制的说明:SessionFactoryBuilderShould attributes using columns marked as not-null be checked (by Hibernate) for nullness?- 指定者:
applyNullabilityChecking在接口中SessionFactoryBuilder- 参数:
enabled-trueindicates that Hibernate should perform nullness checking;falseindicates it should not.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.CHECK_NULLABILITY
-
applyLazyInitializationOutsideTransaction
public T applyLazyInitializationOutsideTransaction(boolean enabled)
从接口复制的说明:SessionFactoryBuilderShould the application be allowed to initialize uninitialized lazy state outside the bounds of a transaction?- 指定者:
applyLazyInitializationOutsideTransaction在接口中SessionFactoryBuilder- 参数:
enabled-trueindicates initialization outside the transaction should be allowed;falseindicates it should not.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.ENABLE_LAZY_LOAD_NO_TRANS
-
applyEntityTuplizerFactory
public T applyEntityTuplizerFactory(EntityTuplizerFactory entityTuplizerFactory)
从接口复制的说明:SessionFactoryBuilderSpecify the EntityTuplizerFactory to use.- 指定者:
applyEntityTuplizerFactory在接口中SessionFactoryBuilder- 参数:
entityTuplizerFactory- The EntityTuplizerFactory to use.- 返回:
this, for method chaining
-
applyEntityTuplizer
public T applyEntityTuplizer(EntityMode entityMode, Class<? extends EntityTuplizer> tuplizerClass)
从接口复制的说明:SessionFactoryBuilderRegister the defaultEntityTuplizerto be applied to the SessionFactory.- 指定者:
applyEntityTuplizer在接口中SessionFactoryBuilder- 参数:
entityMode- The entity mode that which this tuplizer will be applied.tuplizerClass- The custom tuplizer class.- 返回:
this, for method chaining
-
applyMultiTableBulkIdStrategy
public T applyMultiTableBulkIdStrategy(MultiTableBulkIdStrategy strategy)
从接口复制的说明:SessionFactoryBuilderHow should updates and deletes that span multiple tables be handled?- 指定者:
applyMultiTableBulkIdStrategy在接口中SessionFactoryBuilder- 参数:
strategy- The strategy for handling multi-table updates and deletes.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.HQL_BULK_ID_STRATEGY
-
applyTempTableDdlTransactionHandling
public T applyTempTableDdlTransactionHandling(TempTableDdlTransactionHandling handling)
-
applyBatchFetchStyle
public T applyBatchFetchStyle(BatchFetchStyle style)
从接口复制的说明:SessionFactoryBuilderWhat style of batching should be used?- 指定者:
applyBatchFetchStyle在接口中SessionFactoryBuilder- 参数:
style- The style to use- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.BATCH_FETCH_STYLE
-
applyDelayedEntityLoaderCreations
public SessionFactoryBuilder applyDelayedEntityLoaderCreations(boolean delay)
从接口复制的说明:SessionFactoryBuilderShould entity Loaders be generated immediately? Or should the creation be delayed until first need?
-
applyDefaultBatchFetchSize
public T applyDefaultBatchFetchSize(int size)
从接口复制的说明:SessionFactoryBuilderAllows specifying a default batch-fetch size for all entities and collections which do not otherwise specify a batch-fetch size.- 指定者:
applyDefaultBatchFetchSize在接口中SessionFactoryBuilder- 参数:
size- The size to use for batch fetching for entities/collections which do not specify an explicit batch fetch size.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.DEFAULT_BATCH_FETCH_SIZE
-
applyMaximumFetchDepth
public T applyMaximumFetchDepth(int depth)
从接口复制的说明:SessionFactoryBuilderApply a limit to the depth Hibernate will use for outer joins. Note that this is different than an overall limit on the number of joins...- 指定者:
applyMaximumFetchDepth在接口中SessionFactoryBuilder- 参数:
depth- The depth for limiting joins.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.MAX_FETCH_DEPTH
-
applyDefaultNullPrecedence
public T applyDefaultNullPrecedence(NullPrecedence nullPrecedence)
从接口复制的说明:SessionFactoryBuilderApply a null precedence (NULLS FIRST, NULLS LAST) to be applied order-by clauses rendered into SQL queries.- 指定者:
applyDefaultNullPrecedence在接口中SessionFactoryBuilder- 参数:
nullPrecedence- The default null precedence to use.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.DEFAULT_NULL_ORDERING
-
applyOrderingOfInserts
public T applyOrderingOfInserts(boolean enabled)
从接口复制的说明:SessionFactoryBuilderApply whether ordering of inserts should be enabled. This allows more efficient SQL generation via the use of batching for the inserts; the cost is that the determination of the ordering is far more inefficient than not ordering.- 指定者:
applyOrderingOfInserts在接口中SessionFactoryBuilder- 参数:
enabled-trueindicates that ordering should be enabled;falseindicates not- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.ORDER_INSERTS
-
applyOrderingOfUpdates
public T applyOrderingOfUpdates(boolean enabled)
从接口复制的说明:SessionFactoryBuilderApply whether ordering of updates should be enabled. This allows more efficient SQL generation via the use of batching for the updates; the cost is that the determination of the ordering is far more inefficient than not ordering.- 指定者:
applyOrderingOfUpdates在接口中SessionFactoryBuilder- 参数:
enabled-trueindicates that ordering should be enabled;falseindicates not- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.ORDER_UPDATES
-
applyMultiTenancyStrategy
public T applyMultiTenancyStrategy(MultiTenancyStrategy strategy)
从接口复制的说明:SessionFactoryBuilderApply the form of multi-tenancy used by the application- 指定者:
applyMultiTenancyStrategy在接口中SessionFactoryBuilder- 参数:
strategy- The form of multi-tenancy in use.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.MULTI_TENANT
-
applyCurrentTenantIdentifierResolver
public T applyCurrentTenantIdentifierResolver(CurrentTenantIdentifierResolver resolver)
从接口复制的说明:SessionFactoryBuilderSpecifies a strategy for resolving the notion of a "current" tenant-identifier when using multi-tenancy together with current sessions- 指定者:
applyCurrentTenantIdentifierResolver在接口中SessionFactoryBuilder- 参数:
resolver- The resolution strategy to use.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.MULTI_TENANT_IDENTIFIER_RESOLVER
-
applyJtaTrackingByThread
public T applyJtaTrackingByThread(boolean enabled)
从接口复制的说明:SessionFactoryBuilderIf using the built-in Hibernate JTA-based TransactionCoordinator/Builder, should it track JTA transactions by thread in an attempt to detect timeouts?- 指定者:
applyJtaTrackingByThread在接口中SessionFactoryBuilder- 参数:
enabled-trueindicates we should track by thread;falseindicates not- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.JTA_TRACK_BY_THREAD
-
applyPreferUserTransactions
public T applyPreferUserTransactions(boolean preferUserTransactions)
从接口复制的说明:SessionFactoryBuilderIf using the built-in Hibernate JTA-based TransactionCoordinator/Builder, should it prefer to useUserTransactionoverTransaction?- 指定者:
applyPreferUserTransactions在接口中SessionFactoryBuilder- 参数:
preferUserTransactions-trueindicates we should preferUserTransaction;falseindicates we should preferTransaction- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.PREFER_USER_TRANSACTION
-
applyQuerySubstitutions
public T applyQuerySubstitutions(Map substitutions)
从接口复制的说明:SessionFactoryBuilderApply query substitutions to use in HQL queries. Note, this is a legacy feature and almost always never needed anymore...- 指定者:
applyQuerySubstitutions在接口中SessionFactoryBuilder- 参数:
substitutions- The substitution map- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.QUERY_SUBSTITUTIONS
-
applyStrictJpaQueryLanguageCompliance
public T applyStrictJpaQueryLanguageCompliance(boolean enabled)
从接口复制的说明:SessionFactoryBuilderShould we strictly adhere to JPA Query Language (JPQL) syntax, or more broadly support all of Hibernate's superset (HQL)? Setting this totruemay cause valid HQL to throw an exception because it violates the JPQL subset.- 指定者:
applyStrictJpaQueryLanguageCompliance在接口中SessionFactoryBuilder- 参数:
enabled-trueindicates that we should strictly adhere to the JPQL subset;falseindicates we should accept the broader HQL syntax.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.JPAQL_STRICT_COMPLIANCE
-
applyNamedQueryCheckingOnStartup
public T applyNamedQueryCheckingOnStartup(boolean enabled)
从接口复制的说明:SessionFactoryBuilderShould named queries be checked on startup?- 指定者:
applyNamedQueryCheckingOnStartup在接口中SessionFactoryBuilder- 参数:
enabled-trueindicates that they should;falseindicates they should not.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.QUERY_STARTUP_CHECKING
-
applySecondLevelCacheSupport
public T applySecondLevelCacheSupport(boolean enabled)
从接口复制的说明:SessionFactoryBuilderShould second level caching support be enabled?- 指定者:
applySecondLevelCacheSupport在接口中SessionFactoryBuilder- 参数:
enabled-trueindicates we should enable the use of second level caching;falseindicates we should disable the use of second level caching.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.USE_SECOND_LEVEL_CACHE
-
applyQueryCacheSupport
public T applyQueryCacheSupport(boolean enabled)
从接口复制的说明:SessionFactoryBuilderShould second level query caching support be enabled?- 指定者:
applyQueryCacheSupport在接口中SessionFactoryBuilder- 参数:
enabled-trueindicates we should enable the use of second level query caching;falseindicates we should disable the use of second level query caching.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.USE_QUERY_CACHE
-
applyTimestampsCacheFactory
public SessionFactoryBuilder applyTimestampsCacheFactory(TimestampsCacheFactory factory)
从接口复制的说明:SessionFactoryBuilderSpecifies a QueryCacheFactory to use for building query cache handlers.- 指定者:
applyTimestampsCacheFactory在接口中SessionFactoryBuilder- 参数:
factory- The QueryCacheFactory to use- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.QUERY_CACHE_FACTORY
-
applyCacheRegionPrefix
public T applyCacheRegionPrefix(String prefix)
从接口复制的说明:SessionFactoryBuilderApply a prefix to prepended to all cache region names for this SessionFactory.- 指定者:
applyCacheRegionPrefix在接口中SessionFactoryBuilder- 参数:
prefix- The prefix.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.CACHE_REGION_PREFIX
-
applyMinimalPutsForCaching
public T applyMinimalPutsForCaching(boolean enabled)
从接口复制的说明:SessionFactoryBuilderBy default, Hibernate will always just push data into the cache without first checking if that data already exists. For some caches (mainly distributed caches) this can have a major adverse performance impact. For these caches, it is best to enable this "minimal puts" feature. Cache integrations also report whether "minimal puts" should be enabled by default. So its is very rare that users need to set this, generally speaking.- 指定者:
applyMinimalPutsForCaching在接口中SessionFactoryBuilder- 参数:
enabled-trueindicates Hibernate should first check whether data exists and only push to the cache if it does not already exist.falseindicates to perform the default behavior.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.USE_MINIMAL_PUTS,RegionFactory.isMinimalPutsEnabledByDefault()
-
applyStructuredCacheEntries
public T applyStructuredCacheEntries(boolean enabled)
从接口复制的说明:SessionFactoryBuilderBy default, Hibernate stores data in the cache in its own optimized format. However, that format is impossible to "read" if browsing the cache. The use of "structured" cache entries allows the cached data to be read.- 指定者:
applyStructuredCacheEntries在接口中SessionFactoryBuilder- 参数:
enabled-trueindicates that structured cache entries (human readable) should be used;falseindicates that the native entry structure should be used.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.USE_STRUCTURED_CACHE
-
applyDirectReferenceCaching
public T applyDirectReferenceCaching(boolean enabled)
从接口复制的说明:SessionFactoryBuilderGenerally, Hibernate will extract the information from an entity and put that extracted information into the second-level cache. This is by far the safest way to second-level cache persistent data. However, there are some cases where it is safe to cache the entity instance directly. This setting controls whether that is used in those cases.- 指定者:
applyDirectReferenceCaching在接口中SessionFactoryBuilder- 参数:
enabled-trueindicates that applicable entities will be stored into the second-level cache directly by reference; false indicates that all entities will be stored via the extraction approach.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.USE_DIRECT_REFERENCE_CACHE_ENTRIES
-
applyAutomaticEvictionOfCollectionCaches
public T applyAutomaticEvictionOfCollectionCaches(boolean enabled)
从接口复制的说明:SessionFactoryBuilderWhen using bi-directional many-to-one associations and caching the one-to-many side it is expected that both sides of the association are managed (actually that is true of all bi-directional associations). However, in this case, if the user forgets to manage the one-to-many side stale data can be left in the second-level cache. Warning: enabling this will have a performance impact. Hence why it is disabled by default (for good citizens) and is an opt-in setting.- 指定者:
applyAutomaticEvictionOfCollectionCaches在接口中SessionFactoryBuilder- 参数:
enabled-trueindicates that these collection caches should be evicted automatically.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.AUTO_EVICT_COLLECTION_CACHE
-
applyJdbcBatchSize
public T applyJdbcBatchSize(int size)
从接口复制的说明:SessionFactoryBuilderSpecifies the maximum number of statements to batch together in a JDBC batch for insert, update and delete operations. A non-zero number enables batching, but really only a number greater than zero will have any effect. If used, a number great than 5 is suggested.- 指定者:
applyJdbcBatchSize在接口中SessionFactoryBuilder- 参数:
size- The batch size to use.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.STATEMENT_BATCH_SIZE
-
applyJdbcBatchingForVersionedEntities
public T applyJdbcBatchingForVersionedEntities(boolean enabled)
从接口复制的说明:SessionFactoryBuilderThis setting controls whether versioned entities will be included in JDBC batching. The reason being that some JDBC drivers have a problems returning "accurate" update counts from batch statements. This is setting isfalseby default.- 指定者:
applyJdbcBatchingForVersionedEntities在接口中SessionFactoryBuilder- 参数:
enabled- The batch size to use.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.BATCH_VERSIONED_DATA
-
applyScrollableResultsSupport
public T applyScrollableResultsSupport(boolean enabled)
从接口复制的说明:SessionFactoryBuilderShould scrollable results be supported in queries? We ask the JDBC driver whether it supports scrollable result sets as the default for this setting, but some drivers do not accurately report this via DatabaseMetaData. Also, needed if user is supplying connections (and so no Connection is available when we bootstrap).- 指定者:
applyScrollableResultsSupport在接口中SessionFactoryBuilder- 参数:
enabled-trueto enable this support,falseto disable it- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.USE_SCROLLABLE_RESULTSET
-
applyResultSetsWrapping
public T applyResultSetsWrapping(boolean enabled)
从接口复制的说明:SessionFactoryBuilderHibernate currently accesses results from the JDBC ResultSet by name. This is known to be VERY slow on some drivers, especially older Oracle drivers. This setting allows Hibernate to wrap the ResultSet of the JDBC driver to manage the name->position resolution itself.- 指定者:
applyResultSetsWrapping在接口中SessionFactoryBuilder- 参数:
enabled-trueindicates Hibernate should wrap result sets;falseindicates it should not.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.WRAP_RESULT_SETS
-
applyGetGeneratedKeysSupport
public T applyGetGeneratedKeysSupport(boolean enabled)
从接口复制的说明:SessionFactoryBuilderShould JDBCStatement.getGeneratedKeys()feature be used for retrieval of *insert-generated* ids?- 指定者:
applyGetGeneratedKeysSupport在接口中SessionFactoryBuilder- 参数:
enabled-trueindicates we should use JDBC getGeneratedKeys support;falseindicates we should not.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.USE_GET_GENERATED_KEYS
-
applyJdbcFetchSize
public T applyJdbcFetchSize(int size)
从接口复制的说明:SessionFactoryBuilderApply a fetch size to the JDBC driver for fetching results.- 指定者:
applyJdbcFetchSize在接口中SessionFactoryBuilder- 参数:
size- The fetch size to be passed to the driver.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.USE_GET_GENERATED_KEYS,Statement.setFetchSize(int)
-
applyConnectionReleaseMode
public T applyConnectionReleaseMode(ConnectionReleaseMode connectionReleaseMode)
从接口复制的说明:SessionFactoryBuilderApply a ConnectionReleaseMode.- 指定者:
applyConnectionReleaseMode在接口中SessionFactoryBuilder- 参数:
connectionReleaseMode- The ConnectionReleaseMode to use.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.RELEASE_CONNECTIONS
-
applyConnectionProviderDisablesAutoCommit
public SessionFactoryBuilder applyConnectionProviderDisablesAutoCommit(boolean providerDisablesAutoCommit)
-
applySqlComments
public T applySqlComments(boolean enabled)
从接口复制的说明:SessionFactoryBuilderShould Hibernate apply comments to SQL it generates?- 指定者:
applySqlComments在接口中SessionFactoryBuilder- 参数:
enabled-trueindicates comments should be applied;falseindicates not.- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.USE_SQL_COMMENTS
-
applySqlFunction
public T applySqlFunction(String registrationName, SQLFunction sqlFunction)
从接口复制的说明:SessionFactoryBuilderApply a SQLFunction to the underlyingSQLFunctionRegistry. TODO : Ultimately I would like this to move toMetadataBuilderin conjunction with allowing mappings to reference SQLFunctions. today mappings can only name SQL functions directly, not through the SQLFunctionRegistry indirection- 指定者:
applySqlFunction在接口中SessionFactoryBuilder- 参数:
registrationName- The name to register it under.sqlFunction- The SQLFunction impl- 返回:
this, for method chaining
-
allowOutOfTransactionUpdateOperations
public T allowOutOfTransactionUpdateOperations(boolean allow)
-
enableReleaseResourcesOnCloseEnabled
public T enableReleaseResourcesOnCloseEnabled(boolean enable)
从接口复制的说明:SessionFactoryBuilderShould resources held byEntityManagerinstance be released immediately on close? The other option is to release them as part of an after-transaction callback.
-
enableJpaQueryCompliance
public SessionFactoryBuilder enableJpaQueryCompliance(boolean enabled)
-
enableJpaTransactionCompliance
public SessionFactoryBuilder enableJpaTransactionCompliance(boolean enabled)
-
enableJpaListCompliance
public SessionFactoryBuilder enableJpaListCompliance(boolean enabled)
-
enableJpaClosedCompliance
public SessionFactoryBuilder enableJpaClosedCompliance(boolean enabled)
-
unwrap
public <S extends SessionFactoryBuilder> S unwrap(Class<S> type)
从接口复制的说明:SessionFactoryBuilderAllows unwrapping this builder as another, more specific type.- 指定者:
unwrap在接口中SessionFactoryBuilder- 返回:
- The unwrapped builder.
-
applyStatelessInterceptor
public T applyStatelessInterceptor(Supplier<? extends Interceptor> statelessInterceptorSupplier)
从接口复制的说明:SessionFactoryBuilderNames aSupplierinstance which is used to retrieve the interceptor to be applied to the SessionFactory, which in turn means it will be used by all Sessions unless one is explicitly specified inSessionBuilder.interceptor(org.hibernate.Interceptor)- 指定者:
applyStatelessInterceptor在接口中SessionFactoryBuilder- 参数:
statelessInterceptorSupplier-Supplierinstance which is used to retrieve the interceptor- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.SESSION_SCOPED_INTERCEPTOR
-
applyStatelessInterceptor
public T applyStatelessInterceptor(Class<? extends Interceptor> statelessInterceptorClass)
从接口复制的说明:SessionFactoryBuilderNames an interceptor Class to be applied to the SessionFactory, which in turn means it will be used by all Sessions unless one is explicitly specified inSessionBuilder.interceptor(org.hibernate.Interceptor)- 指定者:
applyStatelessInterceptor在接口中SessionFactoryBuilder- 参数:
statelessInterceptorClass- The interceptor class- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.SESSION_SCOPED_INTERCEPTOR
-
applyConnectionHandlingMode
public T applyConnectionHandlingMode(PhysicalConnectionHandlingMode connectionHandlingMode)
从接口复制的说明:SessionFactoryBuilderApply the specified handling mode for JDBC connections- 指定者:
applyConnectionHandlingMode在接口中SessionFactoryBuilder- 参数:
connectionHandlingMode- The handling mode to apply- 返回:
this, for method chaining- 另请参阅:
AvailableSettings.ACQUIRE_CONNECTIONS,AvailableSettings.RELEASE_CONNECTIONS,ConnectionAcquisitionMode,ConnectionReleaseMode
-
build
public SessionFactory build()
从接口复制的说明:SessionFactoryBuilderAfter all options have been set, build the SessionFactory.- 指定者:
build在接口中SessionFactoryBuilder- 返回:
- The built SessionFactory.
-
-