@Service(value="blTranslationService") public class TranslationServiceImpl extends java.lang.Object implements TranslationService
| Modifier and Type | Field and Description |
|---|---|
protected net.sf.ehcache.Cache |
cache |
protected TranslationDao |
dao |
protected static org.apache.commons.logging.Log |
LOG |
| Constructor and Description |
|---|
TranslationServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteTranslationById(java.lang.Long translationId)
Deletes the given translations
|
protected net.sf.ehcache.Cache |
getCache() |
protected java.lang.String |
getCacheKey(TranslatedEntity entityType,
java.lang.String entityId,
java.lang.String property,
java.lang.String localeCode) |
protected java.lang.String |
getEntityId(java.lang.Object entity,
TranslatedEntity entityType) |
protected TranslatedEntity |
getEntityType(java.lang.Class<?> entityClass) |
protected TranslatedEntity |
getEntityType(java.lang.Object entity) |
protected TranslatedEntity |
getEntityType(java.lang.String className) |
java.lang.String |
getTranslatedValue(java.lang.Object entity,
java.lang.String property,
java.util.Locale locale)
Returns the translated value of the property for the given entity.
|
Translation |
getTranslation(TranslatedEntity entity,
java.lang.String entityId,
java.lang.String fieldName,
java.lang.String localeCode)
Attempts to find the translation object for the given parameters
|
java.util.List<Translation> |
getTranslations(java.lang.String ceilingEntityClassname,
java.lang.String entityId,
java.lang.String property)
Finds all current translations for the specified field
|
Translation |
save(java.lang.String entityType,
java.lang.String entityId,
java.lang.String fieldName,
java.lang.String localeCode,
java.lang.String translatedValue)
Creates a new translation object for the requested parameters, saves it, and returns the saved instance.
|
Translation |
save(Translation translation)
Persists the given translation
|
Translation |
update(java.lang.Long translationId,
java.lang.String localeCode,
java.lang.String translatedValue)
Updates the given translation id with the new locale code and translated value
|
protected static final org.apache.commons.logging.Log LOG
protected TranslationDao dao
protected net.sf.ehcache.Cache cache
@Transactional(value="blTransactionManager") public Translation save(Translation translation)
TranslationServicesave in interface TranslationService@Transactional(value="blTransactionManager") public Translation save(java.lang.String entityType, java.lang.String entityId, java.lang.String fieldName, java.lang.String localeCode, java.lang.String translatedValue)
TranslationServicesave in interface TranslationService@Transactional(value="blTransactionManager") public Translation update(java.lang.Long translationId, java.lang.String localeCode, java.lang.String translatedValue)
TranslationServiceupdate in interface TranslationService@Transactional(value="blTransactionManager") public void deleteTranslationById(java.lang.Long translationId)
TranslationServicedeleteTranslationById in interface TranslationServicepublic Translation getTranslation(TranslatedEntity entity, java.lang.String entityId, java.lang.String fieldName, java.lang.String localeCode)
TranslationServicegetTranslation in interface TranslationServicepublic java.util.List<Translation> getTranslations(java.lang.String ceilingEntityClassname, java.lang.String entityId, java.lang.String property)
TranslationServicegetTranslations in interface TranslationServicepublic java.lang.String getTranslatedValue(java.lang.Object entity,
java.lang.String property,
java.util.Locale locale)
TranslationServicegetTranslatedValue in interface TranslationServiceprotected TranslatedEntity getEntityType(java.lang.Class<?> entityClass)
protected TranslatedEntity getEntityType(java.lang.Object entity)
protected TranslatedEntity getEntityType(java.lang.String className)
protected java.lang.String getEntityId(java.lang.Object entity,
TranslatedEntity entityType)
protected java.lang.String getCacheKey(TranslatedEntity entityType, java.lang.String entityId, java.lang.String property, java.lang.String localeCode)
protected net.sf.ehcache.Cache getCache()
Copyright © 2018. All Rights Reserved.