From be0b89e3ce73018e1fb437905e1cf26bf26a9927 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Mon, 24 Jan 2022 19:34:43 +0100 Subject: add example in spring --- .../src/main/java/it/dmi/exam/bookstore/Book.java | 69 ++++++++++++++++++++++ .../dmi/exam/bookstore/BookstoreApplication.java | 13 ++++ 2 files changed, 82 insertions(+) create mode 100644 Year_3/TSDWL/SPRING/bank/bookstore/src/main/java/it/dmi/exam/bookstore/Book.java create mode 100644 Year_3/TSDWL/SPRING/bank/bookstore/src/main/java/it/dmi/exam/bookstore/BookstoreApplication.java (limited to 'Year_3/TSDWL/SPRING/bank/bookstore/src/main/java') 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); + } + +} -- cgit v1.2.3-18-g5258