i was doing a small project for library management. so, for that i have started with this simple thing to add details and fetching them. i am not getting table created when i use h2 database. here is my code. could someone fix it.
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Table(name ="library")
@Entity
public class Book {
@Id
private int id;
private String author;
private String title;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
@Override
public String toString() {
return "Book [id=" + id + ", author=" + author + ", title=" + title + "]";
}