|
|
@ -11,7 +11,7 @@ public class Loan { |
|
|
|
private static final long serialVersionUID = -5124436115031696628L; |
|
|
|
private static final long serialVersionUID = -5124436115031696628L; |
|
|
|
|
|
|
|
|
|
|
|
@Id |
|
|
|
@Id |
|
|
|
@Column(name = "id", nullable=false, unique=true) |
|
|
|
@Column(name = "id", nullable = false, unique = true) |
|
|
|
private long id; |
|
|
|
private long id; |
|
|
|
|
|
|
|
|
|
|
|
@Column(name = "date_start", nullable = false) |
|
|
|
@Column(name = "date_start", nullable = false) |
|
|
@ -23,23 +23,25 @@ public class Loan { |
|
|
|
@Column(name = "state", nullable = false) |
|
|
|
@Column(name = "state", nullable = false) |
|
|
|
private String state; |
|
|
|
private String state; |
|
|
|
|
|
|
|
|
|
|
|
@ManyToOne(fetch=FetchType.LAZY) |
|
|
|
@ManyToOne(fetch = FetchType.LAZY) |
|
|
|
@JoinColumn(name="item") |
|
|
|
@JoinColumn(name = "item") |
|
|
|
private Item item; |
|
|
|
private Item item; |
|
|
|
|
|
|
|
|
|
|
|
@ManyToOne(fetch=FetchType.LAZY) |
|
|
|
@ManyToOne(fetch = FetchType.LAZY) |
|
|
|
@JoinColumn(name="staff") |
|
|
|
@JoinColumn(name = "staff") |
|
|
|
private Staff staff; |
|
|
|
private Staff staff; |
|
|
|
|
|
|
|
|
|
|
|
@ManyToOne(fetch=FetchType.LAZY) |
|
|
|
@ManyToOne(fetch = FetchType.LAZY) |
|
|
|
@JoinColumn(name="user") |
|
|
|
@JoinColumn(name = "user") |
|
|
|
private User user; |
|
|
|
private User user; |
|
|
|
|
|
|
|
|
|
|
|
public Loan(long id, String date_start, String date_end, String state) { |
|
|
|
public Loan(String date_start, String date_end, String state, Item item, Staff staff, User user) { |
|
|
|
this.id = id; |
|
|
|
|
|
|
|
this.date_start = date_start; |
|
|
|
this.date_start = date_start; |
|
|
|
this.date_end = date_end; |
|
|
|
this.date_end = date_end; |
|
|
|
this.state = state; |
|
|
|
this.state = state; |
|
|
|
|
|
|
|
this.item = item; |
|
|
|
|
|
|
|
this.staff = staff; |
|
|
|
|
|
|
|
this.user = user; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public long getId() { |
|
|
|
public long getId() { |
|
|
@ -58,6 +60,18 @@ public class Loan { |
|
|
|
return state; |
|
|
|
return state; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Item getItem() { |
|
|
|
|
|
|
|
return item; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Staff getStaff() { |
|
|
|
|
|
|
|
return staff; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public User getUser() { |
|
|
|
|
|
|
|
return user; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setId(long id) { |
|
|
|
public void setId(long id) { |
|
|
|
this.id = id; |
|
|
|
this.id = id; |
|
|
|
} |
|
|
|
} |
|
|
@ -74,18 +88,6 @@ 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) { |
|
|
|
public void setItem(Item item) { |
|
|
|
this.item = item; |
|
|
|
this.item = item; |
|
|
|
} |
|
|
|
} |
|
|
@ -98,5 +100,4 @@ public class Loan { |
|
|
|
this.user = user; |
|
|
|
this.user = user; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|