HHH-14133 fix obvious example code error for 'second level cache' in user guide

This commit is contained in:
Nathan Xu 2020-07-31 19:14:55 -04:00 committed by Sanne Grinovero
parent 1f09db3c1c
commit da77ef948c
1 changed files with 2 additions and 2 deletions

View File

@ -206,7 +206,7 @@ public class SecondLevelCacheTest extends BaseEntityManagerFunctionalTestCase {
doInJPA( this::entityManagerFactory, entityManager -> {
//tag::caching-management-cache-mode-entity-jpa-example[]
Map<String, Object> hints = new HashMap<>( );
hints.put( "javax.persistence.cache.retrieveMode " , CacheRetrieveMode.USE );
hints.put( "javax.persistence.cache.retrieveMode" , CacheRetrieveMode.USE );
hints.put( "javax.persistence.cache.storeMode" , CacheStoreMode.REFRESH );
Person person = entityManager.find( Person.class, 1L , hints);
//end::caching-management-cache-mode-entity-jpa-example[]
@ -225,7 +225,7 @@ public class SecondLevelCacheTest extends BaseEntityManagerFunctionalTestCase {
List<Person> persons = entityManager.createQuery(
"select p from Person p", Person.class)
.setHint( QueryHints.HINT_CACHEABLE, "true")
.setHint( "javax.persistence.cache.retrieveMode " , CacheRetrieveMode.USE )
.setHint( "javax.persistence.cache.retrieveMode" , CacheRetrieveMode.USE )
.setHint( "javax.persistence.cache.storeMode" , CacheStoreMode.REFRESH )
.getResultList();
//end::caching-management-cache-mode-query-jpa-example[]