hierbante 官方给出配置缓存相关的属性

本文详细介绍了Hibernate中各种缓存属性的配置与使用方法,包括二级缓存、查询缓存等,帮助开发者更好地理解并利用这些特性提升应用程序的性能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Table A.2. Cache Properties

Property Example Purpose
hibernate.cache.provider_classFully-qualified classnameThe classname of a custom CacheProvider.
hibernate.cache.use_minimal_puts

true or false

Optimizes second-level cache operation to minimize writes, at the cost of more frequent reads. This is most useful for clustered caches and is enabled by default for clustered cache implementations.
hibernate.cache.use_query_cache

true or false

Enables the query cache. You still need to set individual queries to be cachable.
hibernate.cache.use_second_level_cache

true or false

Completely disable the second level cache, which is enabled by default for classes which specify a <cache> mapping.
hibernate.cache.query_cache_factoryFully-qualified classnameA custom QueryCache interface. The default is the built-in StandardQueryCache.
hibernate.cache.region_prefixA stringA prefix for second-level cache region names.
hibernate.cache.use_structured_entries

true or false

Forces Hibernate to store data in the second-level cache in a more human-readable format.
hibernate.cache.auto_evict_collection_cache

true or false(default: false)

Enables the automatic eviction of a bi-directional association's collection cache when an element in the ManyToOne collection is added/updated/removed without properly managing the change on the OneToMany side.
hibernate.cache.use_reference_entries

true or false

Optimizes second-level cache operation to store immutable entities (aka "reference") which do not have associations into cache directly, this case, lots of disasseble and deep copy operations can be avoid. Default value of this property is false.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值