-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBooks.java
More file actions
59 lines (48 loc) · 1.48 KB
/
Books.java
File metadata and controls
59 lines (48 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package com.example.accessingdatajpa;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class Books{
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private Long BookId;
private String BookName;
private String BookPublisher;
private String BookAuthor;
private Int YearReleased;
private Int version;
protected Books() {}
public Users(String firstName, String lastName) {
this.BookId = BookId;
this.BookName = BookName;
this.BookPublisher = BookPublisher;
this.BookAuthor = BookAuthor;
this.YearReleased = YearReleased;
this.version = version;
@Override
public String toString() {
return String.format(
"Users[BookId=%d, BookName='%s', BookPublisher='%s', BookAuthor='%s', YearReleased='%d', version='%d' ]",
BookId, BookName, BookPublisher, BookAuthor, YearReleased, version);
}
public Long getBookId() {
return BookId;
}
public String getBookName() {
return BookName;
}
public String getBookPublisher() {
return BookPublisher;
}
public Int getBookAuthor() {
return BookAuthor;
}
public Int getYearReleased() {
return YearReleased;
}
public Int getVersion() {
return version;
}
}