|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.domain.locale.AbstractLocaleDAOImpl
public abstract class AbstractLocaleDAOImpl
Abstract implementation for Locale DAO.
This provides basic services such as caching, but defers to the underlying implementation for CRUD operations. Since locales are system-wide and immutable, we can cache lookups in both directions.
Constructor Summary | |
---|---|
protected |
AbstractLocaleDAOImpl()
Default constructor. |
Method Summary | |
---|---|
protected abstract LocaleEntity |
createLocaleEntity(java.lang.String locale)
|
org.alfresco.util.Pair |
getDefaultLocalePair()
|
protected abstract LocaleEntity |
getLocaleEntity(java.lang.Long id)
|
protected abstract LocaleEntity |
getLocaleEntity(java.lang.String locale)
|
org.alfresco.util.Pair |
getLocalePair(java.util.Locale locale)
|
org.alfresco.util.Pair |
getLocalePair(java.lang.Long id)
|
org.alfresco.util.Pair |
getOrCreateDefaultLocalePair()
Find or create the details representing the default locale. |
org.alfresco.util.Pair |
getOrCreateLocalePair(java.util.Locale locale)
Gets the locale ID for an existing instance or creates a new entity if one doesn't exist. |
void |
setLocaleEntityCache(org.alfresco.repo.cache.SimpleCache localeEntityCache)
Set the cache that maintains the ID-Locale mappings and vice-versa (bi-directional) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractLocaleDAOImpl()
This sets up the DAO accessors to bypass any caching to handle the case where the caches are not supplied in the setters.
Method Detail |
---|
public void setLocaleEntityCache(org.alfresco.repo.cache.SimpleCache localeEntityCache)
localeEntityCache
- the cachepublic org.alfresco.util.Pair getLocalePair(java.util.Locale locale)
getLocalePair
in interface LocaleDAO
public org.alfresco.util.Pair getDefaultLocalePair()
getDefaultLocalePair
in interface LocaleDAO
public org.alfresco.util.Pair getLocalePair(java.lang.Long id)
getLocalePair
in interface LocaleDAO
id
- the unique ID of the entity
public org.alfresco.util.Pair getOrCreateLocalePair(java.util.Locale locale)
getOrCreateLocalePair
in interface LocaleDAO
locale
- the locale to fetch or null to get or create the default locale.
public org.alfresco.util.Pair getOrCreateDefaultLocalePair()
getOrCreateDefaultLocalePair
in interface LocaleDAO
protected abstract LocaleEntity getLocaleEntity(java.lang.Long id)
protected abstract LocaleEntity getLocaleEntity(java.lang.String locale)
protected abstract LocaleEntity createLocaleEntity(java.lang.String locale)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |