@Repository(value="blTranslationDao") public class TranslationDaoImpl extends Object implements TranslationDao
Modifier and Type | Field and Description |
---|---|
protected DynamicDaoHelper |
dynamicDaoHelper |
protected javax.persistence.EntityManager |
em |
protected EntityConfiguration |
entityConfiguration |
protected TranslationServiceExtensionManager |
extensionManager |
protected SandBoxHelper |
sandBoxHelper |
Constructor and Description |
---|
TranslationDaoImpl() |
Modifier and Type | Method and Description |
---|---|
Long |
countTranslationEntries(TranslatedEntity entityType,
ResultType stage)
Count the number of translations for the given params.
|
Translation |
create()
Creates an empty translation instance that is not persisted to the database
|
void |
delete(Translation translation)
Deletes the given translation
|
protected Translation |
findBestTranslation(String specificLocale,
List<Translation> translations) |
protected Translation |
findSpecificTranslation(String localeCountryCode,
List<Translation> translations) |
DynamicDaoHelper |
getDynamicDaoHelper() |
String |
getEntityId(TranslatedEntity entityType,
Object entity)
Get the id for the object.
|
Class<?> |
getEntityImpl(TranslatedEntity entity)
Returns the entity implementation class based on the TranslatedEntity
|
Map<String,Object> |
getIdPropertyMetadata(TranslatedEntity entity)
Returns a map that holds the following data for the given entity:
"name" --> idProperty (the name of the id property, always a String)
"type" --> idProperty's type (usually either Long or String)
|
protected String |
getUpdatedEntityId(TranslatedEntity entityType,
Long idValue) |
protected String |
getUpdatedEntityId(TranslatedEntity entityType,
String entityId) |
List<Translation> |
readAllTranslationEntries(TranslatedEntity entityType,
ResultType stage)
Read all the available translations for the given params.
|
List<Translation> |
readAllTranslationEntries(TranslatedEntity entityType,
ResultType stage,
List<String> entityIds)
Read all the available translations for the given params.
|
List<StandardCacheItem> |
readConvertedTranslationEntries(TranslatedEntity entityType,
ResultType stage)
Read all translation entries (see
TranslationDao.readAllTranslationEntries(org.broadleafcommerce.common.i18n.domain.TranslatedEntity, org.broadleafcommerce.common.extension.ResultType) ),
and convert those results into a list of StandardCacheItem instances. |
Translation |
readTranslation(TranslatedEntity entity,
String entityId,
String fieldName,
String localeCode)
Reads a translation for the requested parameters.
|
Translation |
readTranslation(TranslatedEntity entityType,
String entityId,
String fieldName,
String localeCode,
String localeCountryCode,
ResultType stage)
Read a specific translation for the given params.
|
Translation |
readTranslationById(Long translationId)
Reads a translation by its own primary key
|
List<Translation> |
readTranslations(TranslatedEntity entity,
String entityId,
String fieldName)
Reads all translations for a given field
|
Translation |
save(Translation translation)
Persists the given translation
|
void |
setDynamicDaoHelper(DynamicDaoHelper dynamicDaoHelper) |
protected javax.persistence.EntityManager em
protected EntityConfiguration entityConfiguration
protected TranslationServiceExtensionManager extensionManager
protected SandBoxHelper sandBoxHelper
protected DynamicDaoHelper dynamicDaoHelper
public Translation save(Translation translation)
TranslationDao
save
in interface TranslationDao
public Translation create()
TranslationDao
create
in interface TranslationDao
public void delete(Translation translation)
TranslationDao
delete
in interface TranslationDao
public Map<String,Object> getIdPropertyMetadata(TranslatedEntity entity)
TranslationDao
getIdPropertyMetadata
in interface TranslationDao
public Class<?> getEntityImpl(TranslatedEntity entity)
TranslationDao
getEntityImpl
in interface TranslationDao
public Translation readTranslationById(Long translationId)
TranslationDao
readTranslationById
in interface TranslationDao
public List<Translation> readTranslations(TranslatedEntity entity, String entityId, String fieldName)
TranslationDao
readTranslations
in interface TranslationDao
public Translation readTranslation(TranslatedEntity entity, String entityId, String fieldName, String localeCode)
TranslationDao
readTranslation
in interface TranslationDao
public String getEntityId(TranslatedEntity entityType, Object entity)
TranslationDao
getEntityId
in interface TranslationDao
public Long countTranslationEntries(TranslatedEntity entityType, ResultType stage)
TranslationDao
countTranslationEntries
in interface TranslationDao
stage
- param drives whether to look for entries at a template level or standard site level (multitenant concepts). Can be IGNORE. Any multitenant behavior is ignored in the absence of the multitenant module.public List<Translation> readAllTranslationEntries(TranslatedEntity entityType, ResultType stage)
TranslationDao
readAllTranslationEntries
in interface TranslationDao
stage
- param drives whether to look for entries at a template level or standard site level (multitenant concepts). Can be IGNORE. Any multitenant behavior is ignored in the absence of the multitenant module.public List<Translation> readAllTranslationEntries(TranslatedEntity entityType, ResultType stage, List<String> entityIds)
TranslationDao
readAllTranslationEntries
in interface TranslationDao
stage
- param drives whether to look for entries at a template level or standard site level (multitenant concepts). Can be IGNORE. Any multitenant behavior is ignored in the absence of the multitenant module.entityIds
- the Translation.getEntityId()
to restrict the results bypublic List<StandardCacheItem> readConvertedTranslationEntries(TranslatedEntity entityType, ResultType stage)
TranslationDao
TranslationDao.readAllTranslationEntries(org.broadleafcommerce.common.i18n.domain.TranslatedEntity, org.broadleafcommerce.common.extension.ResultType)
),
and convert those results into a list of StandardCacheItem
instances.readConvertedTranslationEntries
in interface TranslationDao
stage
- param drives whether to look for entries at a template level or standard site level (multitenant concepts). Can be IGNORE. Any multitenant behavior is ignored in the absence of the multitenant module.public Translation readTranslation(TranslatedEntity entityType, String entityId, String fieldName, String localeCode, String localeCountryCode, ResultType stage)
TranslationDao
readTranslation
in interface TranslationDao
stage
- param drives whether to look for entries at a template level or standard site level (multitenant concepts). Can be IGNORE. Any multitenant behavior is ignored in the absence of the multitenant module.protected String getUpdatedEntityId(TranslatedEntity entityType, String entityId)
protected String getUpdatedEntityId(TranslatedEntity entityType, Long idValue)
protected Translation findBestTranslation(String specificLocale, List<Translation> translations)
protected Translation findSpecificTranslation(String localeCountryCode, List<Translation> translations)
public DynamicDaoHelper getDynamicDaoHelper()
public void setDynamicDaoHelper(DynamicDaoHelper dynamicDaoHelper)
Copyright © 2022. All rights reserved.