package com.pas.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * The persistent class for the reserve_time database table.
 * 
 */
@Entity
@Table(name="reserve_time")
public class ReserveTime implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="id")
	private Integer id;

	//bi-directional many-to-one association to BidReserveTime
	@OneToMany(mappedBy="reserveTime")
	private List<BidReserveTime> bidReserveTimes;

	//bi-directional many-to-one association to DealTime
	@ManyToOne
	@JoinColumn(name="deal_time_id", nullable=false)
	private DealTime dealTime;

	//bi-directional many-to-one association to Reserve
	@ManyToOne
	@JoinColumn(name="reserve_id", nullable=false)
	private Reserve reserve;

	public ReserveTime() {
	}

	public Integer getId() {
		return this.id;
	}

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

	public List<BidReserveTime> getBidReserveTimes() {
		return this.bidReserveTimes;
	}

	public void setBidReserveTimes(List<BidReserveTime> bidReserveTimes) {
		this.bidReserveTimes = bidReserveTimes;
	}

	public BidReserveTime addBidReserveTime(BidReserveTime bidReserveTime) {
		getBidReserveTimes().add(bidReserveTime);
		bidReserveTime.setReserveTime(this);

		return bidReserveTime;
	}

	public BidReserveTime removeBidReserveTime(BidReserveTime bidReserveTime) {
		getBidReserveTimes().remove(bidReserveTime);
		bidReserveTime.setReserveTime(null);

		return bidReserveTime;
	}

	public DealTime getDealTime() {
		return this.dealTime;
	}

	public void setDealTime(DealTime dealTime) {
		this.dealTime = dealTime;
	}

	public Reserve getReserve() {
		return this.reserve;
	}

	public void setReserve(Reserve reserve) {
		this.reserve = reserve;
	}

}