0

我想使用 springboot 将键和值存储在 ehcache3 中。我想将键存储为“passportNumber”,将值存储为“名称”,类似于 java 中的 Hashmap 稍后一旦缓存,如何从 passportNumber 中检索值。

我是新手ehcache-3,我需要一些代码。我没有在网站上找到任何示例,也没有通过谷歌搜索。

4

1 回答 1

0

不要选择 ehcache 3.x,因为许多功能只需支付一次即可使用。最好选择 ehcache 3.x 以下的版本。

阅读此文档以了解 Ehcache - Spring 实现:

https://www.ehcache.org/documentation/2.8/integrations/spring.html

阅读此文档以了解如何在 java 中使用 ehcache:

https://www.ehcache.org/documentation/2.8/code-samples.html#using-caches

阅读此文档以了解如何配置 ehcache:

https://www.ehcache.org/documentation/2.8/configuration/configuration.html

ehcache + Spring Boot 有很多例子。请搜索它。

于 2019-07-03T14:35:45.353 回答