{"id":311621,"date":"2020-10-17T21:00:30","date_gmt":"2020-10-17T21:00:30","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=311621"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=311621","title":{"rendered":"\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Project Lombok"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/523876\/\">\n<p>\u0412 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043c\u043d\u043e\u0433\u0438\u0445 \u043b\u0435\u0442 \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438  \u043d\u0430 Java \u043c\u043d\u043e\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0442\u0430\u043a\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u0435\u0442\u043e\u0434\u044b getter, setter, equals, hashCode&nbsp; \u0438 \u0442.\u0434..&nbsp;\u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u044d\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0442\u043e\u0433\u043e \u0438 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p>\u0412 \u0442\u0430\u043a\u0438\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445 Project Lombok \u0441\u043f\u0430\u0441\u0430\u0435\u0442 \u043d\u0430\u0441.&nbsp;\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e,  \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Lombok \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0434\u0435\u043b\u044f\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b7e\/459\/359\/b7e4593595107711e95f9925f003dbc2.png\" alt=\"\u0424\u043e\u0442\u043e \u0424\u0430\u0447\u0438 \u041c\u0430\u0440\u0438\u043d\u0430 \u043d\u0430 Unsplash\" title=\"\u0424\u043e\u0442\u043e \u0424\u0430\u0447\u0438 \u041c\u0430\u0440\u0438\u043d\u0430 \u043d\u0430 Unsplash\" width=\"1033\" height=\"893\"><figcaption>\u0424\u043e\u0442\u043e \u0424\u0430\u0447\u0438 \u041c\u0430\u0440\u0438\u043d\u0430 \u043d\u0430 Unsplash<\/figcaption><\/figure>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432\u0430\u043c \u043e Project Lombok \u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Spring Boot.<\/p>\n<ul>\n<li>\n<p>\u0417\u0434\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u044b Spring Boot \u0438 Spring Data \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 REST API.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/maven.apache.org\/\" rel=\"noopener noreferrer nofollow\"><u>Maven<\/u><\/a>&nbsp;\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 (domain-driven), \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0439 \u043a\u043b\u0430\u0441\u0441\u044b \u043c\u043e\u0434\u0435\u043b\u0438, \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f, \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u043e \u044d\u0442\u043e\u0439&nbsp;<a href=\"https:\/\/github.com\/ragcrix\/LibraryInformationSystem\" rel=\"noopener noreferrer nofollow\"><strong><u>\u0441\u0441\u044b\u043b\u043a\u0435 \u043d\u0430 GitHub<\/u><\/strong><\/a><\/p>\n<h2>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Project Lombok?<\/h2>\n<p>\u042f \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u041b\u043e\u043c\u0431\u043e\u043a <a href=\"https:\/\/projectlombok.org\/\" rel=\"noopener noreferrer nofollow\"><u>\u043e\u0442\u0441\u044e\u0434\u0430<\/u><\/a>&nbsp;(\u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0430\u0439\u0442).&nbsp;\u042f \u043d\u0435 \u043c\u043e\u0433 \u0431\u044b \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u044d\u0442\u043e :).&nbsp;\u00abProject Lombok &#8212; \u044d\u0442\u043e java-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a \u0432\u0430\u0448\u0435\u043c\u0443 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0443 \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c \u0441\u0431\u043e\u0440\u043a\u0438, \u0434\u0435\u043b\u0430\u044f \u0432\u0430\u0448\u0443 java \u0431\u043e\u043b\u0435\u0435 \u043f\u0438\u043a\u0430\u043d\u0442\u043d\u043e\u0439\u00bb.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7b5\/49c\/bbe\/7b549cbbe379011165df0b948741faa9.png\" alt=\"\u0424\u043e\u0442\u043e \u041a\u0430\u043d\u0432\u0430\u0440\u0430 \u043d\u0430 Slideshare\" title=\"\u0424\u043e\u0442\u043e \u041a\u0430\u043d\u0432\u0430\u0440\u0430 \u043d\u0430 Slideshare\" width=\"605\" height=\"391\"><figcaption>\u0424\u043e\u0442\u043e \u041a\u0430\u043d\u0432\u0430\u0440\u0430 \u043d\u0430 Slideshare<\/figcaption><\/figure>\n<p>\u00ab\u041d\u0438\u043a\u043e\u0433\u0434\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043f\u0438\u0448\u0438\u0442\u0435 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434 getter \u0438\u043b\u0438 equals, \u0441 \u043e\u0434\u043d\u043e\u0439 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439 \u0432\u0430\u0448 \u043a\u043b\u0430\u0441\u0441 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0436\u0443\u0440\u043d\u0430\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435\u00bb.<\/p>\n<p>Project Lombok \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.&nbsp;\u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0432\u0441\u0435\u0433\u043e \u043f\u044f\u0442\u044c \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043e\u0442\u043d\u0438 \u0441\u0442\u0440\u043e\u043a.<\/p>\n<p>\u041a\u0430\u043a \u0432\u044b \u0432\u0438\u0434\u0438\u0442\u0435 \u043d\u0438\u0436\u0435, \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u0432\u043e\u0441\u044c\u043c\u0438\u0434\u0435\u0441\u044f\u0442\u0438 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430 \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439.<\/p>\n<p><strong>\u041a\u043b\u0430\u0441\u0441 Book, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Lombok<\/strong><\/p>\n<pre><code class=\"java\">package com.medium.libraryinfosystem.model.lombok;  import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor;  import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table;  \/**  * @author ragcrix  *\/  @Data @AllArgsConstructor @NoArgsConstructor @Entity @Table public class Book {     @Id     @GeneratedValue     private Long id;     private String writer;     private String name;     private String genre;     private String year; }<\/code><\/pre>\n<p>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e&nbsp;Lombok&nbsp;<em>JavaDoc<\/em>&nbsp;:<\/p>\n<ul>\n<li>\n<p><code>@Data<\/code>: \u00ab\u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u044b <strong>getter<\/strong> \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439, \u043c\u0435\u0442\u043e\u0434 <strong>toString<\/strong> \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 hashCode \u0438 equals, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 * \u0432\u0441\u0435 \u043d\u0435 <strong>transient<\/strong> \u043f\u043e\u043b\u044f.&nbsp;\u0422\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c  \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u0435\u0442\u043e\u0434\u044b <strong>setter <\/strong>\u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043d\u0435 <strong>final&nbsp;<\/strong>\u043f\u043e\u043b\u0435\u0439\u00bb.<\/p>\n<\/li>\n<li>\n<p><code>@AllArgsConstructor<\/code>&nbsp;: \u00ab\u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438\u00bb.<\/p>\n<\/li>\n<li>\n<p><code>@NoArgsConstructor<\/code>&nbsp;: \u00ab\u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0431\u0435\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432\u00bb.<\/p>\n<\/li>\n<li>\n<p><code>@Slf4j<\/code>&nbsp;: \u00ab\u0417\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043b\u043e\u043c\u0431\u043e\u043a \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0435 logger.\u00bb<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0438\u0436\u0435 \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u043c\u043e\u0434\u0435\u043b\u0438 <strong>Book<\/strong>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Lombok.<\/p>\n<p><strong>\u041a\u043b\u0430\u0441\u0441 Book, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430<\/strong><\/p>\n<pre><code class=\"java\">package com.medium.libraryinfosystem.model.classic;  import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; import java.util.Objects;  \/**  * @author ragcrix  *\/ @Entity @Table public class Book {     @Id     @GeneratedValue     private Long id;     private String writer;     private String name;     private String genre;     private String year;      public Book() {     }      public Book(Long id, String writer,                 String name, String genre, String year) {         this.id = id;         this.writer = writer;         this.name = name;         this.genre = genre;         this.year = year;     }      public Long getId() {         return id;     }      public void setId(Long id) {         this.id = id;     }      public String getWriter() {         return writer;     }      public void setWriter(String writer) {         this.writer = writer;     }      public String getName() {         return name;     }      public void setName(String name) {         this.name = name;     }      public String getGenre() {         return genre;     }      public void setGenre(String genre) {         this.genre = genre;     }      public String getYear() {         return year;     }      public void setYear(String year) {         this.year = year;     }      @Override     public boolean equals(Object o) {         if (this == o) return true;         if (o == null || getClass() != o.getClass()) return false;         Book book = (Book) o;         return Objects.equals(id, book.id) &amp;&amp;                 Objects.equals(writer, book.writer) &amp;&amp;                 Objects.equals(name, book.name) &amp;&amp;                 Objects.equals(genre, book.genre) &amp;&amp;                 Objects.equals(year, book.year);     }      @Override     public int hashCode() {         return Objects.hash(id, writer, name, genre, year);     }      @Override     public String toString() {         return \"Book{\" +                 \"id=\" + id +                 \", writer='\" + writer + '\\'' +                 \", name='\" + name + '\\'' +                 \", genre='\" + genre + '\\'' +                 \", year='\" + year + '\\'' +                 '}';     } }<\/code><\/pre>\n<p>Project Lombok \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0436\u0443\u0440\u043d\u0430\u043b\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.&nbsp;\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c&nbsp;<code>@Slf4j<\/code>\u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0436\u0443\u0440\u043d\u0430\u043b\u0430.<\/p>\n<p><strong>\u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f @ Slf4j \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0436\u0443\u0440\u043d\u0430\u043b\u0430<\/strong><\/p>\n<pre><code class=\"java\">package com.medium.libraryinfosystem.service.impl;  import com.medium.libraryinfosystem.model.lombok.Book; import com.medium.libraryinfosystem.repository.BookRepository; import com.medium.libraryinfosystem.service.BookService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service;  import java.util.List;  \/**  * @author ragcrix  *\/ @Slf4j @Service public class BookServiceImpl implements BookService {     @Autowired     private BookRepository bookRepository;      @Override     public Book findByName(String name) {         log.info(\"inside findByName()\");         return bookRepository.findByName(name);     }      @Override     public List&lt;Book&gt; findAll() {         log.info(\"inside findAll()\");         return bookRepository.findAll();     }      @Override     public Book save(Book book) {         log.info(\"inside save()\");         return bookRepository.save(book);     }      @Override     public void delete(Book book) {         log.info(\"inside delete()\");         bookRepository.delete(book);     }   }<\/code><\/pre>\n<h2>\u041a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c Lombok<\/h2>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043b\u0435\u0433\u043a\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c Lombok \u0432 \u043d\u0430\u0448\u0443 IDE (IntelliJ, Eclipse \u0438 \u0442.\u0434.).<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432\u0430\u043c \u043e\u0431 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 Lombok \u0434\u043b\u044f IntelliJ Idea.&nbsp;\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0439\u0442\u0438&nbsp;<a href=\"https:\/\/projectlombok.org\/\" rel=\"noopener noreferrer nofollow\"><u>\u0441\u044e\u0434\u0430<\/u><\/a><u>,<\/u>&nbsp;\u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438.<\/p>\n<ol>\n<li>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u0431\u0440\u0430\u0442\u044c Lombok \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Spring Boot, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435.<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f5b\/f63\/bcb\/f5bf63bcb3edad5676cc1a1123bbd47b.png\" alt=\"\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430\" title=\"\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430\" width=\"1257\" height=\"716\"><figcaption>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/figcaption><\/figure>\n<p>2. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043f\u043b\u0430\u0433\u0438\u043d Lombok \u0432 \u0441\u0432\u043e\u044e IDE \u0440\u0430\u043d\u044c\u0448\u0435, IntelliJ \u0437\u0430\u0434\u0430\u0441\u0442 \u0432\u0430\u043c \u0432\u043e\u043f\u0440\u043e\u0441.&nbsp;\u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d Lombok \u0438 \u043d\u0430\u0436\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 \u041e\u041a, \u0447\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d \u0432 \u0432\u0430\u0448\u0443 \u0441\u0440\u0435\u0434\u0443 IDE.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ffe\/fdc\/c49\/ffefdcc494ae999f6b69f43d7a983f41.png\" alt=\"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Lombok \" title=\"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Lombok \" width=\"1271\" height=\"698\"><figcaption>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Lombok <\/figcaption><\/figure>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e Lombok \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0432 \u0432\u0430\u0448\u0435\u0439 \u0441\u0440\u0435\u0434\u0435 IDE, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435.&nbsp;\u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Lombok \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430, \u043c\u044b \u0433\u043e\u0442\u043e\u0432\u044b \u043a \u0440\u0430\u0431\u043e\u0442\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ee8\/2be\/f95\/ee82bef95eae4b1576efa9c7cc94ba5b.png\" alt=\"\u041f\u043b\u0430\u0433\u0438\u043d Lombok \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\" title=\"\u041f\u043b\u0430\u0433\u0438\u043d Lombok \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\" width=\"1257\" height=\"912\"><figcaption>\u041f\u043b\u0430\u0433\u0438\u043d Lombok \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d<\/figcaption><\/figure>\n<h2>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/h2>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435&nbsp;\u0434\u043b\u044f \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f REST API&nbsp;\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f&nbsp;<a href=\"https:\/\/www.jetbrains.com\/idea\/\" rel=\"noopener noreferrer nofollow\"><u>IntelliJ IDEA<\/u><\/a>&nbsp;,&nbsp;<a href=\"http:\/\/maven.apache.org\/\" rel=\"noopener noreferrer nofollow\"><u>Maven<\/u><\/a> \u0438&nbsp;<a href=\"https:\/\/www.getpostman.com\/apps\" rel=\"noopener noreferrer nofollow\"><u>Postman<\/u><\/a>&nbsp;.&nbsp;\u042f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0432&nbsp;<a href=\"https:\/\/www.microsoft.com\/en-us\/windows\/\" rel=\"noopener noreferrer nofollow\"><u>Windows 10<\/u><\/a>&nbsp;\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PowerShell.<\/p>\n<p>\u0412\u0441\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0430 Java, \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Spring 5.2 \u0438 Spring Boot 2.2.2, \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 H2 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u044f \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044e, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b JDK 13.0, IntelliJ,&nbsp;Maven \u0438 Postman.<\/p>\n<p>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u043d\u0438\u0433\u0430\u0445 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043a\u043d\u0438\u0433\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u043a\u043d\u0438\u0433\u0438 \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/76d\/279\/cf5\/76d279cf5abf9e65eee91ec2a36b54cf.png\" alt=\"\u0424\u043e\u0442\u043e \u0418\u0432\u043e \u0420\u0430\u0438\u043d\u044c\u0438 \u043d\u0430 Unsplash\" title=\"\u0424\u043e\u0442\u043e \u0418\u0432\u043e \u0420\u0430\u0438\u043d\u044c\u0438 \u043d\u0430 Unsplash\" width=\"1276\" height=\"868\"><figcaption>\u0424\u043e\u0442\u043e \u0418\u0432\u043e \u0420\u0430\u0438\u043d\u044c\u0438 \u043d\u0430 Unsplash<\/figcaption><\/figure>\n<p>\u041c\u043e\u044f \u0446\u0435\u043b\u044c \u0437\u0434\u0435\u0441\u044c &#8212; \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Lombok \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0442\u0430\u0441\u043e\u0432\u043a\u0438 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438.<\/p>\n<ul>\n<li>\n<p>\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f POST \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043d\u0438\u0433 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0430\u0431\u043b\u0438\u0446\u0430&nbsp;<strong>book<\/strong>&nbsp;\u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 H2 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043d\u0438\u0433\u0438, \u0430\u0432\u0442\u043e\u0440\u0435, \u0436\u0430\u043d\u0440\u0435 \u0438 \u0433\u043e\u0434\u0443.<\/p>\n<\/li>\n<li>\n<p>\u0412\u0441\u0435, \u0447\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0443\u0436\u0431\u043e\u0439, \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a JSON.<\/p>\n<\/li>\n<\/ul>\n<h3>\u041c\u043e\u0434\u0435\u043b\u044c Book&nbsp;<\/h3>\n<p>\u042d\u0442\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0438\u043c\u0435\u0435\u0442 5 \u043f\u043e\u043b\u0435\u0439: id, name, writer, genre \u0438 year.<\/p>\n<pre><code class=\"java\">package com.medium.libraryinfosystem.model.lombok;  import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor;  import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table;  \/**  * @author ragcrix  *\/  @Data @AllArgsConstructor @NoArgsConstructor @Entity @Table public class Book {     @Id     @GeneratedValue     private Long id;     private String writer;     private String name;     private String genre;     private String year; }<\/code><\/pre>\n<p>\u0412\u0441\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 Lombok \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u044b \u0432\u044b\u0448\u0435.<\/p>\n<h3>\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 Book&nbsp;<\/h3>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043b\u0435\u0433\u043a\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044e\u0449\u0438\u0439&nbsp;<em>CrudRepository,<\/em>&nbsp;\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Spring Data Project.&nbsp;\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 :).<\/p>\n<pre><code class=\"java\">package com.medium.libraryinfosystem.repository;  import com.medium.libraryinfosystem.model.lombok.Book; import org.springframework.data.repository.CrudRepository;  import java.util.List;  \/**  * @author ragcrix  *\/ public interface BookRepository extends CrudRepository&lt;Book, Long&gt; {     Book findByName(String name);      List&lt;Book&gt; findAll();      Book save(Book book);      void delete(Book book); }<\/code><\/pre>\n<p>\u0412 BookRepository \u0435\u0441\u0442\u044c \u0447\u0435\u0442\u044b\u0440\u0435 \u043c\u0435\u0442\u043e\u0434\u0430.&nbsp;\u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u0435&nbsp;\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438&nbsp;<strong>CRUD<\/strong>&nbsp;(\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435, \u0447\u0442\u0435\u043d\u0438\u0435, \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435, \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435)&nbsp;.<\/p>\n<h3>\u0421\u0435\u0440\u0432\u0438\u0441 Book&nbsp;<\/h3>\n<p>\u0421\u0435\u0440\u0432\u0438\u0441 Book&nbsp;\u0438\u043c\u0435\u0435\u0442 \u0447\u0435\u0442\u044b\u0440\u0435 \u043c\u0435\u0442\u043e\u0434\u0430.&nbsp;\u041f\u0440\u043e\u0441\u0442\u043e \u044d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u044b\u0434\u0430\u044e\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043d\u0438\u0433 \u043f\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u043c, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442 \u0438\u043b\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043a\u043d\u0438\u0433\u0435 \u0438 \u0443\u0434\u0430\u043b\u044f\u044e\u0442 \u043a\u043d\u0438\u0433\u0443.<\/p>\n<pre><code class=\"java\">package com.medium.libraryinfosystem.service;  import com.medium.libraryinfosystem.model.lombok.Book;  import java.util.List;  \/**  * @author ragcrix  *\/ public interface BookService {     Book findByName(String name);      List&lt;Book&gt; findAll();      Book save(Book book);      void delete(Book book); }<\/code><\/pre>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u044d\u0442\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043d\u0438\u0436\u0435.<\/p>\n<pre><code class=\"java\">package com.medium.libraryinfosystem.service.impl;  import com.medium.libraryinfosystem.model.lombok.Book; import com.medium.libraryinfosystem.repository.BookRepository; import com.medium.libraryinfosystem.service.BookService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service;  import java.util.List;  \/**  * @author ragcrix  *\/ @Service public class BookServiceImpl implements BookService {     @Autowired     private BookRepository bookRepository;      @Override     public Book findByName(String name) {         return bookRepository.findByName(name);     }      @Override     public List&lt;Book&gt; findAll() {         return bookRepository.findAll();     }      @Override     public Book save(Book book) {         return bookRepository.save(book);     }      @Override     public void delete(Book book) {         bookRepository.delete(book);     } }<\/code><\/pre>\n<h3>Book \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440<\/h3>\n<p><em>BookController.java<\/em>&nbsp;&#8212; \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441 REST \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u0435\u0435\u0442 \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430&nbsp;\u0441 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439 <code>@GetMapping<\/code><em>,<\/em>&nbsp;\u043e\u0434\u0438\u043d \u0441 &nbsp;<code>@PostMapping<\/code>\u0438 \u043e\u0434\u0438\u043d \u0441&nbsp;<code>@DeleteMapping<\/code>.<em>&nbsp;<\/em><\/p>\n<pre><code class=\"java\">package com.medium.libraryinfosystem.controller;  import com.medium.libraryinfosystem.dto.BookDTO; import com.medium.libraryinfosystem.model.lombok.Book; import com.medium.libraryinfosystem.service.BookService; import com.medium.libraryinfosystem.util.ObjectMapperUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*;  import java.util.List;  \/**  * @ragcrix  *\/ @RestController @RequestMapping(\"\/books\") public class BookController {      @Autowired     private BookService bookService;      @GetMapping(value = \"\/\")     public List&lt;BookDTO&gt; getAllBooks() {         return ObjectMapperUtils.mapAll(bookService.findAll(), BookDTO.class);     }       @GetMapping(value = \"\/byName\/{bookName}\")     public BookDTO getBookByName(@PathVariable(\"bookName\") String bookName) {         return ObjectMapperUtils.map(bookService.findByName(bookName), BookDTO.class);     }      @PostMapping(value = \"\/save\")     public ResponseEntity&lt;?&gt; saveOrUpdateBook(@RequestBody BookDTO bookDTO) {         bookService.save(ObjectMapperUtils.map(bookDTO, Book.class));         return new ResponseEntity(\"Book added successfully\", HttpStatus.OK);     }      @DeleteMapping(value = \"\/delete\/{bookName}\")     public ResponseEntity&lt;?&gt; deleteBookByName(@PathVariable String bookName) {         bookService.delete(bookService.findByName(bookName));         return new ResponseEntity(\"Book deleted successfully\", HttpStatus.OK);     }   }<\/code><\/pre>\n<h3>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 H2, \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432&nbsp;\u0444\u0430\u0439\u043b\u0435&nbsp;<em>\u00abapplication.properties\u00bb,<\/em>&nbsp;\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u0432  \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438 <strong><em>resources<\/em><\/strong>.&nbsp;\u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.<\/p>\n<pre><code class=\"xml\"># Server server.port=9090  # Enabling H2 Console spring.h2.console.enabled=true  # Datasource spring.datasource.url=jdbc:h2:mem:testdb spring.datasource.driverClassName=org.h2.Driver spring.datasource.username=sa spring.datasource.password=  # JPA spring.jpa.show-sql=true spring.jpa.generate-ddl=true spring.jpa.database-platform=org.hibernate.dialect.H2Dialect<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 H2 \u043f\u043e \u044d\u0442\u043e\u0439&nbsp;<a href=\"http:\/\/localhost:9090\/h2-console\" rel=\"noopener noreferrer nofollow\"><strong><u>\u0441\u0441\u044b\u043b\u043a\u0435<\/u><\/strong><\/a>&nbsp;.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dcf\/916\/9af\/dcf9169af00f107a7e96a18b27286e01.png\" width=\"830\" height=\"746\"><figcaption><\/figcaption><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d5d\/444\/705\/d5d444705151de69fd624b77e89e7a89.png\" width=\"1418\" height=\"881\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435. \u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442, \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0441\u043a\u0440\u0438\u043f\u0442 \u0432 \u0444\u0430\u0439\u043b\u0435 data.sql, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <strong><em>resources<\/em><\/strong>.&nbsp;\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Spring Data.&nbsp;<\/p>\n<pre><code class=\"sql\">insert into book values(1, 'SCI-FI', 'Frankenstein', 'Mary Shelley', '1818');  insert into book values(2, 'Fantastic', 'Harry Potter', 'J. K. Rowling', '1997');<\/code><\/pre>\n<h3>\u0417\u0430\u043f\u0443\u0441\u043a \u0441\u043b\u0443\u0436\u0431\u044b \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Postman<\/h3>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043b\u0435\u0433\u043a\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043b\u0443\u0436\u0431\u044b REST.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043d\u0438\u0433\u0443 \u0432 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c&nbsp;<em>\u0444\u0430\u0439\u043b <\/em><strong><em>data.json<\/em><\/strong>&nbsp;\u0432 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c23\/b06\/f18\/c23b06f1842da6e0440354f86b127e41.png\" alt=\"\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 IntelliJ\" title=\"\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 IntelliJ\" width=\"1277\" height=\"587\"><figcaption>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 IntelliJ<\/figcaption><\/figure>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0443\u0436\u0431\u0443 REST.&nbsp;\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 <strong>Postman<\/strong>, \u0432\u0432\u0435\u0434\u0438\u0442\u0435 URL-\u0430\u0434\u0440\u0435\u0441 \u0438 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435&nbsp;\u043c\u0435\u0442\u043e\u0434&nbsp;<strong>GET,<\/strong>&nbsp;\u043a\u0430\u043a&nbsp;<strong>\u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e<\/strong>&nbsp;\u043d\u0438\u0436\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/def\/b4e\/4fa\/defb4e4fabc8c19a07832e93badfab6a.png\" alt=\"\u0421\u043f\u0438\u0441\u043e\u043a \u043a\u043d\u0438\u0433\" title=\"\u0421\u043f\u0438\u0441\u043e\u043a \u043a\u043d\u0438\u0433\" width=\"1652\" height=\"922\"><figcaption>\u0421\u043f\u0438\u0441\u043e\u043a \u043a\u043d\u0438\u0433<\/figcaption><\/figure>\n<p>\u0421\u043d\u043e\u0432\u0430 \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u0441\u044b\u043b\u043a\u0443 \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043d\u0438\u0433\u0438 \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/086\/685\/4e2\/0866854e289b7e60f8b72c8b9cad4910.png\" alt=\"\u0424\u0440\u0430\u043d\u043a\u0435\u043d\u0448\u0442\u0435\u0439\u043d\" title=\"\u0424\u0440\u0430\u043d\u043a\u0435\u043d\u0448\u0442\u0435\u0439\u043d\" width=\"1660\" height=\"915\"><figcaption>\u0424\u0440\u0430\u043d\u043a\u0435\u043d\u0448\u0442\u0435\u0439\u043d<\/figcaption><\/figure>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043d\u0438\u0433\u0443 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e&nbsp;\u043c\u0435\u0442\u043e\u0434\u0430&nbsp;<strong>POST<\/strong>&nbsp;\u0432 Postman.&nbsp;\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u0432\u0435\u0441\u0442\u0438&nbsp;\u043f\u0430\u0440\u0443 \u043a\u043b\u044e\u0447-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430&nbsp;<strong><em>Content-Type:application\/json<\/em><\/strong>&nbsp;.&nbsp;\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435 body \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u0432\u0435\u0441\u0442\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u043d\u0438\u0433\u0435, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f40\/628\/a19\/f40628a196be561d400a7439c8b66c54.png\" alt=\"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043d\u0438\u0433\u0438\" title=\"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043d\u0438\u0433\u0438\" width=\"1657\" height=\"912\"><figcaption>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043d\u0438\u0433\u0438<\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043a\u043d\u0438\u0433\u0443, \u0432\u0430\u043c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u0442\u044c&nbsp;\u043c\u0435\u0442\u043e\u0434&nbsp;<strong>DELETE<\/strong>&nbsp;\u0432 <strong>Postman<\/strong> \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043d\u0438\u0433\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c, \u0432 \u043a\u043e\u043d\u0435\u0446 \u0441\u0441\u044b\u043b\u043a\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c24\/e15\/a5d\/c24e15a5d2d04bf97c0ab87705fb83dc.png\" alt=\"\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043a\u043d\u0438\u0433\u0438\" title=\"\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043a\u043d\u0438\u0433\u0438\" width=\"1656\" height=\"905\"><figcaption>\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043a\u043d\u0438\u0433\u0438<\/figcaption><\/figure>\n<h2>\u0420\u0435\u0441\u0443\u0440\u0441\u044b<\/h2>\n<ul>\n<li>\n<p><a href=\"https:\/\/projectlombok.org\/\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/projectlombok.org\/<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/spring.io\/\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/spring.io\/<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/www.h2database.com\/html\/main.html\" rel=\"noopener noreferrer nofollow\"><u>https:\/\/www.h2database.com\/html\/main.html<\/u><\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435. \u0412<\/strong>&nbsp;\u044d\u0442\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 Spring Data, H2 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 REST API.&nbsp;\u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0434\u043b\u044f \u043f\u043e\u043b\u0435\u0439 \u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0435!&nbsp;\u0412\u0430\u0448\u0438 \u043c\u044b\u0441\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u0446\u0435\u043d\u043d\u044b \u0434\u043b\u044f \u043c\u0435\u043d\u044f.&nbsp;\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u0435\u0441\u044c.&nbsp;<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/523876\/\"> https:\/\/habr.com\/ru\/post\/523876\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/523876\/\">\n<p>\u0412 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043c\u043d\u043e\u0433\u0438\u0445 \u043b\u0435\u0442 \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438  \u043d\u0430 Java \u043c\u043d\u043e\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0442\u0430\u043a\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u0435\u0442\u043e\u0434\u044b getter, setter, equals, hashCode&nbsp; \u0438 \u0442.\u0434..&nbsp;\u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u044d\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0442\u043e\u0433\u043e \u0438 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p>\u0412 \u0442\u0430\u043a\u0438\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445 Project Lombok \u0441\u043f\u0430\u0441\u0430\u0435\u0442 \u043d\u0430\u0441.&nbsp;\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e,  \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Lombok \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0434\u0435\u043b\u044f\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0435.<\/p>\n<figure class=\"full-width\"><figcaption>\u0424\u043e\u0442\u043e \u0424\u0430\u0447\u0438 \u041c\u0430\u0440\u0438\u043d\u0430 \u043d\u0430 Unsplash<\/figcaption><\/figure>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432\u0430\u043c \u043e Project Lombok \u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Spring Boot.<\/p>\n<ul>\n<li>\n<p>\u0417\u0434\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u044b Spring Boot \u0438 Spring Data \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 REST API.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/maven.apache.org\/\" rel=\"noopener noreferrer nofollow\"><u>Maven<\/u><\/a>&nbsp;\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 (domain-driven), \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0439 \u043a\u043b\u0430\u0441\u0441\u044b \u043c\u043e\u0434\u0435\u043b\u0438, \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f, \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043f\u043e \u044d\u0442\u043e\u0439&nbsp;<a href=\"https:\/\/github.com\/ragcrix\/LibraryInformationSystem\" rel=\"noopener noreferrer nofollow\"><strong><u>\u0441\u0441\u044b\u043b\u043a\u0435 \u043d\u0430 GitHub<\/u><\/strong><\/a><\/p>\n<h2>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Project Lombok?<\/h2>\n<p>\u042f \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u041b\u043e\u043c\u0431\u043e\u043a <a href=\"https:\/\/projectlombok.org\/\" rel=\"noopener noreferrer nofollow\"><u>\u043e\u0442\u0441\u044e\u0434\u0430<\/u><\/a>&nbsp;(\u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0430\u0439\u0442).&nbsp;\u042f \u043d\u0435 \u043c\u043e\u0433 \u0431\u044b \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u044d\u0442\u043e :).&nbsp;\u00abProject Lombok &#8212; \u044d\u0442\u043e java-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a \u0432\u0430\u0448\u0435\u043c\u0443 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0443 \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c \u0441\u0431\u043e\u0440\u043a\u0438, \u0434\u0435\u043b\u0430\u044f \u0432\u0430\u0448\u0443 java \u0431\u043e\u043b\u0435\u0435 \u043f\u0438\u043a\u0430\u043d\u0442\u043d\u043e\u0439\u00bb.<\/p>\n<figure class=\"full-width\"><figcaption>\u0424\u043e\u0442\u043e \u041a\u0430\u043d\u0432\u0430\u0440\u0430 \u043d\u0430 Slideshare<\/figcaption><\/figure>\n<p>\u00ab\u041d\u0438\u043a\u043e\u0433\u0434\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043f\u0438\u0448\u0438\u0442\u0435 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434 getter \u0438\u043b\u0438 equals, \u0441 \u043e\u0434\u043d\u043e\u0439 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439 \u0432\u0430\u0448 \u043a\u043b\u0430\u0441\u0441 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0436\u0443\u0440\u043d\u0430\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435\u00bb.<\/p>\n<p>Project Lombok \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.&nbsp;\u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0432\u0441\u0435\u0433\u043e \u043f\u044f\u0442\u044c \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043e\u0442\u043d\u0438 \u0441\u0442\u0440\u043e\u043a.<\/p>\n<p>\u041a\u0430\u043a \u0432\u044b \u0432\u0438\u0434\u0438\u0442\u0435 \u043d\u0438\u0436\u0435, \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u0432\u043e\u0441\u044c\u043c\u0438\u0434\u0435\u0441\u044f\u0442\u0438 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430 \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439.<\/p>\n<p><strong>\u041a\u043b\u0430\u0441\u0441 Book, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Lombok<\/strong><\/p>\n<pre><code class=\"java\">package com.medium.libraryinfosystem.model.lombok;  import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor;  import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table;  \/**  * @author ragcrix  *\/  @Data @AllArgsConstructor @NoArgsConstructor @Entity @Table public class Book {     @Id     @GeneratedValue     private Long id;     private String writer;     private String name;     private String genre;     private String year; }<\/code><\/pre>\n<p>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e&nbsp;Lombok&nbsp;<em>JavaDoc<\/em>&nbsp;:<\/p>\n<ul>\n<li>\n<p><code>@Data<\/code>: \u00ab\u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u044b <strong>getter<\/strong> \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439, \u043c\u0435\u0442\u043e\u0434 <strong>toString<\/strong> \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 hashCode \u0438 equals, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442 * \u0432\u0441\u0435 \u043d\u0435 <strong>transient<\/strong> \u043f\u043e\u043b\u044f.&nbsp;\u0422\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c  \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043c\u0435\u0442\u043e\u0434\u044b <strong>setter <\/strong>\u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043d\u0435 <strong>final&nbsp;<\/strong>\u043f\u043e\u043b\u0435\u0439\u00bb.<\/p>\n<\/li>\n<li>\n<p><code>@AllArgsConstructor<\/code>&nbsp;: \u00ab\u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438\u00bb.<\/p>\n<\/li>\n<li>\n<p><code>@NoArgsConstructor<\/code>&nbsp;: \u00ab\u0421\u043e\u0437\u0434\u0430\u0435\u0442 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0431\u0435\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432\u00bb.<\/p>\n<\/li>\n<li>\n<p><code>@Slf4j<\/code>&nbsp;: \u00ab\u0417\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043b\u043e\u043c\u0431\u043e\u043a \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0435 logger.\u00bb<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0438\u0436\u0435 \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u043c\u043e\u0434\u0435\u043b\u0438 <strong>Book<\/strong>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Lombok.<\/p>\n<p><strong>\u041a\u043b\u0430\u0441\u0441 Book, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430<\/strong><\/p>\n<pre><code class=\"java\">package com.medium.libraryinfosystem.model.classic;  import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; import java.util.Objects;  \/**  * @author ragcrix  *\/ @Entity @Table public class Book {     @Id     @GeneratedValue     private Long id;     private String writer;     private String name;     private String genre;     private String year;      public Book() {     }      public Book(Long id, String writer,                 String name, String genre, String year) {         this.id = id;         this.writer = writer;         this.name = name;         this.genre = genre;         this.year = year;     }      public Long getId() {         return id;     }      public void setId(Long id) {         this.id = id;     }      public String getWriter() {         return writer;     }      public void setWriter(String writer) {         this.writer = writer;     }      public String getName() {         return name;     }      public void setName(String name) {         this.name = name;     }      public String getGenre() {         return genre;     }      public void setGenre(String genre) {         this.genre = genre;     }      public String getYear() {         return year;     }      public void setYear(String year) {         this.year = year;     }      @Override     public boolean equals(Object o) {         if (this == o) return true;         if (o == null || getClass() != o.getClass()) return false;         Book book = (Book) o;         return Objects.equals(id, book.id) &amp;&amp;                 Objects.equals(writer, book.writer) &amp;&amp;                 Objects.equals(name, book.name) &amp;&amp;                 Objects.equals(genre, book.genre) &amp;&amp;                 Objects.equals(year, book.year);     }      @Override     public int hashCode() {         return Objects.hash(id, writer, name, genre, year);     }      @Override     public String toString() {         return \"Book{\" +                 \"id=\" + id +                 \", writer='\" + writer + '\\'' +                 \", name='\" + name + '\\'' +                 \", genre='\" + genre + '\\'' +                 \", year='\" + year + '\\'' +                 '}';     } }<\/code><\/pre>\n<p>Project Lombok \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0436\u0443\u0440\u043d\u0430\u043b\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.&nbsp;\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c&nbsp;<code>@Slf4j<\/code>\u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0436\u0443\u0440\u043d\u0430\u043b\u0430.<\/p>\n<p><strong>\u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f @ Slf4j \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0436\u0443\u0440\u043d\u0430\u043b\u0430<\/strong><\/p>\n<pre><code class=\"java\">package com.medium.libraryinfosystem.service.impl;  import com.medium.libraryinfosystem.model.lombok.Book; import com.medium.libraryinfosystem.repository.BookRepository; import com.medium.libraryinfosystem.service.BookService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service;  import java.util.List;  \/**  * @author ragcrix  *\/ @Slf4j @Service public class BookServiceImpl implements BookService {     @Autowired     private BookRepository bookRepository;      @Override     public Book findByName(String name) {         log.info(\"inside findByName()\");         return bookRepository.findByName(name);     }      @Override     public List&lt;Book&gt; findAll() {         log.info(\"inside findAll()\");         return bookRepository.findAll();     }      @Override     public Book save(Book book) {         log.info(\"inside save()\");         return bookRepository.save(book);     }      @Override     public void delete(Book book) {         log.info(\"inside delete()\");         bookRepository.delete(book);     }   }<\/code><\/pre>\n<h2>\u041a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c Lombok<\/h2>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043b\u0435\u0433\u043a\u043e \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c Lombok \u0432 \u043d\u0430\u0448\u0443 IDE (IntelliJ, Eclipse \u0438 \u0442.\u0434.).<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432\u0430\u043c \u043e\u0431 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 Lombok \u0434\u043b\u044f IntelliJ Idea.&nbsp;\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0439\u0442\u0438&nbsp;<a href=\"https:\/\/projectlombok.org\/\" rel=\"noopener noreferrer nofollow\"><u>\u0441\u044e\u0434\u0430<\/u><\/a><u>,<\/u>&nbsp;\u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438.<\/p>\n<ol>\n<li>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u0431\u0440\u0430\u0442\u044c Lombok \u043f\u0440\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Spring Boot, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435.<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><figcaption>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/figcaption><\/figure>\n<p>2. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043f\u043b\u0430\u0433\u0438\u043d Lombok \u0432 \u0441\u0432\u043e\u044e IDE \u0440\u0430\u043d\u044c\u0448\u0435, IntelliJ \u0437\u0430\u0434\u0430\u0441\u0442 \u0432\u0430\u043c \u0432\u043e\u043f\u0440\u043e\u0441.&nbsp;\u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d Lombok \u0438 \u043d\u0430\u0436\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 \u041e\u041a, \u0447\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d \u0432 \u0432\u0430\u0448\u0443 \u0441\u0440\u0435\u0434\u0443 IDE.<\/p>\n<figure class=\"full-width\"><figcaption>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Lombok <\/figcaption><\/figure>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e Lombok \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0432 \u0432\u0430\u0448\u0435\u0439 \u0441\u0440\u0435\u0434\u0435 IDE, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435.&nbsp;\u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Lombok \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430, \u043c\u044b \u0433\u043e\u0442\u043e\u0432\u044b \u043a \u0440\u0430\u0431\u043e\u0442\u0435.<\/p>\n<figure class=\"full-width\"><figcaption>\u041f\u043b\u0430\u0433\u0438\u043d Lombok \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d<\/figcaption><\/figure>\n<h2>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/h2>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435&nbsp;\u0434\u043b\u044f \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f REST API&nbsp;\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f&nbsp;<a href=\"https:\/\/www.jetbrains.com\/idea\/\" rel=\"noopener noreferrer nofollow\"><u>IntelliJ IDEA<\/u><\/a>&nbsp;,&nbsp;<a href=\"http:\/\/maven.apache.org\/\" rel=\"noopener noreferrer nofollow\"><u>Maven<\/u><\/a> \u0438&nbsp;<a href=\"https:\/\/www.getpostman.com\/apps\" rel=\"noopener noreferrer nofollow\"><u>Postman<\/u><\/a>&nbsp;.&nbsp;\u042f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0432&nbsp;<a href=\"https:\/\/www.microsoft.com\/en-us\/windows\/\" rel=\"noopener noreferrer nofollow\"><u>Windows 10<\/u><\/a>&nbsp;\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PowerShell.<\/p>\n<p>\u0412\u0441\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0430 Java, \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Spring 5.2 \u0438 Spring Boot 2.2.2, \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 H2 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u044f \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044e, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b JDK 13.0, IntelliJ,&nbsp;Maven \u0438 Postman.<\/p>\n<p>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043a\u043d\u0438\u0433\u0430\u0445 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043a\u043d\u0438\u0433\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u043a\u043d\u0438\u0433\u0438 \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/p>\n<figure class=\"full-width\"><figcaption>\u0424\u043e\u0442\u043e \u0418\u0432\u043e \u0420\u0430\u0438\u043d\u044c\u0438 \u043d\u0430 Unsplash<\/figcaption><\/figure>\n<p>\u041c\u043e\u044f \u0446\u0435\u043b\u044c \u0437\u0434\u0435\u0441\u044c &#8212; \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Lombok \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0442\u0430\u0441\u043e\u0432\u043a\u0438 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438.<\/p>\n<ul>\n<li>\n<p>\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f POST \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043d\u0438\u0433 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0430\u0431\u043b\u0438\u0446\u0430&nbsp;<strong>book<\/strong>&nbsp;\u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 H2 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043d\u0438\u0433\u0438, \u0430\u0432\u0442\u043e\u0440\u0435, \u0436\u0430\u043d\u0440\u0435 \u0438 \u0433\u043e\u0434\u0443.<\/p>\n<\/li>\n<li>\n<p>\u0412\u0441\u0435, \u0447\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0443\u0436\u0431\u043e\u0439, \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a JSON.<\/p>\n<\/li>\n<\/ul>\n<h3>\u041c\u043e\u0434\u0435\u043b\u044c Book&nbsp;<\/h3>\n<p>\u042d\u0442\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u0438\u043c\u0435\u0435\u0442 5 \u043f\u043e\u043b\u0435\u0439: id, name, writer, genre \u0438 year.<\/p>\n<pre><code class=\"java\">package com.medium.libraryinfosystem.model.lombok;  import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor;  import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table;  \/**  * @author ragcrix  *\/  @Data @AllArgsConstructor @NoArgsConstructor @Entity @Table public class Book {     @Id     @GeneratedValue     private Long id;     private String writer;     private String name;     private String genre;     private String year; }<\/code><\/pre>\n<p>\u0412\u0441\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 Lombok \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u044b \u0432\u044b\u0448\u0435.<\/p>\n<h3>\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 Book&nbsp;<\/h3>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043b\u0435\u0433\u043a\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044e\u0449\u0438\u0439&nbsp;<em>CrudRepository,<\/em>&nbsp;\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Spring Data Project.&nbsp;\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 :).<\/p>\n<pre><code class=\"java\">package com.medium.libraryinfosystem.repository;  import com.medium.libraryinfosystem.model.lombok.Book; import org.springframework.data.repository.CrudRepository;  import java.util.List;  \/**  * @author ragcrix  *\/ public interface BookRepository extends CrudRepository&lt;Book, Long&gt; {     Book findByName(String name);      List&lt;Book&gt; findAll();      Book save(Book book);      void delete(Book book); }<\/code><\/pre>\n<p>\u0412 BookRepository \u0435\u0441\u0442\u044c \u0447\u0435\u0442\u044b\u0440\u0435 \u043c\u0435\u0442\u043e\u0434\u0430.&nbsp;\u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u0435&nbsp;\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438&nbsp;<strong>CRUD<\/strong>&nbsp;(\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435, \u0447\u0442\u0435\u043d\u0438\u0435, \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435, \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435)&nbsp;.<\/p>\n<h3>\u0421\u0435\u0440\u0432\u0438\u0441 Book&nbsp;<\/h3>\n<p>\u0421\u0435\u0440\u0432\u0438\u0441 Book&nbsp;\u0438\u043c\u0435\u0435\u0442 \u0447\u0435\u0442\u044b\u0440\u0435 \u043c\u0435\u0442\u043e\u0434\u0430.&nbsp;\u041f\u0440\u043e\u0441\u0442\u043e \u044d\u0442\u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u044b\u0434\u0430\u044e\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043d\u0438\u0433 \u043f\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u043c, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442 \u0438\u043b\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043a\u043d\u0438\u0433\u0435 \u0438 \u0443\u0434\u0430\u043b\u044f\u044e\u0442 \u043a\u043d\u0438\u0433\u0443.<\/p>\n<pre><code class=\"java\">package com.medium.libraryinfosystem.service;  import com.medium.libraryinfosystem.model.lombok.Book;  import java.util.List;  \/**  * @author ragcrix  *\/ public interface BookService {     Book findByName(String name);      List&lt;Book&gt; findAll();      Book save(Book book);      void delete(Book book); }<\/code><\/pre>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u044d\u0442\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043d\u0438\u0436\u0435.<\/p>\n<pre><code class=\"java\">package com.medium.libraryinfosystem.service.impl;  import com.medium.libraryinfosystem.model.lombok.Book; import com.medium.libraryinfosystem.repository.BookRepository; import com.medium.libraryinfosystem.service.BookService; import<\/code><\/pre>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-311621","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/311621","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=311621"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/311621\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=311621"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=311621"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=311621"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}