Interface TranslationDao

All Known Implementing Classes:
TranslationDaoImpl

public interface TranslationDao
Provides data access for the Translation entity.
Author:
Andre Azzolini (apazzolini)
  • Method Details

    • save

      Translation save(Translation translation)
      Persists the given translation
      Parameters:
      translation -
      Returns:
      the saved translation
    • create

      Translation create()
      Creates an empty translation instance that is not persisted to the database
      Returns:
      the unsaved, empty translation
    • delete

      void delete(Translation translation)
      Deletes the given translation
      Parameters:
      translation -
    • getIdPropertyMetadata

      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)
      Parameters:
      entity -
      Returns:
      the id property's metadata
    • getEntityImpl

      Class<?> getEntityImpl(TranslatedEntity entity)
      Returns the entity implementation class based on the TranslatedEntity
      Parameters:
      entity -
      Returns:
      the entity implementation class
    • readTranslationById

      Translation readTranslationById(Long translationId)
      Reads a translation by its own primary key
      Parameters:
      translationId -
      Returns:
      the translation
    • readTranslations

      List<Translation> readTranslations(TranslatedEntity entity, String entityId, String fieldName)
      Reads all translations for a given field
      Parameters:
      entity -
      entityId -
      fieldName -
      Returns:
      the list of translations
    • readTranslation

      Translation readTranslation(TranslatedEntity entity, String entityId, String fieldName, String localeCode)
      Reads a translation for the requested parameters. Returns null if there is no translation found
      Parameters:
      entity -
      entityId -
      fieldName -
      localeCode -
      Returns:
      the translation
    • getEntityId

      String getEntityId(TranslatedEntity entityType, Object entity)
      Get the id for the object. Can take into account hierarchical multitenancy to retrieve the original id.
      Parameters:
      entityType -
      entity -
      Returns:
    • countTranslationEntries

      Long countTranslationEntries(TranslatedEntity entityType, ResultType stage)
      Count the number of translations for the given params.
      Parameters:
      entityType -
      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.
      Returns:
    • readAllTranslationEntries

      List<Translation> readAllTranslationEntries(TranslatedEntity entityType, ResultType stage)
      Read all the available translations for the given params.
      Parameters:
      entityType -
      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.
      Returns:
    • readAllTranslationEntries

      List<Translation> readAllTranslationEntries(TranslatedEntity entityType, ResultType stage, List<String> entityIds)
      Read all the available translations for the given params.
      Parameters:
      entityType -
      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 by
      Returns:
    • readConvertedTranslationEntries

      List<StandardCacheItem> readConvertedTranslationEntries(TranslatedEntity entityType, ResultType stage)
      Parameters:
      entityType -
      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.
      Returns:
    • readTranslation

      Translation readTranslation(TranslatedEntity entityType, String entityId, String fieldName, String localeCode, String localeCountryCode, ResultType stage)
      Read a specific translation for the given params.
      Parameters:
      entityType -
      entityId -
      fieldName -
      localeCode -
      localeCountryCode -
      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.
      Returns: