public class TranslationBatchReadCache extends Object
Translation
s for a batch of processing. This is mainly
used when executing a search re-index operation. Rather than go to the database for each item being indexed, it makes
more sense to go to the database once, cache all of the results here, and then let the TranslationService
use this instead.Modifier and Type | Field and Description |
---|---|
static String |
CACHE_NAME |
Constructor and Description |
---|
TranslationBatchReadCache() |
Modifier and Type | Method and Description |
---|---|
static void |
addToCache(List<Translation> translations) |
protected static String |
buildCacheKey(TranslatedEntity entityType,
String id,
String propertyName,
String localeCode) |
protected static String |
buildCacheKey(Translation translation) |
static void |
clearCache() |
protected static javax.cache.Cache<Long,Map<String,Translation>> |
getCache() |
static Translation |
getFromCache(TranslatedEntity entityType,
String id,
String propertyName,
String localeCode) |
protected static Map<String,Translation> |
getThreadlocalCache() |
static boolean |
hasCache() |
public static final String CACHE_NAME
protected static javax.cache.Cache<Long,Map<String,Translation>> getCache()
protected static Map<String,Translation> getThreadlocalCache()
public static void clearCache()
public static boolean hasCache()
public static void addToCache(List<Translation> translations)
public static Translation getFromCache(TranslatedEntity entityType, String id, String propertyName, String localeCode)
protected static String buildCacheKey(Translation translation)
protected static String buildCacheKey(TranslatedEntity entityType, String id, String propertyName, String localeCode)
Copyright © 2022. All rights reserved.