Interface LocaleDAO

All Known Implementing Classes:
AbstractLocaleDAOImpl, LocaleDAOImpl

public interface LocaleDAO
Data abstraction layer for Locale entities.
Since:
3.4
Author:
Derek Hulley, janv
  • Method Details

    • getLocalePair

      Pair<Long,Locale> getLocalePair(Long id)
      Parameters:
      id - the unique ID of the entity
      Returns:
      the locale pair (never null)
      Throws:
      org.springframework.dao.DataIntegrityViolationException - if the ID provided is invalid
    • getLocalePair

      Pair<Long,Locale> getLocalePair(Locale locale)
      Parameters:
      locale - the locale to fetch or null to get the default locale
      Returns:
      the locale or null if no such locale exists
    • getDefaultLocalePair

      Pair<Long,Locale> getDefaultLocalePair()
      Returns:
      the locale pair for the default locale. Although the Locale object will be populated, the ID will point to an instance that generically refers to the system's default locale i.e. the value returned can vary depending on the executing thread's default locale.
    • getOrCreateLocalePair

      Pair<Long,Locale> getOrCreateLocalePair(Locale locale)
      Gets the locale ID for an existing instance or creates a new entity if one doesn't exist.
      Parameters:
      locale - the locale to fetch or null to get or create the default locale.
      Returns:
      the locale - never null
    • getOrCreateDefaultLocalePair

      Pair<Long,Locale> getOrCreateDefaultLocalePair()
      Find or create the details representing the default locale.
      Returns:
      the locale pair for the default locale. Although the Locale object will be populated, the ID will point to an instance that generically refers to the system's default locale i.e. the value returned can vary depending on the executing thread's default locale.