Update Loan.java

develop
@Territory91 5 years ago
parent a6654c87cd
commit 67f8ed4866
  1. 39
      mivan/src/main/java/mivan/model/Loan.java

@ -1,7 +1,10 @@
package mivan.model;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
public class Loan {
@ -19,6 +22,18 @@ public class Loan {
@Column(name = "state", nullable = false)
private String state;
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="item")
private Item item;
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="staff")
private Staff staff;
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="user")
private User user;
public Loan(long id, String date_start, String date_end, String state) {
this.id = id;
@ -59,5 +74,29 @@ public class Loan {
this.state = state;
}
public Item getItem() {
return item;
}
public Staff getStaff() {
return staff;
}
public User getUser() {
return user;
}
public void setItem(Item item) {
this.item = item;
}
public void setStaff(Staff staff) {
this.staff = staff;
}
public void setUser(User user) {
this.user = user;
}
}

Loading…
Cancel
Save