Updated JavaDoc of LocalizedString
parent
f62ece6de1
commit
69de594da6
|
|
@ -37,35 +37,38 @@ import java.util.Set;
|
|||
|
||||
import static org.libreccm.l10n.L10NConstants.L10N_XML_NS;
|
||||
|
||||
import org.hibernate.annotations.Type;
|
||||
|
||||
import javax.json.Json;
|
||||
import javax.json.JsonObject;
|
||||
import javax.json.JsonObjectBuilder;
|
||||
import javax.persistence.Column;
|
||||
|
||||
/**
|
||||
* A helper class for localisable string properties. This class is declared as
|
||||
* embeddable, so that it can be used in every other entity. The localised
|
||||
* A helper class for localisable string properties. For using this class a
|
||||
* Hibernate User type is provided ({@link LocalizedStringType} which maps
|
||||
* instances of this class to a JSONB column in the database. The localised
|
||||
* values are stored in a {@link Map}. This class is <em>not</em> designed to be
|
||||
* overwritten. But because it is an entity class we can't make the class final.
|
||||
*
|
||||
* To use this class you must annoate this property with the {@link Type}
|
||||
* annotation provided by hibernate. The {@link Column} annotation can used
|
||||
* a usual to set the name of the database column. Example
|
||||
*
|
||||
* <pre>
|
||||
* @Column(name = "DESCRIPTION")
|
||||
@Type(type = "org.libreccm.l10n.LocalizedStringType")
|
||||
private LocalizedString description;
|
||||
* </pre>
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
//@Embeddable
|
||||
@XmlRootElement(name = "localized-string", namespace = L10N_XML_NS)
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class LocalizedString implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 7378282657084330425L;
|
||||
|
||||
/**
|
||||
* The localised values of the string.
|
||||
*/
|
||||
// @ElementCollection(fetch = FetchType.LAZY)
|
||||
// @MapKeyColumn(name = "LOCALE")
|
||||
// @Column(name = "LOCALIZED_VALUE")
|
||||
// @Basic
|
||||
// @Lob
|
||||
// @Type(type = "org.hibernate.type.TextType")
|
||||
// @Field
|
||||
@XmlElement(name = "values", namespace = L10N_XML_NS)
|
||||
@XmlJavaTypeAdapter(LocalizedStringValuesAdapter.class)
|
||||
private Map<Locale, String> values;
|
||||
|
|
|
|||
Loading…
Reference in New Issue