package org.gen;
// Generated Mar 5, 2015 8:03:38 AM by Hibernate Tools 4.3.1
import java.math.BigDecimal;
import java.util.Date;
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.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/**
* Payment generated by hbm2java
*/
@Entity
@Table(name = "PAYMENT", schema = "PUBLIC", catalog = "SAKILA")
public class Payment implements java.io.Serializable {
private short paymentId;
private Customer customer;
private Rental rental;
private Staff staff;
private BigDecimal amount;
private Date paymentDate;
private Date lastUpdate;
public Payment() {
}
public Payment(short paymentId, Customer customer, Staff staff,
BigDecimal amount, Date paymentDate, Date lastUpdate) {
this.paymentId = paymentId;
this.customer = customer;
this.staff = staff;
this.amount = amount;
this.paymentDate = paymentDate;
this.lastUpdate = lastUpdate;
}
public Payment(short paymentId, Customer customer, Rental rental,
Staff staff, BigDecimal amount, Date paymentDate, Date lastUpdate) {
this.paymentId = paymentId;
this.customer = customer;
this.rental = rental;
this.staff = staff;
this.amount = amount;
this.paymentDate = paymentDate;
this.lastUpdate = lastUpdate;
}
@Id
@Column(name = "PAYMENT_ID", unique = true, nullable = false)
public short getPaymentId() {
return this.paymentId;
}
public void setPaymentId(short paymentId) {
this.paymentId = paymentId;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "CUSTOMER_ID", nullable = false)
public Customer getCustomer() {
return this.customer;
}
public void setCustomer(Customer customer) {
this.customer = customer;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "RENTAL_ID")
public Rental getRental() {
return this.rental;
}
public void setRental(Rental rental) {
this.rental = rental;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "STAFF_ID", nullable = false)
public Staff getStaff() {
return this.staff;
}
public void setStaff(Staff staff) {
this.staff = staff;
}
@Column(name = "AMOUNT", nullable = false, precision = 5)
public BigDecimal getAmount() {
return this.amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "PAYMENT_DATE", nullable = false, length = 23)
public Date getPaymentDate() {
return this.paymentDate;
}
public void setPaymentDate(Date paymentDate) {
this.paymentDate = paymentDate;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "LAST_UPDATE", nullable = false, length = 23)
public Date getLastUpdate() {
return this.lastUpdate;
}
public void setLastUpdate(Date lastUpdate) {
this.lastUpdate = lastUpdate;
}
}