{"id":336421,"date":"2022-08-01T15:00:05","date_gmt":"2022-08-01T15:00:05","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=336421"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=336421","title":{"rendered":"<span>\u041a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0441\u043e \u0441\u0432\u044f\u0437\u044f\u043c\u0438 \u0432 Spring Rest \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b21\/cfc\/cc5\/b21cfccc5f3bda7f06e85004497dfc2d.png\" width=\"780\" height=\"439\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b21\/cfc\/cc5\/b21cfccc5f3bda7f06e85004497dfc2d.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0441\u0435\u0431\u0435, \u0447\u0442\u043e \u0432\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0435 \u0441\u0430\u043c\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 REST \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430 \u0441\u0442\u0435\u043a\u0435 Spring, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0442\u0430\u043a\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (build.gradle):<\/p>\n<pre><code>... dependencies { ... implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-web' ... } <\/code><\/pre>\n<p>\u0412\u0441\u0435 \u0438\u0434\u0435\u0442 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e. \u0412\u044b \u043f\u0438\u0448\u0435\u0442\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0434\u043b\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 User:<\/p>\n<pre><code class=\"java\">public interface UserRepository extends CrudRepository&lt;User, UUID> { }  <\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043f\u0438\u0448\u0435\u0442\u0435 \u0441\u0430\u043c\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e \u0435\u0433\u043e Id:<\/p>\n<pre><code class=\"java\">public class UserService {     ...     public User getUser(UUID id) {         return userRepository.findById(id)                 .orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND));     }     ... } <\/code><\/pre>\n<p>\u0418, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0432 \u0432\u0430\u0448\u0435\u043c REST \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e REST API \u0438\u0437\u0432\u043d\u0435:<\/p>\n<pre><code class=\"java\">@RestController @RequestMapping(\"\/users\") public class UserController {     ...     @GetMapping(path = \"\/{id}\")     public User getUser(@PathVariable UUID id) {         return userService.getUser(id);     }     ... } <\/code><\/pre>\n<p>\u042f \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0441\u044c \u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f Spring \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 application.properties \u0438\u043b\u0438 \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u0438\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0447\u0438\u0445 \u0434\u0435\u0442\u0430\u043b\u044f\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044f, \u0447\u0442\u043e \u0432\u044b \u044d\u0442\u043e \u0443\u0436\u0435 \u0443\u043c\u0435\u0435\u0442\u0435, \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0432 \u043d\u0435\u0439 \u0441\u043e\u0437\u0434\u0430\u043d\u044b, \u043a\u043b\u0430\u0441\u0441 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 User \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043d \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e Postman. \u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (\u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0432 Intellij Idea) \u0438 \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043e\u043d\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u043b\u043e:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/34a\/6dc\/0da\/34a6dc0dac16260f9703e8f416d886b9.png\" width=\"1811\" height=\"126\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/34a\/6dc\/0da\/34a6dc0dac16260f9703e8f416d886b9.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 Postman \u0438 \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c GET \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u043c\u0435\u0442\u043e\u0434\u0443 REST API \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u043e\u043d \u0435\u0441\u0442\u044c \u0432 \u0411\u0414, \u043f\u043e \u0435\u0433\u043e Id:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/990\/e84\/49e\/990e8449e5776cff413b7b7845ef13b7.png\" width=\"1369\" height=\"791\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/990\/e84\/49e\/990e8449e5776cff413b7b7845ef13b7.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041a\u0430\u043a\u043e\u0439 \u0443\u0436\u0430\u0441! \u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u043d\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441, \u0434\u0430\u0436\u0435 500 Interal error! \u0412 \u0447\u0435\u043c \u0436\u0435 \u0434\u0435\u043b\u043e? \u0412\u0435\u0434\u044c \u044d\u0442\u043e, \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0441\u0430\u043c\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 REST \u0441\u0435\u0440\u0432\u0438\u0441. \u0414\u0430\u043b\u0435\u0435, \u043a\u0430\u043a \u0443\u0436\u0435 \u0431\u043e\u043b\u0435\u0435-\u043c\u0435\u043d\u0435\u0435 \u043e\u043f\u044b\u0442\u043d\u044b\u0439 junior \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0432\u044b \u0441\u043d\u043e\u0432\u0430 \u0437\u0430\u0445\u043e\u0434\u0438\u0442\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c Intellij Idea \u0438 \u0432\u0438\u0434\u0438\u0442\u0435 \u0442\u0430\u043a\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ed5\/7f9\/c7c\/ed57f9c7cd4183159a8019702b908cf9.png\" width=\"1801\" height=\"439\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ed5\/7f9\/c7c\/ed57f9c7cd4183159a8019702b908cf9.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0418\u0442\u0430\u043a, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f, \u0432 \u0447\u0435\u043c \u0434\u0435\u043b\u043e. \u041f\u043e \u043b\u043e\u0433\u0443 \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 Contact \u0438 Profile (\u043f\u0440\u0438\u0447\u0435\u043c \u0442\u0443\u0442 \u043e\u043d\u0438, \u0432\u0435\u0434\u044c \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0441 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c\u044e User?), \u0438 Spring \u043d\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e REST \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u044e. \u041f\u043e\u0447\u0435\u043c\u0443? \u0412\u043e\u0442 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441 \u043d\u0430\u0448\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c. \u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u0437\u0430\u0433\u043b\u044f\u043d\u0435\u043c \u0432 \u0441\u0430\u043c\u0443 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c User:<\/p>\n<pre><code class=\"java\">... @Entity @Getter @Setter @ToString @RequiredArgsConstructor public class User {     @Id     @GeneratedValue     private UUID id;      @OneToOne(cascade = CascadeType.ALL)     @JoinColumn(name = \"profile_id\", referencedColumnName = \"id\")     private Profile profile;     ... }  <\/code><\/pre>\n<p>\u041a\u0430\u043a \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e! \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0443 \u043d\u0430\u0441 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 User, \u043d\u043e \u0438 \u0432 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0439 \u043a \u043d\u0435\u043c\u0443 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 Profile. \u0412\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0442\u0430\u043a\u0443\u044e \u0441\u0432\u044f\u0437\u044c \u043e\u0434\u0438\u043d-\u043a-\u043e\u0434\u043d\u043e\u043c\u0443, \u043d\u043e \u0437\u0430\u0431\u044b\u043b\u0438 \u043e\u0431 \u044d\u0442\u043e\u043c.<\/p>\n<p>\u0417\u0430\u0433\u043b\u044f\u043d\u0435\u043c \u0432 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c Profile:<\/p>\n<pre><code class=\"java\">... @Entity @Getter @Setter @ToString @RequiredArgsConstructor public class Profile {     @Id     @GeneratedValue     private UUID id;      private String name;      private String surname;      @Column(name = \"second_name\")     private String secondName;      @Column(name = \"birth_date\")     private Instant birthDate;      @Column(name = \"avatar_link\")     private String avatarLink;      private String information;      @Column(name = \"city_id\")     private Integer cityId;      @OneToOne(cascade = CascadeType.ALL)     @JoinColumn(name = \"contact_id\", referencedColumnName = \"id\")      private Contact contact;      @Column(name = \"gender_id\")     private UUID gender_id;      @OneToOne(mappedBy = \"profile\")     User user;  } ... <\/code><\/pre>\n<p>\u0423\u043f\u0441! \u041f\u043e\u043c\u0438\u043c\u043e \u00ab\u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0446\u0430\u00bb \u0441\u0432\u044f\u0437\u0438 \u043e\u0434\u0438\u043d-\u043a-\u043e\u0434\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c<\/p>\n<pre><code class=\"java\">    @OneToOne(mappedBy = \"profile\")     User user; <\/code><\/pre>\n<p>\u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0438 \u0441\u0430\u043c \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u0441\u0432\u044f\u0437\u0430\u043d \u043f\u043e \u0442\u0438\u043f\u0443 \u043e\u0434\u0438\u043d-\u043a-\u043e\u0434\u043d\u043e\u043c\u0443 \u0435\u0449\u0435 \u0441 \u043e\u0434\u043d\u043e\u0439 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c\u044e \u2014 Contact. \u0422\u043e \u0435\u0441\u0442\u044c \u0432\u044b \u0432\u044b\u0434\u0435\u043b\u0438\u043b\u0438 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0442\u0430\u043a\u0436\u0435 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c. \u041c\u043e\u0436\u0435\u043c \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0438 \u043d\u0430 \u043d\u0435\u0435:<\/p>\n<pre><code class=\"java\">@Entity @Getter @Setter @RequiredArgsConstructor @ToString public class Contact {     @Id     @GeneratedValue     private UUID id;      private String email;      private String phone;      @OneToOne(mappedBy = \"contact\")     Profile profile; }  <\/code><\/pre>\n<p>\u041d\u0443, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0437\u0434\u0435\u0441\u044c \u043a\u043e\u043d\u0435\u0446 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u2014 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0438 \u0441 \u0447\u0435\u043c \u043a\u043e\u043d\u0442\u0430\u043a\u0442 \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u2014 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u0438 \u043a\u043e\u043d\u0442\u0430\u043a\u0442. \u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u043d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f, \u043d\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432\u044b \u0438 \u0432 \u0411\u0414 \u043d\u0430\u043b\u043e\u0436\u0438\u043b\u0438 \u043d\u0430 \u043d\u0438\u0445 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 constraint, \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"sql\">alter table users_scheme.user add constraint user_profile_fk foreign key (profile_id) references users_scheme.profile(ID) on delete cascade on update cascade; alter table users_scheme.profile add constraint profile_contact_fk foreign key (contact_id) references users_scheme.contact(ID) on delete cascade on update cascade; <\/code><\/pre>\n<p>\u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u044d\u0442\u0438\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u0432 \u0432\u0430\u0448\u0438 \u043a\u043b\u0430\u0441\u0441\u044b \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439, \u0447\u0442\u043e\u0431\u044b Hibernate \u043c\u043e\u0433 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0438\u043c\u0438. \u041d\u043e \u043e\u043d \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>\u041e \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0432\u044b \u0443\u0436\u0435 \u0434\u043e\u0433\u0430\u0434\u0430\u043b\u0438\u0441\u044c, \u0435\u0441\u043b\u0438 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043b\u0438, \u0447\u0442\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u044c \u043e\u0434\u0438\u043d-\u043a-\u043e\u0434\u043d\u043e\u043c\u0443 \u0443 \u043d\u0430\u0441 \u0434\u0432\u0443\u0445\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044f\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f fasterxml jackson \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u0446\u0438\u043a\u043b \u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u044d\u0442\u043e\u0433\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c. \u0412\u044b\u0432\u043e\u0434 \u2014 \u043d\u0443\u0436\u043d\u043e \u044d\u0442\u043e\u0442 \u0446\u0438\u043a\u043b \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0441\u0434\u0435\u043b\u0430\u0432 \u0435\u0433\u043e \u043d\u0435 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u043c, \u0438\u043b\u0438 \u043f\u0440\u0435\u0440\u0432\u0430\u0442\u044c.<\/p>\n<p>\u0414\u043b\u044f \u0432\u0430\u0441 \u0442\u0430\u043a\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043d\u043e\u0432\u0430\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0435\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0437 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439.<\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043d\u043e \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0438\u043d\u0430\u0447\u0435 \u0438 \u043c\u043e\u0433\u0443\u0442 \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u043e\u043e\u0431\u0449\u0435 \u0438\u043b\u0438 \u043d\u0435 \u0432\u044b\u0434\u0430\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0436\u0435 \u043f\u043e\u043b\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e\u0441\u044c \u043d\u0430 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e\u0442. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u044f \u0435\u0449\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u044e \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c. \u041c\u0430\u0440\u043a\u0438\u0440\u0443\u0435\u043c \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u044f \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439:<\/p>\n<pre><code class=\"java\">\/\/\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c @OneToOne(cascade = CascadeType.ALL) @JoinColumn(name = \"profile_id\", referencedColumnName = \"id\") @JsonIdentityInfo(         generator = ObjectIdGenerators.PropertyGenerator.class,         property = \"id\") private Profile profile;  \/\/\u043f\u0440\u043e\u0444\u0438\u043b\u044c @OneToOne(cascade = CascadeType.ALL) @JoinColumn(name = \"contact_id\", referencedColumnName = \"id\") @JsonIdentityInfo(         generator = ObjectIdGenerators.PropertyGenerator.class,         property = \"id\") private Contact contact;  \/\/\u043a\u043e\u043d\u0442\u0430\u043a\u0442 @OneToOne(mappedBy = \"contact\") @JsonIdentityInfo(         generator = ObjectIdGenerators.PropertyGenerator.class,         property = \"id\")     Profile profile; <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 Postman:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/810\/6fb\/105\/8106fb105ec66262a3b24a29fc5bc11b.png\" width=\"1331\" height=\"811\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/810\/6fb\/105\/8106fb105ec66262a3b24a29fc5bc11b.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u043e\u0442 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0435 \u0432 \u043f\u043e\u043b\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439 JSON \u043e\u0442\u0432\u0435\u0442 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435 \u0438\u0437 \u0432\u0441\u0435\u0445 \u0442\u0440\u0435\u0445 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439. \u0412 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 IDE \u0442\u0430\u043a\u0436\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435\u0442.<\/p>\n<hr\/>\n<blockquote>\n<p>\u0421\u043a\u043e\u0440\u043e \u0432 OTUS \u0441\u043e\u0441\u0442\u043e\u0438\u0442\u0441\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0435 \u0437\u0430\u043d\u044f\u0442\u0438\u0435 <strong>\u00ab\u0410\u0441\u043f\u0435\u043a\u0442\u044b \u0432 Java \u0438 \u0432 Spring\u00bb<\/strong>, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0430\u0441\u043f\u0435\u043a\u0442\u044b \u2014 \u0447\u0442\u043e \u044d\u0442\u043e \u0438 \u0437\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u043d\u043e; \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0430\u0441\u043f\u0435\u043a\u0442\u044b \u0432 Java, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0440\u0430\u0437\u043d\u044b\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438, \u0438 \u043a\u0430\u043a \u043e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 Spring. \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u2014<a href=\"https:\/\/otus.pw\/wBXN\/\"> \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435.<\/a><\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \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\/company\/otus\/blog\/679722\/\"> https:\/\/habr.com\/ru\/company\/otus\/blog\/679722\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0441\u0435\u0431\u0435, \u0447\u0442\u043e \u0432\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0435 \u0441\u0430\u043c\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 REST \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430 \u0441\u0442\u0435\u043a\u0435 Spring, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0442\u0430\u043a\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (build.gradle):<\/p>\n<pre><code>... dependencies { ... implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-web' ... } <\/code><\/pre>\n<p>\u0412\u0441\u0435 \u0438\u0434\u0435\u0442 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e. \u0412\u044b \u043f\u0438\u0448\u0435\u0442\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0434\u043b\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 User:<\/p>\n<pre><code class=\"java\">public interface UserRepository extends CrudRepository&lt;User, UUID> { }  <\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043f\u0438\u0448\u0435\u0442\u0435 \u0441\u0430\u043c\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e \u0435\u0433\u043e Id:<\/p>\n<pre><code class=\"java\">public class UserService {     ...     public User getUser(UUID id) {         return userRepository.findById(id)                 .orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND));     }     ... } <\/code><\/pre>\n<p>\u0418, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0432 \u0432\u0430\u0448\u0435\u043c REST \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e REST API \u0438\u0437\u0432\u043d\u0435:<\/p>\n<pre><code class=\"java\">@RestController @RequestMapping(\"\/users\") public class UserController {     ...     @GetMapping(path = \"\/{id}\")     public User getUser(@PathVariable UUID id) {         return userService.getUser(id);     }     ... } <\/code><\/pre>\n<p>\u042f \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u043d\u043e \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0441\u044c \u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f Spring \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 application.properties \u0438\u043b\u0438 \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u0438\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0447\u0438\u0445 \u0434\u0435\u0442\u0430\u043b\u044f\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044f, \u0447\u0442\u043e \u0432\u044b \u044d\u0442\u043e \u0443\u0436\u0435 \u0443\u043c\u0435\u0435\u0442\u0435, \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0432 \u043d\u0435\u0439 \u0441\u043e\u0437\u0434\u0430\u043d\u044b, \u043a\u043b\u0430\u0441\u0441 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 User \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u043d \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e Postman. \u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (\u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0432 Intellij Idea) \u0438 \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043e\u043d\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u043b\u043e:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 Postman \u0438 \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c GET \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u043c\u0435\u0442\u043e\u0434\u0443 REST API \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u043e\u043d \u0435\u0441\u0442\u044c \u0432 \u0411\u0414, \u043f\u043e \u0435\u0433\u043e Id:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041a\u0430\u043a\u043e\u0439 \u0443\u0436\u0430\u0441! \u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u043d\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441, \u0434\u0430\u0436\u0435 500 Interal error! \u0412 \u0447\u0435\u043c \u0436\u0435 \u0434\u0435\u043b\u043e? \u0412\u0435\u0434\u044c \u044d\u0442\u043e, \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0441\u0430\u043c\u044b\u0439 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 REST \u0441\u0435\u0440\u0432\u0438\u0441. \u0414\u0430\u043b\u0435\u0435, \u043a\u0430\u043a \u0443\u0436\u0435 \u0431\u043e\u043b\u0435\u0435-\u043c\u0435\u043d\u0435\u0435 \u043e\u043f\u044b\u0442\u043d\u044b\u0439 junior \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0432\u044b \u0441\u043d\u043e\u0432\u0430 \u0437\u0430\u0445\u043e\u0434\u0438\u0442\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c Intellij Idea \u0438 \u0432\u0438\u0434\u0438\u0442\u0435 \u0442\u0430\u043a\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0418\u0442\u0430\u043a, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c\u0441\u044f, \u0432 \u0447\u0435\u043c \u0434\u0435\u043b\u043e. \u041f\u043e \u043b\u043e\u0433\u0443 \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 Contact \u0438 Profile (\u043f\u0440\u0438\u0447\u0435\u043c \u0442\u0443\u0442 \u043e\u043d\u0438, \u0432\u0435\u0434\u044c \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0441 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c\u044e User?), \u0438 Spring \u043d\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e REST \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u044e. \u041f\u043e\u0447\u0435\u043c\u0443? \u0412\u043e\u0442 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441 \u043d\u0430\u0448\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c. \u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u0437\u0430\u0433\u043b\u044f\u043d\u0435\u043c \u0432 \u0441\u0430\u043c\u0443 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c User:<\/p>\n<pre><code class=\"java\">... @Entity @Getter @Setter @ToString @RequiredArgsConstructor public class User {     @Id     @GeneratedValue     private UUID id;      @OneToOne(cascade = CascadeType.ALL)     @JoinColumn(name = \"profile_id\", referencedColumnName = \"id\")     private Profile profile;     ... }  <\/code><\/pre>\n<p>\u041a\u0430\u043a \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e! \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0443 \u043d\u0430\u0441 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 User, \u043d\u043e \u0438 \u0432 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0439 \u043a \u043d\u0435\u043c\u0443 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 Profile. \u0412\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0442\u0430\u043a\u0443\u044e \u0441\u0432\u044f\u0437\u044c \u043e\u0434\u0438\u043d-\u043a-\u043e\u0434\u043d\u043e\u043c\u0443, \u043d\u043e \u0437\u0430\u0431\u044b\u043b\u0438 \u043e\u0431 \u044d\u0442\u043e\u043c.<\/p>\n<p>\u0417\u0430\u0433\u043b\u044f\u043d\u0435\u043c \u0432 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c Profile:<\/p>\n<pre><code class=\"java\">... @Entity @Getter @Setter @ToString @RequiredArgsConstructor public class Profile {     @Id     @GeneratedValue     private UUID id;      private String name;      private String surname;      @Column(name = \"second_name\")     private String secondName;      @Column(name = \"birth_date\")     private Instant birthDate;      @Column(name = \"avatar_link\")     private String avatarLink;      private String information;      @Column(name = \"city_id\")     private Integer cityId;      @OneToOne(cascade = CascadeType.ALL)     @JoinColumn(name = \"contact_id\", referencedColumnName = \"id\")      private Contact contact;      @Column(name = \"gender_id\")     private UUID gender_id;      @OneToOne(mappedBy = \"profile\")     User user;  } ... <\/code><\/pre>\n<p>\u0423\u043f\u0441! \u041f\u043e\u043c\u0438\u043c\u043e \u00ab\u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0446\u0430\u00bb \u0441\u0432\u044f\u0437\u0438 \u043e\u0434\u0438\u043d-\u043a-\u043e\u0434\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c<\/p>\n<pre><code class=\"java\">    @OneToOne(mappedBy = \"profile\")     User user; <\/code><\/pre>\n<p>\u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0438 \u0441\u0430\u043c \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u0441\u0432\u044f\u0437\u0430\u043d \u043f\u043e \u0442\u0438\u043f\u0443 \u043e\u0434\u0438\u043d-\u043a-\u043e\u0434\u043d\u043e\u043c\u0443 \u0435\u0449\u0435 \u0441 \u043e\u0434\u043d\u043e\u0439 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c\u044e \u2014 Contact. \u0422\u043e \u0435\u0441\u0442\u044c \u0432\u044b \u0432\u044b\u0434\u0435\u043b\u0438\u043b\u0438 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0442\u0430\u043a\u0436\u0435 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c. \u041c\u043e\u0436\u0435\u043c \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0438 \u043d\u0430 \u043d\u0435\u0435:<\/p>\n<pre><code class=\"java\">@Entity @Getter @Setter @RequiredArgsConstructor @ToString public class Contact {     @Id     @GeneratedValue     private UUID id;      private String email;      private String phone;      @OneToOne(mappedBy = \"contact\")     Profile profile; }  <\/code><\/pre>\n<p>\u041d\u0443, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0437\u0434\u0435\u0441\u044c \u043a\u043e\u043d\u0435\u0446 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u2014 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0438 \u0441 \u0447\u0435\u043c \u043a\u043e\u043d\u0442\u0430\u043a\u0442 \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u2014 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u0438 \u043a\u043e\u043d\u0442\u0430\u043a\u0442. \u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u043d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f, \u043d\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432\u044b \u0438 \u0432 \u0411\u0414 \u043d\u0430\u043b\u043e\u0436\u0438\u043b\u0438 \u043d\u0430 \u043d\u0438\u0445 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 constraint, \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"sql\">alter table users_scheme.user add constraint user_profile_fk foreign key (profile_id) references users_scheme.profile(ID) on delete cascade on update cascade; alter table users_scheme.profile add constraint profile_contact_fk foreign key (contact_id) references users_scheme.contact(ID) on delete cascade on update cascade; <\/code><\/pre>\n<p>\u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u044d\u0442\u0438\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u0432 \u0432\u0430\u0448\u0438 \u043a\u043b\u0430\u0441\u0441\u044b \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439, \u0447\u0442\u043e\u0431\u044b Hibernate \u043c\u043e\u0433 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0438\u043c\u0438. \u041d\u043e \u043e\u043d \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p>\u041e \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0432\u044b \u0443\u0436\u0435 \u0434\u043e\u0433\u0430\u0434\u0430\u043b\u0438\u0441\u044c, \u0435\u0441\u043b\u0438 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043b\u0438, \u0447\u0442\u043e \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u044c \u043e\u0434\u0438\u043d-\u043a-\u043e\u0434\u043d\u043e\u043c\u0443 \u0443 \u043d\u0430\u0441 \u0434\u0432\u0443\u0445\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u044f\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f fasterxml jackson \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u0446\u0438\u043a\u043b \u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u044d\u0442\u043e\u0433\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c. \u0412\u044b\u0432\u043e\u0434 \u2014 \u043d\u0443\u0436\u043d\u043e \u044d\u0442\u043e\u0442 \u0446\u0438\u043a\u043b \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0441\u0434\u0435\u043b\u0430\u0432 \u0435\u0433\u043e \u043d\u0435 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u043c, \u0438\u043b\u0438 \u043f\u0440\u0435\u0440\u0432\u0430\u0442\u044c.<\/p>\n<p>\u0414\u043b\u044f \u0432\u0430\u0441 \u0442\u0430\u043a\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043d\u043e\u0432\u0430\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0435\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438\u0437 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439.<\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043d\u043e \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0438\u043d\u0430\u0447\u0435 \u0438 \u043c\u043e\u0433\u0443\u0442 \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u043e\u043e\u0431\u0449\u0435 \u0438\u043b\u0438 \u043d\u0435 \u0432\u044b\u0434\u0430\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0436\u0435 \u043f\u043e\u043b\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u044e\u0441\u044c \u043d\u0430 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e\u0442. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u044f \u0435\u0449\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u044e \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c. \u041c\u0430\u0440\u043a\u0438\u0440\u0443\u0435\u043c \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u044f \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439:<\/p>\n<pre><code class=\"java\">\/\/\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c @OneToOne(cascade = CascadeType.ALL) @JoinColumn(name = \"profile_id\", referencedColumnName = \"id\") @JsonIdentityInfo(         generator = ObjectIdGenerators.PropertyGenerator.class,         property = \"id\") private Profile profile;  \/\/\u043f\u0440\u043e\u0444\u0438\u043b\u044c @OneToOne(cascade = CascadeType.ALL) @JoinColumn(name = \"contact_id\", referencedColumnName = \"id\") @JsonIdentityInfo(         generator = ObjectIdGenerators.PropertyGenerator.class,         property = \"id\") private Contact contact;  \/\/\u043a\u043e\u043d\u0442\u0430\u043a\u0442 @OneToOne(mappedBy = \"contact\") @JsonIdentityInfo(         generator = ObjectIdGenerators.PropertyGenerator.class,         property = \"id\")     Profile profile; <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 Postman:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u043e\u0442 \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0435 \u0432 \u043f\u043e\u043b\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439 JSON \u043e\u0442\u0432\u0435\u0442 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435 \u0438\u0437 \u0432\u0441\u0435\u0445 \u0442\u0440\u0435\u0445 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439. \u0412 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 IDE \u0442\u0430\u043a\u0436\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435\u0442.<\/p>\n<hr\/>\n<blockquote>\n<p>\u0421\u043a\u043e\u0440\u043e \u0432 OTUS \u0441\u043e\u0441\u0442\u043e\u0438\u0442\u0441\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0435 \u0437\u0430\u043d\u044f\u0442\u0438\u0435 <strong>\u00ab\u0410\u0441\u043f\u0435\u043a\u0442\u044b \u0432 Java \u0438 \u0432 Spring\u00bb<\/strong>, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0430\u0441\u043f\u0435\u043a\u0442\u044b \u2014 \u0447\u0442\u043e \u044d\u0442\u043e \u0438 \u0437\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u043d\u043e; \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0430\u0441\u043f\u0435\u043a\u0442\u044b \u0432 Java, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0440\u0430\u0437\u043d\u044b\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438, \u0438 \u043a\u0430\u043a \u043e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 Spring. \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u2014<a href=\"https:\/\/otus.pw\/wBXN\/\"> \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435.<\/a><\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \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\/company\/otus\/blog\/679722\/\"> https:\/\/habr.com\/ru\/company\/otus\/blog\/679722\/<\/a><br \/><\/br><\/br><\/p>\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-336421","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/336421","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=336421"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/336421\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=336421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=336421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=336421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}