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

com.evasion.entity.Parametre 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.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

/**
 *
 * @author sebastien.glon
 */
@Entity(name=Parametre.ENTITY_NAME)
@Table(name=Parametre.ENTITY_NAME)
@NamedQueries({
    @NamedQuery(name = Parametre.FIND_PROPERTY, query = "SELECT p FROM "+Parametre.ENTITY_NAME+
     " p WHERE p.property = ?1")})
public class Parametre extends EntityJPA {

    /***
     * serialVersionUID.
     */
    private static final long serialVersionUID = 1L;
    public static final String ENTITY_NAME = "COM_PARAMETRE";
    public static final String FIND_PROPERTY = "FIND_PROPERTY";
    /**
     * Id technique.
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    public static final int PROPERTY_MAX_LENGTH = 50;
    @Column(nullable = false, length = PROPERTY_MAX_LENGTH)
    private String property;
    public static final int VALEUR_MAX_LENGTH = 500;
    @Column(nullable = false, length = VALEUR_MAX_LENGTH)
    private String valeur;

    /**
     * Constructeur par defaut (utilise pour la persistence.
     */
    public Parametre() {
    }

    /**
     * Constructeur avec les champs obligatoires.
     * @param property nom de la propriete.
     * @param valeur valeur de la propriete.
     */
    public Parametre(final String property, final String valeur) {
        this.property = property;
        this.valeur = valeur;
    }

    public String getProperty() {
        return property;
    }

    public void setProperty(String property) {
        this.property = property;
    }

    public String getValeur() {
        return valeur;
    }

    public void setValeur(String valeur) {
        this.valeur = valeur;
    }

    @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 Parametre )) {
            return false;
        }
        Parametre rhs = (Parametre) obj;

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy