org.openwms.core.domain.system
Class I18n

java.lang.Object
  extended by org.openwms.core.domain.AbstractEntity
      extended by org.openwms.core.domain.system.I18n
All Implemented Interfaces:
Serializable, DomainObject<Long>

public class I18n
extends AbstractEntity
implements DomainObject<Long>

An I18n entity stores multiple translations assigned to an unique key.

Since:
0.1
Version:
$Revision: 1583 $
Author:
Heiko Scherrer
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.openwms.core.domain.AbstractEntity
AbstractEntity.AbstractEntityListener
 
Field Summary
static String NQ_FIND_ALL
          Query to find all I18n entities.
static String NQ_FIND_BY_UNIQUE_QUERY
          Query to find one I18n by moduleName and key.Query parameter name moduleName : The name of the Module where the I18n entity belongs toQuery parameter name key : The key of the I18n to search for
 
Fields inherited from class org.openwms.core.domain.AbstractEntity
FIND_ALL, FIND_BY_ID
 
Constructor Summary
I18n()
          Create a new I18n.
I18n(String key, I18nSet lang)
          Create a new I18n.
I18n(String moduleName, String key, I18nSet lang)
          Create a new I18n.
 
Method Summary
 boolean equals(Object obj)
           Compare the uid property field.
 String getCKey()
          Get the cKey.
 Long getId()
          Return the technical key value.
 String getKey()
          Get the key.
 I18nSet getLang()
          Get the language set.
 String getModuleName()
          Get the moduleName.
 long getVersion()
          Return the value of the optimistic locking field.
 int hashCode()
           Use the uid to calculate the hashCode.
 boolean isNew()
          Check whether the instance is a transient or persisted one.
protected  void onLoad()
          After loading the entity, combine the moduleName field and the key field.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NQ_FIND_ALL

public static final String NQ_FIND_ALL
Query to find all I18n entities.

See Also:
Constant Field Values

NQ_FIND_BY_UNIQUE_QUERY

public static final String NQ_FIND_BY_UNIQUE_QUERY
Query to find one I18n by moduleName and key.
  • Query parameter name moduleName : The name of the Module where the I18n entity belongs to
  • Query parameter name key : The key of the I18n to search for
  • See Also:
    Constant Field Values
    Constructor Detail

    I18n

    public I18n()
    Create a new I18n.


    I18n

    public I18n(String moduleName,
                String key,
                I18nSet lang)
    Create a new I18n.

    Parameters:
    moduleName - The name of the Module where this entity belongs to
    key - The key to access this translation
    lang - A set of languages
    Throws:
    IllegalArgumentException - when the moduleName or the key is null or empty

    I18n

    public I18n(String key,
                I18nSet lang)
    Create a new I18n.

    Parameters:
    key - The key to access this translation
    lang - A set of languages
    Throws:
    IllegalArgumentException - when the key is null or empty
    Method Detail

    onLoad

    protected void onLoad()
    After loading the entity, combine the moduleName field and the key field. Store the concatenated String in a transient field cKey.


    getCKey

    public String getCKey()
    Get the cKey.

    Returns:
    the cKey.

    isNew

    public boolean isNew()
    Check whether the instance is a transient or persisted one.

    Specified by:
    isNew in interface DomainObject<Long>
    Returns:
    true if transient (not persisted before), otherwise false
    See Also:
    DomainObject.isNew()

    getVersion

    public long getVersion()
    Return the value of the optimistic locking field.

    Specified by:
    getVersion in interface DomainObject<Long>
    Returns:
    the version number
    See Also:
    DomainObject.getVersion()

    getId

    public Long getId()
    Return the technical key value.

    Specified by:
    getId in interface DomainObject<Long>
    Returns:
    The technical, unique key
    See Also:
    DomainObject.getId()

    getKey

    public String getKey()
    Get the key.

    Returns:
    the key.

    getModuleName

    public String getModuleName()
    Get the moduleName.

    Returns:
    the moduleName.

    getLang

    public I18nSet getLang()
    Get the language set.

    Returns:
    the language set.

    hashCode

    public int hashCode()
    Use the uid to calculate the hashCode. Use key and moduleName for calculation.

    Overrides:
    hashCode in class AbstractEntity
    See Also:
    Object.hashCode()

    equals

    public boolean equals(Object obj)
    Compare the uid property field. Use key and moduleName for comparison.

    Overrides:
    equals in class AbstractEntity
    See Also:
    Object.equals(java.lang.Object)


    Copyright © 2005-2011 openwms.org. All Rights Reserved.