org.broadleafcommerce.common.i18n.dao
Class TranslationDaoImpl

java.lang.Object
  extended by org.broadleafcommerce.common.i18n.dao.TranslationDaoImpl
All Implemented Interfaces:
TranslationDao

@Repository(value="blTranslationDao")
public class TranslationDaoImpl
extends Object
implements TranslationDao


Field Summary
protected  DynamicDaoHelper dynamicDaoHelper
           
protected  javax.persistence.EntityManager em
           
protected  EntityConfiguration entityConfiguration
           
 
Constructor Summary
TranslationDaoImpl()
           
 
Method Summary
 Translation create()
          Creates an empty translation instance that is not persisted to the database
 void delete(Translation translation)
          Deletes the given translation
 DynamicDaoHelper getDynamicDaoHelper()
           
 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
 void setDynamicDaoHelper(DynamicDaoHelper dynamicDaoHelper)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

em

protected javax.persistence.EntityManager em

entityConfiguration

protected EntityConfiguration entityConfiguration

dynamicDaoHelper

protected DynamicDaoHelper dynamicDaoHelper
Constructor Detail

TranslationDaoImpl

public TranslationDaoImpl()
Method Detail

save

public Translation save(Translation translation)
Description copied from interface: TranslationDao
Persists the given translation

Specified by:
save in interface TranslationDao
Returns:
the saved translation

create

public Translation create()
Description copied from interface: TranslationDao
Creates an empty translation instance that is not persisted to the database

Specified by:
create in interface TranslationDao
Returns:
the unsaved, empty translation

delete

public void delete(Translation translation)
Description copied from interface: TranslationDao
Deletes the given translation

Specified by:
delete in interface TranslationDao

getIdPropertyMetadata

public Map<String,Object> getIdPropertyMetadata(TranslatedEntity entity)
Description copied from interface: TranslationDao
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)

Specified by:
getIdPropertyMetadata in interface TranslationDao
Returns:
the id property's metadata

readTranslationById

public Translation readTranslationById(Long translationId)
Description copied from interface: TranslationDao
Reads a translation by its own primary key

Specified by:
readTranslationById in interface TranslationDao
Returns:
the translation

readTranslations

public List<Translation> readTranslations(TranslatedEntity entity,
                                          String entityId,
                                          String fieldName)
Description copied from interface: TranslationDao
Reads all translations for a given field

Specified by:
readTranslations in interface TranslationDao
Returns:
the list of translations

readTranslation

public Translation readTranslation(TranslatedEntity entity,
                                   String entityId,
                                   String fieldName,
                                   String localeCode)
Description copied from interface: TranslationDao
Reads a translation for the requested parameters. Returns null if there is no translation found

Specified by:
readTranslation in interface TranslationDao
Returns:
the translation

getDynamicDaoHelper

public DynamicDaoHelper getDynamicDaoHelper()

setDynamicDaoHelper

public void setDynamicDaoHelper(DynamicDaoHelper dynamicDaoHelper)


Copyright © 2013. All Rights Reserved.