package org.gen; // Generated Mar 5, 2015 8:03:38 AM by Hibernate Tools 4.3.1 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; /** * Rental generated by hbm2java */ @Entity @Table(name = "RENTAL", schema = "PUBLIC", catalog = "SAKILA") public class Rental implements java.io.Serializable { private int rentalId; private Customer customer; private Inventory inventory; private Staff staff; private Date rentalDate; private Date returnDate; private Date lastUpdate; private Set<Payment> payments = new HashSet<Payment>(0); private Set<Payment> payments_1 = new HashSet<Payment>(0); public Rental() { } public Rental(int rentalId, Customer customer, Inventory inventory, Staff staff, Date rentalDate, Date lastUpdate) { this.rentalId = rentalId; this.customer = customer; this.inventory = inventory; this.staff = staff; this.rentalDate = rentalDate; this.lastUpdate = lastUpdate; } public Rental(int rentalId, Customer customer, Inventory inventory, Staff staff, Date rentalDate, Date returnDate, Date lastUpdate, Set<Payment> payments, Set<Payment> payments_1) { this.rentalId = rentalId; this.customer = customer; this.inventory = inventory; this.staff = staff; this.rentalDate = rentalDate; this.returnDate = returnDate; this.lastUpdate = lastUpdate; this.payments = payments; this.payments_1 = payments_1; } @Id @Column(name = "RENTAL_ID", unique = true, nullable = false) public int getRentalId() { return this.rentalId; } public void setRentalId(int rentalId) { this.rentalId = rentalId; } @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 = "INVENTORY_ID", nullable = false) public Inventory getInventory() { return this.inventory; } public void setInventory(Inventory inventory) { this.inventory = inventory; } @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "STAFF_ID", nullable = false) public Staff getStaff() { return this.staff; } public void setStaff(Staff staff) { this.staff = staff; } @Temporal(TemporalType.TIMESTAMP) @Column(name = "RENTAL_DATE", nullable = false, length = 23) public Date getRentalDate() { return this.rentalDate; } public void setRentalDate(Date rentalDate) { this.rentalDate = rentalDate; } @Temporal(TemporalType.TIMESTAMP) @Column(name = "RETURN_DATE", length = 23) public Date getReturnDate() { return this.returnDate; } public void setReturnDate(Date returnDate) { this.returnDate = returnDate; } @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; } @OneToMany(fetch = FetchType.LAZY, mappedBy = "rental") public Set<Payment> getPayments() { return this.payments; } public void setPayments(Set<Payment> payments) { this.payments = payments; } @OneToMany(fetch = FetchType.LAZY, mappedBy = "rental") public Set<Payment> getPayments_1() { return this.payments_1; } public void setPayments_1(Set<Payment> payments_1) { this.payments_1 = payments_1; } }