/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package database.dataset;

import java.io.Serializable;

/**
 * @author alexis
 * dataset de la table client
 */
public class Client implements Serializable {
    /**
	 * 
	 */
	private static final long serialVersionUID = -2141974466955831962L;
	private int client_p_id;
    private String client_nom;
    private String client_prenom;
    private int adresse_fk_id;
    private String client_commentaire;
    private final String NOM_TABLE = "client";

	/**************************************************************************
	 * constructeur
	 *************************************************************************/
	
    public Client(int client_p_id, 
    		      String client_nom, 
    		      String client_prenom,
				  int adresse_fk_id, 
				  String client_commentaire) {
		this.client_p_id = client_p_id;
		this.client_nom = client_nom;
		this.client_prenom = client_prenom;
		this.adresse_fk_id = adresse_fk_id;
		this.client_commentaire = client_commentaire;
	}

	/**************************************************************************
	 * getter
	 *************************************************************************/
	
	/**
	 * @return the client_p_id
	 */
	public int getClient_p_id() {
		return client_p_id;
	}
	
	/**
	 * @return the client_nom
	 */
	public String getClient_nom() {
		return client_nom;
	}
	
	/**
	 * @return the client_prenom
	 */
	public String getClient_prenom() {
		return client_prenom;
	}
	
	/**
	 * @return the adresse_fk_id
	 */
	public int getAdresse_fk_id() {
		return adresse_fk_id;
	}
	
	/**
	 * @return the client_commentaire
	 */
	public String getClient_commentaire() {
		return client_commentaire;
	}

	/**
	 * Retourne le nom de la table
	 * @return NOM_TABLE
	 */
	public String getNomTable()
	{
		return NOM_TABLE;		
	}
	
	/**************************************************************************
	 * setter
	 *************************************************************************/
	
	/**
	 * @param client_p_id the client_p_id to set
	 */
	public void setClient_p_id(int client_p_id) {
		this.client_p_id = client_p_id;
	}
	
	/**
	 * @param client_nom the client_nom to set
	 */
	public void setClient_nom(String client_nom) {
		this.client_nom = client_nom;
	}
	
	/**
	 * @param client_prenom the client_prenom to set
	 */
	public void setClient_prenom(String client_prenom) {
		this.client_prenom = client_prenom;
	}
	
	/**
	 * @param adresse_fk_id the adresse_fk_id to set
	 */
	public void setAdresse_fk_id(int adresse_fk_id) {
		this.adresse_fk_id = adresse_fk_id;
	}
	
	/**
	 * @param client_commentaire the client_commentaire to set
	 */
	public void setClient_commentaire(String client_commentaire) {
		this.client_commentaire = client_commentaire;
	}

	/**************************************************************************
	 * object
	 *************************************************************************/
	
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "client [client_p_id=" + client_p_id + ", client_nom="
				+ client_nom + ", client_prenom=" + client_prenom
				+ ", adresse_fk_id=" + adresse_fk_id + ", client_commentaire="
				+ client_commentaire + "]";
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + adresse_fk_id;
		result = prime
				* result
				+ ((client_commentaire == null) ? 0 : client_commentaire
						.hashCode());
		result = prime * result
				+ ((client_nom == null) ? 0 : client_nom.hashCode());
		result = prime * result + client_p_id;
		result = prime * result
				+ ((client_prenom == null) ? 0 : client_prenom.hashCode());
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof Client))
			return false;
		Client other = (Client) obj;
		if (adresse_fk_id != other.adresse_fk_id)
			return false;
		if (client_commentaire == null) {
			if (other.client_commentaire != null)
				return false;
		} else if (!client_commentaire.equals(other.client_commentaire))
			return false;
		if (client_nom == null) {
			if (other.client_nom != null)
				return false;
		} else if (!client_nom.equals(other.client_nom))
			return false;
		if (client_p_id != other.client_p_id)
			return false;
		if (client_prenom == null) {
			if (other.client_prenom != null)
				return false;
		} else if (!client_prenom.equals(other.client_prenom))
			return false;
		return true;
	}
}