|
|
@ -1,7 +1,10 @@ |
|
|
|
package mivan.model; |
|
|
|
package mivan.model; |
|
|
|
|
|
|
|
|
|
|
|
import javax.persistence.Column; |
|
|
|
import javax.persistence.Column; |
|
|
|
|
|
|
|
import javax.persistence.FetchType; |
|
|
|
import javax.persistence.Id; |
|
|
|
import javax.persistence.Id; |
|
|
|
|
|
|
|
import javax.persistence.JoinColumn; |
|
|
|
|
|
|
|
import javax.persistence.ManyToOne; |
|
|
|
|
|
|
|
|
|
|
|
public class Loan { |
|
|
|
public class Loan { |
|
|
|
|
|
|
|
|
|
|
@ -20,6 +23,18 @@ public class Loan { |
|
|
|
@Column(name = "state", nullable = false) |
|
|
|
@Column(name = "state", nullable = false) |
|
|
|
private String state; |
|
|
|
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) { |
|
|
|
public Loan(long id, String date_start, String date_end, String state) { |
|
|
|
this.id = id; |
|
|
|
this.id = id; |
|
|
|
this.date_start = date_start; |
|
|
|
this.date_start = date_start; |
|
|
@ -59,5 +74,29 @@ public class Loan { |
|
|
|
this.state = state; |
|
|
|
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; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|