package org.domain.zzzzzz2.entity;

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

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.validator.NotNull;

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

	private Integer orderdetailnumber;
	private Products products;
	private Orders orders;
	private int quantityordered;
	private double priceeach;
	private short orderlinenumber;

	public Orderdetails() {
	}

	public Orderdetails(Products products, Orders orders, int quantityordered,
			double priceeach, short orderlinenumber) {
		this.products = products;
		this.orders = orders;
		this.quantityordered = quantityordered;
		this.priceeach = priceeach;
		this.orderlinenumber = orderlinenumber;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ORDERDETAILNUMBER", unique = true, nullable = false)
	public Integer getOrderdetailnumber() {
		return this.orderdetailnumber;
	}

	public void setOrderdetailnumber(Integer orderdetailnumber) {
		this.orderdetailnumber = orderdetailnumber;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PRODUCTCODE", nullable = false)
	@NotNull
	public Products getProducts() {
		return this.products;
	}

	public void setProducts(Products products) {
		this.products = products;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ORDERNUMBER", nullable = false)
	@NotNull
	public Orders getOrders() {
		return this.orders;
	}

	public void setOrders(Orders orders) {
		this.orders = orders;
	}

	@Column(name = "QUANTITYORDERED", nullable = false)
	public int getQuantityordered() {
		return this.quantityordered;
	}

	public void setQuantityordered(int quantityordered) {
		this.quantityordered = quantityordered;
	}

	@Column(name = "PRICEEACH", nullable = false, precision = 0, scale = 0)
	public double getPriceeach() {
		return this.priceeach;
	}

	public void setPriceeach(double priceeach) {
		this.priceeach = priceeach;
	}

	@Column(name = "ORDERLINENUMBER", nullable = false)
	public short getOrderlinenumber() {
		return this.orderlinenumber;
	}

	public void setOrderlinenumber(short orderlinenumber) {
		this.orderlinenumber = orderlinenumber;
	}

}
