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