|
|
@ -13,8 +13,8 @@ import javax.persistence.ManyToOne; |
|
|
|
import javax.persistence.Table; |
|
|
|
import javax.persistence.Table; |
|
|
|
|
|
|
|
|
|
|
|
@Entity |
|
|
|
@Entity |
|
|
|
@Table(name="item") |
|
|
|
@Table(name = "item") |
|
|
|
public class Item implements Serializable{ |
|
|
|
public class Item implements Serializable { |
|
|
|
private static final long serialVersionUID = 1993L; |
|
|
|
private static final long serialVersionUID = 1993L; |
|
|
|
|
|
|
|
|
|
|
|
@Id |
|
|
|
@Id |
|
|
@ -22,16 +22,18 @@ public class Item implements Serializable{ |
|
|
|
@Column(name = "id", unique = true) |
|
|
|
@Column(name = "id", unique = true) |
|
|
|
private long id; |
|
|
|
private long id; |
|
|
|
|
|
|
|
|
|
|
|
@ManyToOne(fetch=FetchType.LAZY) |
|
|
|
@ManyToOne(fetch = FetchType.LAZY) |
|
|
|
@JoinColumn(name="isbn") |
|
|
|
@JoinColumn(name = "isbn") |
|
|
|
private Book book; |
|
|
|
private Book book; |
|
|
|
|
|
|
|
|
|
|
|
@ManyToOne(fetch=FetchType.LAZY) |
|
|
|
@ManyToOne(fetch = FetchType.LAZY) |
|
|
|
@JoinColumn(name="location") |
|
|
|
@JoinColumn(name = "location") |
|
|
|
private Location location; |
|
|
|
private Location location; |
|
|
|
|
|
|
|
|
|
|
|
public Item () {} |
|
|
|
public Item() { |
|
|
|
public Item(Book book, Location location){ |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Item(Book book, Location location) { |
|
|
|
super(); |
|
|
|
super(); |
|
|
|
this.book = book; |
|
|
|
this.book = book; |
|
|
|
this.location = location; |
|
|
|
this.location = location; |
|
|
@ -41,11 +43,11 @@ public class Item implements Serializable{ |
|
|
|
return this.id; |
|
|
|
return this.id; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Book getBook(){ |
|
|
|
public Book getBook() { |
|
|
|
return this.book; |
|
|
|
return this.book; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setBook(Book book){ |
|
|
|
public void setBook(Book book) { |
|
|
|
this.book = book; |
|
|
|
this.book = book; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -57,5 +59,4 @@ public class Item implements Serializable{ |
|
|
|
this.location = location; |
|
|
|
this.location = location; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |