package Dataset;

import java.io.Serializable;
import java.sql.Date;

/**
 * @author alexis
 * dataset de la table reservation
 */
public class reservation implements Serializable {
	private int reservation_p_id;
	private int chambre_fk_id;
	private int client_fk_id;
	private Date reservation_debut;
	private Date reservation_fin;

	/**************************************************************************
	 * constructeur
	 *************************************************************************/
	
	public reservation(int reservation_p_id, int chambre_fk_id, int client_fk_id,
					   Date reservation_debut, Date reservation_fin) {
		this.reservation_p_id = reservation_p_id;
		this.chambre_fk_id = chambre_fk_id;
		this.client_fk_id = client_fk_id;
		this.reservation_debut = reservation_debut;
		this.reservation_fin = reservation_fin;
	}

	/**************************************************************************
	 * getter
	 *************************************************************************/
	
	/**
	 * @return the reservation_p_id
	 */
	public int getreservation_p_id() {
		return reservation_p_id;
	}

	/**
	 * @return the chambre_fk_id
	 */
	public int getChambre_fk_id() {
		return chambre_fk_id;
	}

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

	/**
	 * @return the reservation_debut
	 */
	public Date getReservation_debut() {
		return reservation_debut;
	}

	/**
	 * @return the reservation_fin
	 */
	public Date getReservation_fin() {
		return reservation_fin;
	}

	/**************************************************************************
	 * setter
	 *************************************************************************/
	
	/**
	 * @param reservation_p_id the reservation_p_id to set
	 */
	public void setreservation_p_id(int reservation_p_id) {
		this.reservation_p_id = reservation_p_id;
	}

	/**
	 * @param chambre_fk_id the chambre_fk_id to set
	 */
	public void setChambre_fk_id(int chambre_fk_id) {
		this.chambre_fk_id = chambre_fk_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 reservation_debut the reservation_debut to set
	 */
	public void setReservation_debut(Date reservation_debut) {
		this.reservation_debut = reservation_debut;
	}

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

	/**************************************************************************
	 * object
	 *************************************************************************/
	
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "reservation [reservation_p_id=" + reservation_p_id
				+ ", chambre_fk_id=" + chambre_fk_id + ", client_fk_id="
				+ client_fk_id + ", reservation_debut=" + reservation_debut
				+ ", reservation_fin=" + reservation_fin + "]";
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + chambre_fk_id;
		result = prime * result + client_fk_id;
		result = prime
				* result
				+ ((reservation_debut == null) ? 0 : reservation_debut
						.hashCode());
		result = prime * result
				+ ((reservation_fin == null) ? 0 : reservation_fin.hashCode());
		result = prime * result + reservation_p_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 (!(obj instanceof reservation))
			return false;
		reservation other = (reservation) obj;
		if (chambre_fk_id != other.chambre_fk_id)
			return false;
		if (client_fk_id != other.client_fk_id)
			return false;
		if (reservation_debut == null) {
			if (other.reservation_debut != null)
				return false;
		} else if (!reservation_debut.equals(other.reservation_debut))
			return false;
		if (reservation_fin == null) {
			if (other.reservation_fin != null)
				return false;
		} else if (!reservation_fin.equals(other.reservation_fin))
			return false;
		if (reservation_p_id != other.reservation_p_id)
			return false;
		return true;
	}
	
	
}
