All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.evasion.entity.Template Maven / Gradle / Ivy

The newest version!
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.evasion.entity;

import com.evasion.EntityJPA;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

/**
 *
 * @author sebastien
 */
@Entity(name = Template.ENTITY_NAME)
@Table(name = Template.ENTITY_NAME)
public class Template extends EntityJPA {

    /**
     * *
     * serialVersionUID.
     */
    private static final long serialVersionUID = 1L;

    public static final String ENTITY_NAME = "COM_TEMPLATE";

    /**
     * Id technique.
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    private String keyTp;

    private String language;

    private String text;

    /**
     * Constructeur par defaut (utilise pour la persistence.
     */
    protected Template() {
    }

    /**
     * Constructeur
     *
     * @param key clé d'accès au template
     * @param language
     * @param text
     */
    public Template(String key, String locale, String text) {
        this.keyTp = key;
        this.language = locale;
        this.text = text;
    }

    public String getKey() {
        return keyTp;
    }

    public void setKey(String key) {
        this.keyTp = key;
    }

    public String getLanguage() {
        return language;
    }

    public void setLanguage(String locale) {
        this.language = locale;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    @Override
    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    /**
     * {@inheritDoc }
     */
    @Override
    public boolean equals(final Object obj) {
        if (obj == null) {
            return false;
        }
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof Template)) {
            return false;
        }
        Template rhs = (Template) obj;

        return new EqualsBuilder().append(this.keyTp, rhs.keyTp).
                append(this.language, rhs.language).
                isEquals();
    }

    /**
     * {@inheritDoc }
     */
    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37).append(this.keyTp).
                append(this.language).toHashCode();
    }

    /**
     * {@inheritDoc }
     */
    @Override
    public String toString() {
        return new ToStringBuilder(this).append("keyTp", this.keyTp).
                append("language", this.language).toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy