package database.dataset;

import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Date;
import java.sql.Time;

/**
 * @author alexis
 * dataset de la table facture
 */
public class Facture implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 304095885467853523L;
	private int facture_p_id;
	private int client_fk_id;
	private int fermeture_fk_id;
	private String facture_commentaire;
	private int taxe_fk_id;
	private Date facture_jour;
	private Time facture_heure;
	private BigDecimal facture_depense;
	private final String NOM_TABLE = "facture";

	/**************************************************************************
	 * constructeur
	 *************************************************************************/
	
	public Facture(int facture_p_id, int client_fk_id, int fermeture_fk_id,
				   String facture_commentaire, int taxe_fk_id, Date facture_jour, Time facture_heure,
				   BigDecimal facture_depense) {
		this.facture_p_id = facture_p_id;
		this.client_fk_id = client_fk_id;
		this.fermeture_fk_id = fermeture_fk_id;
		this.facture_commentaire = facture_commentaire;
		this.taxe_fk_id = taxe_fk_id;
		this.facture_jour = facture_jour;
		this.facture_heure = facture_heure;
		this.facture_depense = facture_depense;
	}
	
	/**************************************************************************
	 * getter
	 *************************************************************************/

	/**
	 * @return the facture_p_id
	 */
	public int getFacture_p_id() {
		return facture_p_id;
	}

	/**
	 * @return the client_fk_id
	 */
	public int getClient_fk_id() {
		return client_fk_id;
	}

	/**
	 * @return the fermeture_fk_id
	 */
	public int getFermeture_fk_id() {
		return fermeture_fk_id;
	}

	/**
	 * @return the facture_commentaire
	 */
	public String getFacture_commentaire() {
		return facture_commentaire;
	}

	/**
	 * @return the taxe_fk_id
	 */
	public int getTaxe_fk_id() {
		return taxe_fk_id;
	}

	/**
	 * @return the facture_jour
	 */
	public Date getFacture_jour() {
		return facture_jour;
	}

	/**
	 * @return the facture_heure
	 */
	public Time getFacture_heure() {
		return facture_heure;
	}

	/**
	 * @return the depense
	 */
	public BigDecimal getDepense() {
		return facture_depense;
	}
	
	/**
	 * Retourne le nom de la table
	 * @return NOM_TABLE
	 */
	public String getNomTable()
	{
		return NOM_TABLE;		
	}
	
	/**************************************************************************
	 * setter
	 *************************************************************************/

	/**
	 * @param facture_p_id the facture_p_id to set
	 */
	public void setFacture_p_id(int facture_p_id) {
		this.facture_p_id = facture_p_id;
	}

	/**
	 * @param client_fk_id the client_fk_id to set
	 */
	public void setClient_fk_id(int client_fk_id) {
		this.client_fk_id = client_fk_id;
	}

	/**
	 * @param fermeture_fk_id the fermeture_fk_id to set
	 */
	public void setFermeture_fk_id(int fermeture_fk_id) {
		this.fermeture_fk_id = fermeture_fk_id;
	}

	/**
	 * @param facture_commentaire the facture_commentaire to set
	 */
	public void setFacture_commentaire(String facture_commentaire) {
		this.facture_commentaire = facture_commentaire;
	}

	/**
	 * @param taxe_fk_id the taxe_fk_id to set
	 */
	public void setTaxe_fk_id(int taxe_fk_id) {
		this.taxe_fk_id = taxe_fk_id;
	}

	/**
	 * @param facture_jour the facture_jour to set
	 */
	public void setFacture_jour(Date facture_jour) {
		this.facture_jour = facture_jour;
	}

	/**
	 * @param facture_heure the facture_heure to set
	 */
	public void setFacture_heure(Time facture_heure) {
		this.facture_heure = facture_heure;
	}

	/**
	 * @param depense the depense to set
	 */
	public void setDepense(BigDecimal facture_depense) {
		this.facture_depense = facture_depense;
	}
	
	/**************************************************************************
	 * object
	 *************************************************************************/

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "facture [facture_" +
				"p_id=" + facture_p_id + ", client_fk_id="
				+ client_fk_id + ", fermeture_fk_id=" + fermeture_fk_id
				+ ", facture_commentaire=" + facture_commentaire
				+ ", taxe_fk_id=" + taxe_fk_id + ", facture_jour="
				+ facture_jour + ", facture_heure=" + facture_heure
				+ ", facture_depense=" + facture_depense + "]";
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + client_fk_id;
		result = prime * result + ((facture_depense == null) ? 0 : facture_depense.hashCode());
		result = prime
				* result
				+ ((facture_commentaire == null) ? 0 : facture_commentaire
						.hashCode());
		result = prime * result
				+ ((facture_heure == null) ? 0 : facture_heure.hashCode());
		result = prime * result
				+ ((facture_jour == null) ? 0 : facture_jour.hashCode());
		result = prime * result + facture_p_id;
		result = prime * result + fermeture_fk_id;
		result = prime * result + taxe_fk_id;
		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 (getClass() != obj.getClass())
			return false;
		Facture other = (Facture) obj;
		if (client_fk_id != other.client_fk_id)
			return false;
		if (facture_depense == null) {
			if (other.facture_depense != null)
				return false;
		} else if (!facture_depense.equals(other.facture_depense))
			return false;
		if (facture_commentaire == null) {
			if (other.facture_commentaire != null)
				return false;
		} else if (!facture_commentaire.equals(other.facture_commentaire))
			return false;
		if (facture_heure == null) {
			if (other.facture_heure != null)
				return false;
		} else if (!facture_heure.equals(other.facture_heure))
			return false;
		if (facture_jour == null) {
			if (other.facture_jour != null)
				return false;
		} else if (!facture_jour.equals(other.facture_jour))
			return false;
		if (facture_p_id != other.facture_p_id)
			return false;
		if (fermeture_fk_id != other.fermeture_fk_id)
			return false;
		if (taxe_fk_id != other.taxe_fk_id)
			return false;
		return true;
	}
}