package org.domain.zzzzzz2.entity;

// Generated 01.03.2010 19:13:35 by Hibernate Tools 3.2.6.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * Orders generated by hbm2java
 */
@Entity
@Table(name = "ORDERS", schema = "PUBLIC")
public class Orders implements java.io.Serializable {

	private int ordernumber;
	private Customers customers;
	private Date orderdate;
	private Date requireddate;
	private Date shippeddate;
	private String status;
	private String comments;
	private Set<Orderdetails> orderdetailses = new HashSet<Orderdetails>(0);

	public Orders() {
	}

	public Orders(int ordernumber, Customers customers, Date orderdate,
			Date requireddate, String status) {
		this.ordernumber = ordernumber;
		this.customers = customers;
		this.orderdate = orderdate;
		this.requireddate = requireddate;
		this.status = status;
	}

	public Orders(int ordernumber, Customers customers, Date orderdate,
			Date requireddate, Date shippeddate, String status,
			String comments, Set<Orderdetails> orderdetailses) {
		this.ordernumber = ordernumber;
		this.customers = customers;
		this.orderdate = orderdate;
		this.requireddate = requireddate;
		this.shippeddate = shippeddate;
		this.status = status;
		this.comments = comments;
		this.orderdetailses = orderdetailses;
	}

	@Id
	@Column(name = "ORDERNUMBER", unique = true, nullable = false)
	public int getOrdernumber() {
		return this.ordernumber;
	}

	public void setOrdernumber(int ordernumber) {
		this.ordernumber = ordernumber;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CUSTOMERNUMBER", nullable = false)
	@NotNull
	public Customers getCustomers() {
		return this.customers;
	}

	public void setCustomers(Customers customers) {
		this.customers = customers;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "ORDERDATE", nullable = false, length = 0)
	@NotNull
	public Date getOrderdate() {
		return this.orderdate;
	}

	public void setOrderdate(Date orderdate) {
		this.orderdate = orderdate;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "REQUIREDDATE", nullable = false, length = 0)
	@NotNull
	public Date getRequireddate() {
		return this.requireddate;
	}

	public void setRequireddate(Date requireddate) {
		this.requireddate = requireddate;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "SHIPPEDDATE", length = 0)
	public Date getShippeddate() {
		return this.shippeddate;
	}

	public void setShippeddate(Date shippeddate) {
		this.shippeddate = shippeddate;
	}

	@Column(name = "STATUS", nullable = false, length = 16)
	@NotNull
	@Length(max = 16)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Column(name = "COMMENTS")
	public String getComments() {
		return this.comments;
	}

	public void setComments(String comments) {
		this.comments = comments;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "orders")
	public Set<Orderdetails> getOrderdetailses() {
		return this.orderdetailses;
	}

	public void setOrderdetailses(Set<Orderdetails> orderdetailses) {
		this.orderdetailses = orderdetailses;
	}

}
