add setters and protected no-arg constructor
This commit is contained in:
parent
8208f6252b
commit
f3902ffc16
@ -32,7 +32,7 @@ public class Author {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public Author() {
|
||||
protected Author() {
|
||||
super();
|
||||
}
|
||||
|
||||
@ -40,18 +40,34 @@ public class Author {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Author [name=" + name + ", email=" + email + "]";
|
||||
|
@ -34,7 +34,7 @@ public class Book {
|
||||
this.author = author;
|
||||
}
|
||||
|
||||
public Book() {
|
||||
protected Book() {
|
||||
super();
|
||||
}
|
||||
|
||||
@ -42,18 +42,34 @@ public class Book {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public double getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(double price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public Author getAuthor() {
|
||||
return author;
|
||||
}
|
||||
|
||||
public void setAuthor(Author author) {
|
||||
this.author = author;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Book [title=" + title + ", price=" + price + ", author=" + author + "]";
|
||||
|
Loading…
x
Reference in New Issue
Block a user