summaryrefslogtreecommitdiff
path: root/Year_3/TSDWL/SPRING/bank/bookstore/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'Year_3/TSDWL/SPRING/bank/bookstore/src/main/java')
-rw-r--r--Year_3/TSDWL/SPRING/bank/bookstore/src/main/java/it/dmi/exam/bookstore/Book.java69
-rw-r--r--Year_3/TSDWL/SPRING/bank/bookstore/src/main/java/it/dmi/exam/bookstore/BookstoreApplication.java13
2 files changed, 82 insertions, 0 deletions
diff --git a/Year_3/TSDWL/SPRING/bank/bookstore/src/main/java/it/dmi/exam/bookstore/Book.java b/Year_3/TSDWL/SPRING/bank/bookstore/src/main/java/it/dmi/exam/bookstore/Book.java
new file mode 100644
index 0000000..c5b6312
--- /dev/null
+++ b/Year_3/TSDWL/SPRING/bank/bookstore/src/main/java/it/dmi/exam/bookstore/Book.java
@@ -0,0 +1,69 @@
+package it.dmi.exam.bookstore;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+
+import org.springframework.lang.Nullable;
+
+@Entity
+public class Book {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Long id;
+
+ @Column
+ private String name;
+
+ @Column
+ private String description;
+
+ @Nullable
+ private String body;
+
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getBody() {
+ return body;
+ }
+
+ public void setBody(String body) {
+ this.body = body;
+ }
+
+ public Book() {
+ }
+
+ public Book(Long id, String name, String description, String body) {
+ this.id = id;
+ this.name = name;
+ this.description = description;
+ this.body = body;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+} \ No newline at end of file
diff --git a/Year_3/TSDWL/SPRING/bank/bookstore/src/main/java/it/dmi/exam/bookstore/BookstoreApplication.java b/Year_3/TSDWL/SPRING/bank/bookstore/src/main/java/it/dmi/exam/bookstore/BookstoreApplication.java
new file mode 100644
index 0000000..2859579
--- /dev/null
+++ b/Year_3/TSDWL/SPRING/bank/bookstore/src/main/java/it/dmi/exam/bookstore/BookstoreApplication.java
@@ -0,0 +1,13 @@
+package it.dmi.exam.bookstore;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class BookstoreApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(BookstoreApplication.class, args);
+ }
+
+}