Fish & Chips Club 4.10.0.0

hirondelle.fish.translate.translation
Class TranslationDAO

Object
  extended by hirondelle.fish.translate.translation.TranslationDAO

public final class TranslationDAO
extends Object

Data Access Object for translations.

This DAO is public since it is referenced from another package.

Operations performed : FETCH_FROM_CODER_KEYS, FETCH_FROM_NATURAL_LANG_1, FETCH_FROM_NATURAL_LANG_2 in SQL Statements.


Field Summary
static SqlId FETCH_FROM_CODER_KEYS
           
static SqlId FETCH_FROM_NATURAL_LANG_1
           
static SqlId FETCH_FROM_NATURAL_LANG_2
           
 
Constructor Summary
TranslationDAO()
           
 
Method Summary
(package private)  void add(Translation aTranslation)
          Add a new Translation.
(package private)  void change(Translation aTranslation)
          Update the text of a Translation.
(package private)  void delete(Id aBaseTextId, Id aLocaleId)
          Delete an exiting Translation.
(package private)  Translation fetch(Id aBaseTextId, Id aLocaleId)
          Return a single Translation.
 Map<String,Map<String,String>> getTranslations()
          Return Map[BaseText, Map[Locale, Translation]].
(package private)  List<Translation> list()
          Return a List of all Translation objects.
(package private)  List<Translation> listFor(Id aBaseTextId)
          Return a List<Translation>, containing all translations for the given BaseTextId.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FETCH_FROM_CODER_KEYS

public static final SqlId FETCH_FROM_CODER_KEYS

FETCH_FROM_NATURAL_LANG_1

public static final SqlId FETCH_FROM_NATURAL_LANG_1

FETCH_FROM_NATURAL_LANG_2

public static final SqlId FETCH_FROM_NATURAL_LANG_2
Constructor Detail

TranslationDAO

public TranslationDAO()
Method Detail

getTranslations

public Map<String,Map<String,String>> getTranslations()
                                               throws DAOException
Return Map[BaseText, Map[Locale, Translation]].

Calls Translation.asNestedMap(java.util.Collection).

Throws:
DAOException

list

List<Translation> list()
                 throws DAOException
Return a List of all Translation objects.

Order by base text, then by Locale.

Throws:
DAOException

listFor

List<Translation> listFor(Id aBaseTextId)
                    throws DAOException
Return a List<Translation>, containing all translations for the given BaseTextId.

A translation for the base language (English) is returned only if the BaseText is a coder key.

Throws:
DAOException

add

void add(Translation aTranslation)
   throws DAOException,
          DuplicateException
Add a new Translation.

For a given BaseText, there can be only one translation for a given SupportedLocale.

Throws:
DAOException
DuplicateException

fetch

Translation fetch(Id aBaseTextId,
                  Id aLocaleId)
            throws DAOException
Return a single Translation.

No Translation is returned if BaseText has a natural language key, and the Locale is the base locale.

Throws:
DAOException

change

void change(Translation aTranslation)
      throws DAOException
Update the text of a Translation.

The Locale of the Translation is not altered by this method.

Throws:
DAOException

delete

void delete(Id aBaseTextId,
            Id aLocaleId)
      throws DAOException
Delete an exiting Translation.

Throws:
DAOException

Fish & Chips Club 4.10.0.0

Copyright Hirondelle Systems - Generated 2013Oct19.12.26