package org.domain.zzzzzz2.entity;

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

import java.util.Date;
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 javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

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

	private Integer paymentnumber;
	private Customers customers;
	private String checknumber;
	private Date paymentdate;
	private double amount;

	public Payments() {
	}

	public Payments(Customers customers, String checknumber, Date paymentdate,
			double amount) {
		this.customers = customers;
		this.checknumber = checknumber;
		this.paymentdate = paymentdate;
		this.amount = amount;
	}

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

	public void setPaymentnumber(Integer paymentnumber) {
		this.paymentnumber = paymentnumber;
	}

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

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

	@Column(name = "CHECKNUMBER", nullable = false, length = 50)
	@NotNull
	@Length(max = 50)
	public String getChecknumber() {
		return this.checknumber;
	}

	public void setChecknumber(String checknumber) {
		this.checknumber = checknumber;
	}

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

	public void setPaymentdate(Date paymentdate) {
		this.paymentdate = paymentdate;
	}

	@Column(name = "AMOUNT", nullable = false, precision = 0, scale = 0)
	public double getAmount() {
		return this.amount;
	}

	public void setAmount(double amount) {
		this.amount = amount;
	}

}
