org.broadleafcommerce.common.i18n.dao
Interface TranslationDao

All Known Implementing Classes:
TranslationDaoImpl

public interface TranslationDao

Provides data access for the Translation entity.

Author:
Andre Azzolini (apazzolini)

Method Summary
 Translation create()
          Creates an empty translation instance that is not persisted to the database
 void delete(Translation translation)
          Deletes the given translation
 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)
 Translation readTranslation(TranslatedEntity entity, String entityId, String fieldName, String localeCode)
          Reads a translation for the requested parameters.
 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
 

Method Detail

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

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


Copyright © 2013. All Rights Reserved.