{"id":414438,"date":"2024-06-29T23:45:33","date_gmt":"2024-06-29T23:45:33","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=414438"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-06-29T23:45:33","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=414438","title":{"rendered":"<span>Java\/Scala: \u0441\u0430\u043c\u0430\u044f \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u0430\u044f \u0442\u0440\u0435\u0445\u0437\u0432\u0435\u043d\u043d\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0432 \u043c\u043e\u0435\u043c \u043c\u043e\u0434\u043d\u0435\u0439\u0448\u0435\u043c To-Do List<\/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<p>\u0412\u0438\u0434\u0435\u043e-\u0432\u0430\u0440\u0438\u0430\u043d\u0442: <\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/60fdc4d4abf7c98fe8a333e2\" data-style=\"\" id=\"60fdc4d4abf7c98fe8a333e2\" width=\"\"><\/div>\n<p>\u041a\u043e\u0433\u0434\u0430-\u0442\u043e \u0434\u0430\u0432\u043d\u043e, \u0432 2015 \u0433\u043e\u0434\u0443, \u044f \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 <a href=\"https:\/\/habr.com\/ru\/post\/269083\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u044e \u043f\u0440\u043e Java \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u0435\u0441\u043b\u0438 \u0432\u043a\u0440\u0430\u0442\u0446\u0435 &#171;\u041a\u0430\u043a \u044f \u043d\u0430 \u043a\u043e\u043b\u0435\u043d\u043a\u0435 \u0441\u0434\u0435\u043b\u0430\u043b \u0441\u0432\u043e\u0435 1\u0421:\u041f\u0440\u0435\u0434\u043f\u0440\u0438\u044f\u0442\u0438\u0435, \u0441 \u0431\u043b\u0435\u043a-\u0434\u0436\u0435\u043a\u043e\u043c \u0438 \u0448\u043b\u044e\u0445\u0430\u043c\u0438&#187;<\/a>. <\/p>\n<p>\u0412\u043e\u0442 \u043d\u0430 \u0447\u0442\u043e \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u0445\u043e\u0436\u0435 (\u043a\u0430\u0441\u043a\u0430\u0434 \u0444\u043e\u0440\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e \u043a\u043b\u0430\u0441\u0441\u0430\u043c Entities \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e reflection):<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/046\/de6\/a4d\/046de6a4dc4b8bb499496ba33c67893a.jpg\" width=\"955\" height=\"533\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/046\/de6\/a4d\/046de6a4dc4b8bb499496ba33c67893a.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041d\u043e \u044d\u0442\u043e \u0431\u044b\u043b\u0430, \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0434\u0432\u0443\u0445\u0437\u0432\u0435\u043d\u043a\u0430, \u0430 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u0430 \u043e\u0442 \u043c\u0435\u043d\u044f \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043b\u0430\u043f\u0448\u0435\u043a\u043e\u0434\u0430, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044f \u043d\u0430\u0434\u043e\u043b\u0433\u043e \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u043b\u0441\u044f \u0432 \u0434\u0435\u043f\u0440\u0435\u0441\u0441\u0438\u044e. \u0418 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0441\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e \u043f\u0440\u0438 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438, \u0440\u0443\u0447\u043d\u043e\u0435 \u0432\u043a\u043e\u043b\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 Entities, \u0435\u0449\u0435 \u0438 \u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c \u0441\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c\u0438 liquibase &#8212; \u0434\u0443\u0440\u0430\u0446\u043a\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a &#171;\u0442\u0443\u043f\u044b\u0435 1\u0421\u043d\u0438\u043a\u0438&#187; (\u043f\u043e \u043c\u043d\u0435\u043d\u0438\u044e \u041d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0445 \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432), \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u044e\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0411\u0414 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043b\u0430\u0437\u044f \u0432 \u043a\u043e\u0434 \u0438 \u043d\u0435 \u043d\u0430\u043f\u0440\u044f\u0433\u0430\u044f\u0441\u044c. \u0422\u0435\u043f\u0435\u0440\u044c <a href=\"https:\/\/github.com\/nikita1andreev\/ToDoList\" rel=\"noopener noreferrer nofollow\">\u0436\u0435 \u044f \u0433\u043e\u0442\u043e\u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0430\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u043e\u0442\u043f\u0443\u0433\u043d\u0435\u0442 \u043f\u0435\u0440\u0435\u0431\u0435\u0436\u0447\u0438\u043a\u0430 \u0441 1\u0421 \u043d\u0430 Java.  <\/a><\/p>\n<p>\u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0443 1\u0421:\u041f\u0440\u0435\u0434\u043f\u0440\u0438\u044f\u0442\u0438\u044f &#8212; \u0437\u0430\u0443\u0447\u0438\u0432 \u0434\u0435\u0441\u044f\u0442\u043e\u043a \u0445\u043e\u0442\u043a\u0435\u0435\u0432 \u0442\u044b \u043c\u043e\u0436\u0435\u0448\u044c \u043d\u0430\u043b\u0430\u0431\u0430\u0442\u044c \u0443\u0447\u0435\u0442\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043f\u0440\u0438\u043a\u0430\u0441\u0430\u044f\u0441\u044c \u043a \u043c\u044b\u0448\u043a\u0435, \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432 \u0434\u0435\u0440\u0435\u0432\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u0430. <\/p>\n<p>\u0421 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u0438\u044f, \u043f\u0440\u043e\u0446\u0438\u0442\u0438\u0440\u0443\u044e \u0441\u0432\u043e\u044e \u0436\u0435 \u0441\u0442\u0430\u0442\u044c\u044e: <\/p>\n<blockquote>\n<p>&#171;\u041f\u0440\u043e\u0432\u043e\u0434\u044f \u0442\u0440\u0435\u043d\u0438\u043d\u0433\u0438 \u0434\u043b\u044f \u0420\u041f, \u044f &#8230; \u0441 \u043d\u0443\u043b\u044f \u0434\u0435\u043b\u0430\u043b \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u043a\u043e\u043d\u0442\u0443\u0440 \u0441\u043a\u043b\u0430\u0434\u0441\u043a\u043e\u0433\u043e \u0443\u0447\u0435\u0442\u0430 \u0437\u0430 4 \u043c\u0438\u043d\u0443\u0442\u044b 35 \u0441\u0435\u043a\u0443\u043d\u0434 &#8230;, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0432\u0432\u043e\u0434 \u0432 \u0431\u0430\u0437\u0443 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432.&#187;<\/p>\n<\/blockquote>\n<p>\u0414\u0430\u0436\u0435 \u0441\u043b\u043e\u0436\u043d\u0435\u0439\u0448\u0438\u0435 10+ \u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0435 SQL \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 1\u0421 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0431\u0435\u0437 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u043e\u043b\u0435\u0439 \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u043c\u0430\u0441\u0442\u0435\u0440\u0435. \u041d\u0435 \u0433\u043e\u0432\u043e\u0440\u044f \u043e\u0431\u043e \u0432\u0441\u0435\u043c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u043c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u043e\u0433\u0434\u0430, \u0432 2015, \u044f \u0431\u044b\u043b \u0433\u043b\u0443\u0431\u043e\u043a\u043e \u0440\u0430\u0437\u043e\u0447\u0430\u0440\u043e\u0432\u0430\u043d Enities \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438, hibernate \u0438 \u043f\u0440\u043e\u0447\u0438\u043c\u0438 \u043f\u0440\u0435\u043b\u0435\u0441\u0442\u044f\u043c\u0438 Java. <\/p>\n<p>\u0418 \u0432\u043e\u0442, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0434\u0436\u0443\u043d\u0438\u043e\u0440 \u0441 1\u0421\u043d\u044b\u043c \u0431\u044d\u043a\u0433\u0440\u0430\u0443\u043d\u0434\u043e\u043c \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0430\u0442\u044c\u0441\u044f \u0437\u0430 \u0434\u043b\u0438\u043d\u043d\u044b\u043c \u0440\u0443\u0431\u043b\u0435\u043c \u0432 \u043c\u0438\u0440 Java\/Scala (\u043f\u0441\u0441, \u0435\u0441\u043b\u0438 \u0447\u0442\u043e, \u0443 \u043d\u0430\u0441 \u0432 \u0431\u0430\u043d\u043a\u0435 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0430 \u0432\u0430\u043a\u0430\u043d\u0441\u0438\u0439, \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043b\u0438\u0447\u043a\u0443). <\/p>\n<p>\u041d\u043e \u0435\u0433\u043e \u043c\u043e\u0437\u0433, \u0438\u0437\u0431\u0430\u043b\u043e\u0432\u0430\u043d\u043d\u044b\u0439 1\u0421\u043e\u043c, \u0441\u043e\u043f\u0440\u043e\u0442\u0438\u0432\u043b\u044f\u0435\u0442\u0441\u044f &#8212; \u0435\u0449\u0435 \u0432\u0447\u0435\u0440\u0430 \u0435\u043c\u0443 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0443\u0447\u0443 \u0434\u0443\u0440\u0430\u0446\u043a\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e \u043d\u0430\u0431\u0438\u0432\u0430\u043d\u0438\u044e Pojo\/Hibernate \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043d\u0430 \u043a\u043b\u0430\u0432\u0435, \u0438 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u0432\u043e\u043b\u043a\u0430 \u043d\u0435 \u043a\u043e\u0440\u043c\u0438 \u0432\u044b\u0441\u043e\u043a\u0438\u043c \u043e\u043a\u043b\u0430\u0434\u043e\u043c, \u043e\u043d \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0438\u043d\u044f\u0442\u044c \u0432 \u043b\u0435\u0441 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0446\u0430\u0440\u0441\u0442\u0432\u0430 BDSM.<\/p>\n<p>\u042f \u043f\u043e\u043f\u044b\u0442\u0430\u044e\u0441\u044c \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0438 \u0432 \u043c\u0438\u0440\u0435 Java\/Scala \u0435\u0441\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0435 \u0442\u0440\u0435\u0445\u0437\u0432\u0435\u043d\u043d\u044b\u0435 (Bloody Enterprise) \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044f \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0443\u0441\u0438\u043b\u0438\u0439, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0448\u0438\u043a\u0430\u0440\u043d\u044b\u0445 \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u043e\u0432. <\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u0437\u0430\u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u0438\u0440\u0443\u0435\u043c \u0411\u0414. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043b\u044e\u0431\u0443\u044e \u0421\u0423\u0411\u0414 \u0438 \u043b\u044e\u0431\u043e\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440. \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e PostgreSQL \u0438 DBeaver, \u043d\u043e \u0435\u0441\u043b\u0438 \u043b\u0435\u043d\u044c \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0421\u0423\u0411\u0414, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c H2 database. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0430\u043c \u0431\u0430\u0437\u0443, \u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u043e \u0441\u0432\u043e\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435. \u042f \u0441\u043e\u0437\u0434\u0430\u043b \u0442\u0430\u0431\u043b\u0438\u0446\u0443 tasks \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e to-do list \u043f\u0440\u0438\u043c\u0435\u0440\u0430.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/949\/1bf\/247\/9491bf2475e9568edd117d41397bbf6e.png\" width=\"493\" height=\"563\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/949\/1bf\/247\/9491bf2475e9568edd117d41397bbf6e.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041a\u0442\u043e \u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0434\u043b\u044f \u043d\u0430\u0441 \u0434\u0443\u0440\u0430\u0446\u043a\u0438\u0435 java Pojo \u043a\u043b\u0430\u0441\u0441\u044b? \u041d\u0438\u043a\u0442\u043e, \u043d\u043e \u0441\u043a\u0430\u043b\u043e\u0432\u0441\u043a\u0438\u0435 case \u043a\u043b\u0430\u0441\u0441\u044b \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 sbt slickCodeGenTask. \u0412\u043e\u0442 \u0447\u0442\u043e \u043e\u043d\u0430 \u043d\u0430\u0442\u0432\u043e\u0440\u0438\u043b\u0430 (\u0445\u043e\u0442\u044f \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u0440\u044f\u0434 \u043b\u0438 \u043e\u043d\u0430 \u043d\u0430\u043a\u043e\u0441\u044f\u0447\u0438\u0442):<\/p>\n<pre><code class=\"scala\">package com.todolist.shared \/\/ AUTO-GENERATED Slick data model \/** Stand-alone Slick data model for immediate use *\/ object Tables extends {   val profile = slick.jdbc.PostgresProfile } with Tables  \/** Slick data model trait for extension, choice of backend or usage in the cake pattern. (Make sure to initialize this late.) *\/ trait Tables {   val profile: slick.jdbc.JdbcProfile   import profile.api._   import slick.model.ForeignKeyAction   \/\/ NOTE: GetResult mappers for plain SQL are only generated for tables where Slick knows how to map the types of all columns.   import slick.jdbc.{GetResult => GR}    \/** DDL for all tables. Call .create to execute. *\/   lazy val schema: profile.SchemaDescription = Tasks.schema   @deprecated(\"Use .schema instead of .ddl\", \"3.0\")   def ddl = schema    \/** Entity class storing rows of table Tasks    *  @param id Database column id SqlType(serial), AutoInc, PrimaryKey    *  @param text Database column text SqlType(varchar)    *  @param done Database column done SqlType(bool) *\/   case class TasksRow(id: Int, text: String, done: Boolean)   \/** GetResult implicit for fetching TasksRow objects using plain SQL queries *\/   implicit def GetResultTasksRow(implicit e0: GR[Int], e1: GR[String], e2: GR[Boolean]): GR[TasksRow] = GR{     prs => import prs._     TasksRow.tupled((&lt;&lt;[Int], &lt;&lt;[String], &lt;&lt;[Boolean]))   }   \/** Table description of table tasks. Objects of this class serve as prototypes for rows in queries. *\/   class Tasks(_tableTag: Tag) extends profile.api.Table[TasksRow](_tableTag, \"tasks\") {     def * = (id, text, done) &lt;> (TasksRow.tupled, TasksRow.unapply)     \/** Maps whole row to an option. Useful for outer joins. *\/     def ? = ((Rep.Some(id), Rep.Some(text), Rep.Some(done))).shaped.&lt;>({r=>import r._; _1.map(_=> TasksRow.tupled((_1.get, _2.get, _3.get)))}, (_:Any) =>  throw new Exception(\"Inserting into ? projection not supported.\"))      \/** Database column id SqlType(serial), AutoInc, PrimaryKey *\/     val id: Rep[Int] = column[Int](\"id\", O.AutoInc, O.PrimaryKey)     \/** Database column text SqlType(varchar) *\/     val text: Rep[String] = column[String](\"text\")     \/** Database column done SqlType(bool) *\/     val done: Rep[Boolean] = column[Boolean](\"done\")   }   \/** Collection-like TableQuery object for table Tasks *\/   lazy val Tasks = new TableQuery(tag => new Tasks(tag)) } <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a IDEA \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0432\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442, \u0432\u0441\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u0442\u044f\u043d\u0443\u043b\u0438\u0441\u044c \u0438\u0437 SQL \u0441\u0445\u0435\u043c\u044b, \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e Ctrl + Space, \u0432 \u0442.\u0447. \u0432 \u043b\u044e\u0431\u043e\u043c \u043b\u044f\u043c\u0431\u0434\u0430-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438 \u0438 for comprehension:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/215\/033\/2e7\/2150332e75ee65a17df457c48a847105.png\" width=\"1021\" height=\"144\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/215\/033\/2e7\/2150332e75ee65a17df457c48a847105.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0427\u0442\u043e \u0436\u0435 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u043c \u043b\u0438\u0447\u043d\u043e? \u0412\u0441\u0435\u0433\u043e 2 \u0444\u0430\u0439\u043b\u0430, \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430. \u0414\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a Akka \u0438 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e \u0430\u043a\u0442\u043e\u0440\u043e\u0432. \u041e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e, \u0447\u0442\u043e \u0430\u043a\u0442\u043e\u0440\u044b (\u043a\u043b\u0438\u0435\u043d\u0442 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440) \u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u0440\u0430\u0437\u043d\u044b\u043c \u0430\u043a\u0442\u043e\u0440-\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043e\u043d\u0446\u0430\u0445 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430, \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u044f\u0441\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c TCP, UDP (\u043c\u043e\u0433\u0443\u0442 \u0438 \u043f\u043e HTTP\/HTTPS, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u0430\u0437).   <\/p>\n<p>\u0418\u0442\u0430\u043a, \u043a\u043e\u0434 \u0441\u0435\u0440\u0432\u0435\u0440\u0430:<\/p>\n<pre><code class=\"scala\">package com.todolist   import akka.actor.{Actor, ActorRef, ActorSystem, Props} import com.typesafe.config.ConfigFactory  import java.util.concurrent.Executors import scala.concurrent.ExecutionContext import scala.util.Success  object Server extends App{   val config =ConfigFactory.load(\"application\")   val actorSystem = ActorSystem(\"serversystem\", config)   val server: ActorRef = actorSystem.actorOf(Props[ToDoListServer],\"todolistserver\") } class ToDoListServer extends Actor{   import slick.driver.PostgresDriver.api._   implicit val db = Database.forConfig(\"my.myDb\",Server.config)   implicit val ec = ExecutionContext.fromExecutorService(Executors.newFixedThreadPool(10))    override def receive: Receive = {     case x:String if (x.trim.isEmpty) =>     case x:String =>       val snd = sender()           val arr = x.split(' ')        arr(0) match {         case \"list\" =>           db.run(com.todolist.shared.Tables.Tasks.filter(_.done === false).sortBy(_.id).result)             .onComplete{ e => e match {             case Success(e) =>               val res = e.map(e=>s\"${e.id}. ${e.text}\").mkString(\"\\n\")               println(res)               snd ! res           }}         case \"add\" =>           db.run(com.todolist.shared.Tables.Tasks += com.todolist.shared.Tables.TasksRow(text = arr.drop(1).mkString(\" \"),done = false,id=0))         case \"done\" =>           val arr1 = arr(1).toInt           db.run((for { c &lt;- com.todolist.shared.Tables.Tasks  if c.id === arr1 } yield c.done).update(true))         case _ =>  sender() ! \"Unknown command\"       }   } } <\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e plain SQL &#8212; \u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e, \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0440\u0443\u043a\u0430\u043c\u0438 \u043c\u0430\u043f\u0438\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0411\u0414 \u043d\u0430 case \u043a\u043b\u0430\u0441\u0441\u044b Entities.<\/p>\n<p>\u041a\u043e\u0434 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 (\u0432\u043e\u043e\u0431\u0449\u0435-\u0442\u043e, \u044f \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u0435\u0433\u043e \u0441 \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430, \u043d\u043e \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0432\u043e\u0434 \u0441 \u043a\u043b\u0430\u0432\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u0430\u043a\u0442\u043e\u0440\u0430 \u0433\u043b\u044e\u0447\u0438\u043b, \u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u043e \u0441\u0443\u0442\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c):<\/p>\n<pre><code class=\"scala\">package com.todolist  import akka.actor.{Actor, ActorRef, ActorSystem, Props}  object Client {   case class Connect(server: ActorRef)   case class Process(cmd: String) }  class Client extends Actor {   override def receive: Actor.Receive = {     case Client.Connect(server) =>       context become process(server)   }   def process(server: ActorRef): Receive = {     case Client.Process(cmd) =>       server ! cmd     case x:String =>       println(s\"$x\")     case _ =>   } }  object ClientApp extends App {   import com.typesafe.config.ConfigFactory   import scala.concurrent.duration._   val actorSystem = ActorSystem(\"client-system\", ConfigFactory.load(\"client\"))   val client: ActorRef = actorSystem.actorOf(Props[Client])   val serverPath = \"akka:\/\/serversystem@127.0.0.1:2552\/user\/todolistserver\"   val serverSelection = actorSystem.actorSelection(serverPath)   serverSelection.resolveOne(FiniteDuration(10, SECONDS)).foreach { (server: ActorRef) =>     println(s\"Connected to $server\")     client ! Client.Connect(server)     while (true){       println(\"Enter command:\")       scala.io.StdIn.readLine() match {         case cmd => client ! Client.Process(cmd)       }     }   } (actorSystem.dispatcher) } <\/code><\/pre>\n<p>\u0410\u043a\u0442\u043e\u0440-\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0445\u043e\u0441\u0442\u0435, \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u0438\u0441\u0435\u0442\u044c \u043d\u0435 \u043e\u0434\u043d\u043e\u043c \u0438 \u0442\u043e\u043c \u0436\u0435 \u043f\u043e\u0440\u0442\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 application.conf, client.conf. \u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e, \u0434\u043b\u044f sbt \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0432\u044b\u0440\u0443\u0431\u0438\u0442\u044c jmx, \u0442\u0430\u043c \u0442\u043e\u0436\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442 \u043f\u043e\u0440\u0442\u043e\u0432 (\u043b\u0438\u0431\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0440\u0430\u0437\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0438 \u0434\u043b\u044f sbt \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430).<\/p>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430, \u0432 \u043e\u0434\u043d\u043e\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c: <\/p>\n<p>sbt &#171;runMain com.todolist.Server&#187;<\/p>\n<p>\u0412 \u0434\u0440\u0443\u0433\u043e\u043c:<\/p>\n<p>sbt &#171;runMain com.todolist.ClientApp&#187;<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430:<\/p>\n<blockquote>\n<p>Enter command: list <\/p>\n<p>5. task2 <\/p>\n<p>7. task3 <\/p>\n<p>9. task5 <\/p>\n<p>Enter command: add task6 <\/p>\n<p>Enter command: list <\/p>\n<p>5. task2 <\/p>\n<p>7. task3 <\/p>\n<p>9. task5 <\/p>\n<p>10. task6 <\/p>\n<p>Enter command: done 9 <\/p>\n<p>Enter command: list <\/p>\n<p>5. task2 <\/p>\n<p>7. task3 <\/p>\n<p>10. task6<\/p>\n<\/blockquote>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c, \u043d\u0435 \u043f\u043e\u0431\u043e\u044e\u0441\u044c \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430, \u0442\u0440\u0435\u0445\u0437\u0432\u0435\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u044f \u043b\u0438\u0447\u043d\u043e \u0437\u0430\u043a\u043e\u0434\u0438\u043b \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 80 \u0441\u0442\u0440\u043e\u043a; \u043f\u0440\u0438 \u044d\u0442\u043e\u043c, \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0445\u0435\u043c\u044b \u0411\u0414 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u0435 \u0435\u0435 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, IDEA \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0430 \u043c\u043d\u0435, \u043a\u0430\u043a\u0438\u0435 \u043f\u043e\u043b\u044f \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u0443 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439, \u0438 \u043d\u0435 \u043d\u0430\u043b\u0435\u043f\u0438\u043b \u043b\u0438  \u044f \u043e\u0448\u0438\u0431\u043e\u043a. \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u044d\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 1\u0421:\u041f\u0440\u0435\u0434\u043f\u0440\u0438\u044f\u0442\u0438\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0438 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 plain SQL \u044f \u043d\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043b. \u041d\u043e, \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 1\u0421 \u043c\u043e\u0436\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e select`\u044b, \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e &#8212; \u0430 \u0442\u0443\u0442, \u043a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0438 Insert, \u0438 Update. <\/p>\n<p>\u0410 \u0432\u043e\u043e\u0431\u0449\u0435-\u0442\u043e, \u0432 \u0442\u0430\u043a\u043e\u043c \u0436\u0435 \u0441\u0442\u0438\u043b\u0435, \u043d\u0430 Slick \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043a\u043e\u0434\u0438\u0442\u044c \u043c\u0435\u0433\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0434\u043b\u044f Spark SQL, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044f\u0442\u0441\u044f \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u0441\u044f \u043d\u0430 hadoop \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 \u0438\u0437 1000 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432, \u0430 \u043f\u043e\u0442\u043e\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u044d\u0442\u043e \u0432\u0441\u0435 \u043a\u0430\u043a\u0438\u043c-\u043d\u0438\u0431\u0443\u0434\u044c XGBoost \u0438\u043b\u0438 Tensorflow. \u0412 \u043e\u0431\u0449\u0435\u043c, \u0432\u0441\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f&#8230;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><\/p>\n<div class=\"tm-article-poll-container\"><!--[--><\/p>\n<div class=\"tm-article-poll tm-article-poll_variant-bordered\">\n<div class=\"tm-notice tm-notice_positive tm-article-poll__notice\"><!----><\/p>\n<div class=\"tm-notice__inner\"><!----><\/p>\n<div class=\"tm-notice__content\" data-test-id=\"notice-content\"><!--[--><span>\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a rel=\"nofollow\" href=\"\/kek\/v1\/auth\/habrahabr\/?back=\/ru\/articles\/569562\/&#038;hl=ru\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/span><!--]--><\/div>\n<\/div>\n<\/div>\n<p><!--[--><\/p>\n<div class=\"tm-article-poll__header\">\u0427\u0442\u043e \u0431\u044b \u0432\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438, \u0435\u0441\u043b\u0438 \u0437\u0430\u0432\u0442\u0440\u0430 \u0441\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0430 \u0432\u044b \u0434\u0430\u0436\u0435 \u043d\u0435 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u043b\u0438?<\/div>\n<div class=\"tm-article-poll__answers\"><!--[--><\/p>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent tm-article-poll__answer-percent_winning\">39.13% <\/span><span class=\"tm-article-poll__answer-label\">Java + Spring<\/span><span class=\"tm-article-poll__answer-votes\">36<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress tm-article-poll__answer-progress_winning\" style=\"width: 39.13%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">9.78% <\/span><span class=\"tm-article-poll__answer-label\">Scala + Akka<\/span><span class=\"tm-article-poll__answer-votes\">9<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 9.78%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">22.83% <\/span><span class=\"tm-article-poll__answer-label\">1C: \u041f\u0440\u0435\u0434\u043f\u0440\u0438\u044f\u0442\u0438\u0435 8<\/span><span class=\"tm-article-poll__answer-votes\">21<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 22.83%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">3.26% <\/span><span class=\"tm-article-poll__answer-label\">SAP<\/span><span class=\"tm-article-poll__answer-votes\">3<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 3.26%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">6.52% <\/span><span class=\"tm-article-poll__answer-label\">PHP + WordPress<\/span><span class=\"tm-article-poll__answer-votes\">6<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 6.52%\"><\/div>\n<\/div>\n<\/div>\n<div class=\"tm-article-poll__answer\">\n<div class=\"tm-article-poll__answer-data\"><span class=\"tm-article-poll__answer-percent\">18.48% <\/span><span class=\"tm-article-poll__answer-label\">\u042d\u0442\u043e\u0442 \u0432\u044b\u0437\u043e\u0432 \u043c\u043d\u0435 \u043d\u0435 \u043f\u043e \u0437\u0443\u0431\u0430\u043c<\/span><span class=\"tm-article-poll__answer-votes\">17<\/span><\/div>\n<div class=\"tm-article-poll__answer-bar\">\n<div class=\"tm-article-poll__answer-progress\" style=\"width: 18.48%\"><\/div>\n<\/div>\n<\/div>\n<p><!--]--><\/div>\n<div class=\"tm-article-poll__stats\"> \u041f\u0440\u043e\u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b\u0438 92 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.    \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u043b\u0438\u0441\u044c 24 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. <\/div>\n<p><!--]--><\/div>\n<p><!--]--><\/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\/articles\/569562\/\"> https:\/\/habr.com\/ru\/articles\/569562\/<\/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<p>\u0412\u0438\u0434\u0435\u043e-\u0432\u0430\u0440\u0438\u0430\u043d\u0442: <\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/60fdc4d4abf7c98fe8a333e2\" data-style=\"\" id=\"60fdc4d4abf7c98fe8a333e2\" width=\"\"><\/div>\n<p>\u041a\u043e\u0433\u0434\u0430-\u0442\u043e \u0434\u0430\u0432\u043d\u043e, \u0432 2015 \u0433\u043e\u0434\u0443, \u044f \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 <a href=\"https:\/\/habr.com\/ru\/post\/269083\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u044e \u043f\u0440\u043e Java \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u0435\u0441\u043b\u0438 \u0432\u043a\u0440\u0430\u0442\u0446\u0435 &#171;\u041a\u0430\u043a \u044f \u043d\u0430 \u043a\u043e\u043b\u0435\u043d\u043a\u0435 \u0441\u0434\u0435\u043b\u0430\u043b \u0441\u0432\u043e\u0435 1\u0421:\u041f\u0440\u0435\u0434\u043f\u0440\u0438\u044f\u0442\u0438\u0435, \u0441 \u0431\u043b\u0435\u043a-\u0434\u0436\u0435\u043a\u043e\u043c \u0438 \u0448\u043b\u044e\u0445\u0430\u043c\u0438&#187;<\/a>. <\/p>\n<p>\u0412\u043e\u0442 \u043d\u0430 \u0447\u0442\u043e \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u0445\u043e\u0436\u0435 (\u043a\u0430\u0441\u043a\u0430\u0434 \u0444\u043e\u0440\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e \u043a\u043b\u0430\u0441\u0441\u0430\u043c Entities \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e reflection):<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u043e \u044d\u0442\u043e \u0431\u044b\u043b\u0430, \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0434\u0432\u0443\u0445\u0437\u0432\u0435\u043d\u043a\u0430, \u0430 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u0430 \u043e\u0442 \u043c\u0435\u043d\u044f \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043b\u0430\u043f\u0448\u0435\u043a\u043e\u0434\u0430, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044f \u043d\u0430\u0434\u043e\u043b\u0433\u043e \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u043b\u0441\u044f \u0432 \u0434\u0435\u043f\u0440\u0435\u0441\u0441\u0438\u044e. \u0418 \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0441\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e \u043f\u0440\u0438 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438, \u0440\u0443\u0447\u043d\u043e\u0435 \u0432\u043a\u043e\u043b\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 Entities, \u0435\u0449\u0435 \u0438 \u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c \u0441\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c\u0438 liquibase &#8212; \u0434\u0443\u0440\u0430\u0446\u043a\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a &#171;\u0442\u0443\u043f\u044b\u0435 1\u0421\u043d\u0438\u043a\u0438&#187; (\u043f\u043e \u043c\u043d\u0435\u043d\u0438\u044e \u041d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0445 \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432), \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u044e\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0411\u0414 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043b\u0430\u0437\u044f \u0432 \u043a\u043e\u0434 \u0438 \u043d\u0435 \u043d\u0430\u043f\u0440\u044f\u0433\u0430\u044f\u0441\u044c. \u0422\u0435\u043f\u0435\u0440\u044c <a href=\"https:\/\/github.com\/nikita1andreev\/ToDoList\" rel=\"noopener noreferrer nofollow\">\u0436\u0435 \u044f \u0433\u043e\u0442\u043e\u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0430\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u043e\u0442\u043f\u0443\u0433\u043d\u0435\u0442 \u043f\u0435\u0440\u0435\u0431\u0435\u0436\u0447\u0438\u043a\u0430 \u0441 1\u0421 \u043d\u0430 Java.  <\/a><\/p>\n<p>\u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0443 1\u0421:\u041f\u0440\u0435\u0434\u043f\u0440\u0438\u044f\u0442\u0438\u044f &#8212; \u0437\u0430\u0443\u0447\u0438\u0432 \u0434\u0435\u0441\u044f\u0442\u043e\u043a \u0445\u043e\u0442\u043a\u0435\u0435\u0432 \u0442\u044b \u043c\u043e\u0436\u0435\u0448\u044c \u043d\u0430\u043b\u0430\u0431\u0430\u0442\u044c \u0443\u0447\u0435\u0442\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043f\u0440\u0438\u043a\u0430\u0441\u0430\u044f\u0441\u044c \u043a \u043c\u044b\u0448\u043a\u0435, \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432 \u0434\u0435\u0440\u0435\u0432\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u0430. <\/p>\n<p>\u0421 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u0438\u044f, \u043f\u0440\u043e\u0446\u0438\u0442\u0438\u0440\u0443\u044e \u0441\u0432\u043e\u044e \u0436\u0435 \u0441\u0442\u0430\u0442\u044c\u044e: <\/p>\n<blockquote>\n<p>&#171;\u041f\u0440\u043e\u0432\u043e\u0434\u044f \u0442\u0440\u0435\u043d\u0438\u043d\u0433\u0438 \u0434\u043b\u044f \u0420\u041f, \u044f &#8230; \u0441 \u043d\u0443\u043b\u044f \u0434\u0435\u043b\u0430\u043b \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u043a\u043e\u043d\u0442\u0443\u0440 \u0441\u043a\u043b\u0430\u0434\u0441\u043a\u043e\u0433\u043e \u0443\u0447\u0435\u0442\u0430 \u0437\u0430 4 \u043c\u0438\u043d\u0443\u0442\u044b 35 \u0441\u0435\u043a\u0443\u043d\u0434 &#8230;, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0432\u0432\u043e\u0434 \u0432 \u0431\u0430\u0437\u0443 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432.&#187;<\/p>\n<\/blockquote>\n<p>\u0414\u0430\u0436\u0435 \u0441\u043b\u043e\u0436\u043d\u0435\u0439\u0448\u0438\u0435 10+ \u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0435 SQL \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432 1\u0421 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0431\u0435\u0437 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u043e\u043b\u0435\u0439 \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u043c\u0430\u0441\u0442\u0435\u0440\u0435. \u041d\u0435 \u0433\u043e\u0432\u043e\u0440\u044f \u043e\u0431\u043e \u0432\u0441\u0435\u043c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u043c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u043e\u0433\u0434\u0430, \u0432 2015, \u044f \u0431\u044b\u043b \u0433\u043b\u0443\u0431\u043e\u043a\u043e \u0440\u0430\u0437\u043e\u0447\u0430\u0440\u043e\u0432\u0430\u043d Enities \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438, hibernate \u0438 \u043f\u0440\u043e\u0447\u0438\u043c\u0438 \u043f\u0440\u0435\u043b\u0435\u0441\u0442\u044f\u043c\u0438 Java. <\/p>\n<p>\u0418 \u0432\u043e\u0442, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0434\u0436\u0443\u043d\u0438\u043e\u0440 \u0441 1\u0421\u043d\u044b\u043c \u0431\u044d\u043a\u0433\u0440\u0430\u0443\u043d\u0434\u043e\u043c \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u0434\u0430\u0442\u044c\u0441\u044f \u0437\u0430 \u0434\u043b\u0438\u043d\u043d\u044b\u043c \u0440\u0443\u0431\u043b\u0435\u043c \u0432 \u043c\u0438\u0440 Java\/Scala (\u043f\u0441\u0441, \u0435\u0441\u043b\u0438 \u0447\u0442\u043e, \u0443 \u043d\u0430\u0441 \u0432 \u0431\u0430\u043d\u043a\u0435 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0430 \u0432\u0430\u043a\u0430\u043d\u0441\u0438\u0439, \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043b\u0438\u0447\u043a\u0443). <\/p>\n<p>\u041d\u043e \u0435\u0433\u043e \u043c\u043e\u0437\u0433, \u0438\u0437\u0431\u0430\u043b\u043e\u0432\u0430\u043d\u043d\u044b\u0439 1\u0421\u043e\u043c, \u0441\u043e\u043f\u0440\u043e\u0442\u0438\u0432\u043b\u044f\u0435\u0442\u0441\u044f &#8212; \u0435\u0449\u0435 \u0432\u0447\u0435\u0440\u0430 \u0435\u043c\u0443 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043a\u0443\u0447\u0443 \u0434\u0443\u0440\u0430\u0446\u043a\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e \u043d\u0430\u0431\u0438\u0432\u0430\u043d\u0438\u044e Pojo\/Hibernate \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043d\u0430 \u043a\u043b\u0430\u0432\u0435, \u0438 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u0432\u043e\u043b\u043a\u0430 \u043d\u0435 \u043a\u043e\u0440\u043c\u0438 \u0432\u044b\u0441\u043e\u043a\u0438\u043c \u043e\u043a\u043b\u0430\u0434\u043e\u043c, \u043e\u043d \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u0435\u0442\u0441\u044f \u0441\u043b\u0438\u043d\u044f\u0442\u044c \u0432 \u043b\u0435\u0441 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0446\u0430\u0440\u0441\u0442\u0432\u0430 BDSM.<\/p>\n<p>\u042f \u043f\u043e\u043f\u044b\u0442\u0430\u044e\u0441\u044c \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0438 \u0432 \u043c\u0438\u0440\u0435 Java\/Scala \u0435\u0441\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0435 \u0442\u0440\u0435\u0445\u0437\u0432\u0435\u043d\u043d\u044b\u0435 (Bloody Enterprise) \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044f \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0443\u0441\u0438\u043b\u0438\u0439, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0448\u0438\u043a\u0430\u0440\u043d\u044b\u0445 \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u043e\u0432. <\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u0437\u0430\u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u0438\u0440\u0443\u0435\u043c \u0411\u0414. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043b\u044e\u0431\u0443\u044e \u0421\u0423\u0411\u0414 \u0438 \u043b\u044e\u0431\u043e\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440. \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e PostgreSQL \u0438 DBeaver, \u043d\u043e \u0435\u0441\u043b\u0438 \u043b\u0435\u043d\u044c \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0421\u0423\u0411\u0414, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c H2 database. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0430\u043c \u0431\u0430\u0437\u0443, \u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u043e \u0441\u0432\u043e\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435. \u042f \u0441\u043e\u0437\u0434\u0430\u043b \u0442\u0430\u0431\u043b\u0438\u0446\u0443 tasks \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e to-do list \u043f\u0440\u0438\u043c\u0435\u0440\u0430.<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u041a\u0442\u043e \u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0434\u043b\u044f \u043d\u0430\u0441 \u0434\u0443\u0440\u0430\u0446\u043a\u0438\u0435 java Pojo \u043a\u043b\u0430\u0441\u0441\u044b? \u041d\u0438\u043a\u0442\u043e, \u043d\u043e \u0441\u043a\u0430\u043b\u043e\u0432\u0441\u043a\u0438\u0435 case \u043a\u043b\u0430\u0441\u0441\u044b \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 sbt slickCodeGenTask. \u0412\u043e\u0442 \u0447\u0442\u043e \u043e\u043d\u0430 \u043d\u0430\u0442\u0432\u043e\u0440\u0438\u043b\u0430 (\u0445\u043e\u0442\u044f \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u0440\u044f\u0434 \u043b\u0438 \u043e\u043d\u0430 \u043d\u0430\u043a\u043e\u0441\u044f\u0447\u0438\u0442):<\/p>\n<pre><code class=\"scala\">package com.todolist.shared \/\/ AUTO-GENERATED Slick data model \/** Stand-alone Slick data model for immediate use *\/ object Tables extends {   val profile = slick.jdbc.PostgresProfile } with Tables  \/** Slick data model trait for extension, choice of backend or usage in the cake pattern. (Make sure to initialize this late.) *\/ trait Tables {   val profile: slick.jdbc.JdbcProfile   import profile.api._   import slick.model.ForeignKeyAction   \/\/ NOTE: GetResult mappers for plain SQL are only generated for tables where Slick knows how to map the types of all columns.   import slick.jdbc.{GetResult => GR}    \/** DDL for all tables. Call .create to execute. *\/   lazy val schema: profile.SchemaDescription = Tasks.schema   @deprecated(\"Use .schema instead of .ddl\", \"3.0\")   def ddl = schema    \/** Entity class storing rows of table Tasks    *  @param id Database column id SqlType(serial), AutoInc, PrimaryKey    *  @param text Database column text SqlType(varchar)    *  @param done Database column done SqlType(bool) *\/   case class TasksRow(id: Int, text: String, done: Boolean)   \/** GetResult implicit for fetching TasksRow objects using plain SQL queries *\/   implicit def GetResultTasksRow(implicit e0: GR[Int], e1: GR[String], e2: GR[Boolean]): GR[TasksRow] = GR{     prs => import prs._     TasksRow.tupled((&lt;&lt;[Int], &lt;&lt;[String], &lt;&lt;[Boolean]))   }   \/** Table description of table tasks. Objects of this class serve as prototypes for rows in queries. *\/   class Tasks(_tableTag: Tag) extends profile.api.Table[TasksRow](_tableTag, \"tasks\") {     def * = (id, text, done) &lt;> (TasksRow.tupled, TasksRow.unapply)     \/** Maps whole row to an option. Useful for outer joins. *\/     def ? = ((Rep.Some(id), Rep.Some(text), Rep.Some(done))).shaped.&lt;>({r=>import r._; _1.map(_=> TasksRow.tupled((_1.get, _2.get, _3.get)))}, (_:Any) =>  throw new Exception(\"Inserting into ? projection not supported.\"))      \/** Database column id SqlType(serial), AutoInc, PrimaryKey *\/     val id: Rep[Int] = column[Int](\"id\", O.AutoInc, O.PrimaryKey)     \/** Database column text SqlType(varchar) *\/     val text: Rep[String] = column[String](\"text\")     \/** Database column done SqlType(bool) *\/     val done: Rep[Boolean] = column[Boolean](\"done\")   }   \/** Collection-like TableQuery object for table Tasks *\/   lazy val Tasks = new TableQuery(tag => new Tasks(tag)) } <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a IDEA \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0432\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442, \u0432\u0441\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u0442\u044f\u043d\u0443\u043b\u0438\u0441\u044c \u0438\u0437 SQL \u0441\u0445\u0435\u043c\u044b, \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e Ctrl + Space, \u0432 \u0442.\u0447. \u0432 \u043b\u044e\u0431\u043e\u043c \u043b\u044f\u043c\u0431\u0434\u0430-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438 \u0438 for comprehension:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0427\u0442\u043e \u0436\u0435 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u043c \u043b\u0438\u0447\u043d\u043e? \u0412\u0441\u0435\u0433\u043e 2 \u0444\u0430\u0439\u043b\u0430, \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430. \u0414\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a Akka \u0438 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e \u0430\u043a\u0442\u043e\u0440\u043e\u0432. \u041e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e, \u0447\u0442\u043e \u0430\u043a\u0442\u043e\u0440\u044b (\u043a\u043b\u0438\u0435\u043d\u0442 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440) \u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u0440\u0430\u0437\u043d\u044b\u043c \u0430\u043a\u0442\u043e\u0440-\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043e\u043d\u0446\u0430\u0445 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430, \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u044f\u0441\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c TCP, UDP (\u043c\u043e\u0433\u0443\u0442 \u0438 \u043f\u043e HTTP\/HTTPS, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u0430\u0437).   <\/p>\n<p>\u0418\u0442\u0430\u043a, \u043a\u043e\u0434 \u0441\u0435\u0440\u0432\u0435\u0440\u0430:<\/p>\n<pre><code class=\"scala\">package com.todolist   import akka.actor.{Actor, ActorRef, ActorSystem, Props} import com.typesafe.config.ConfigFactory  import java.util.concurrent.Executors import scala.concurrent.ExecutionContext import scala.util.Success  object Server extends App{   val config =ConfigFactory.load(\"application\")   val actorSystem = ActorSystem(\"serversystem\", config)   val server: ActorRef = actorSystem.actorOf(Props[ToDoListServer],\"todolistserver\") } class ToDoListServer extends Actor{   import slick.driver.PostgresDriver.api._   implicit val db = Database.forConfig(\"my.myDb\",Server.config)   implicit val ec = ExecutionContext.fromExecutorService(Executors.newFixedThreadPool(10))    override def receive: Receive = {     case x:String if (x.trim.isEmpty) =>     case x:String =>       val snd = sender()           val arr = x.split(' ')        arr(0) match {         case \"list\" =>           db.run(com.todolist.shared.Tables.Tasks.filter(_.done === false).sortBy(_.id).result)             .onComplete{ e => e match {             case Success(e) =>               val res = e.map(e=>s\"${e.id}. ${e.text}\").mkString(\"\\n\")               println(res)               snd ! res           }}         case \"add\" =>           db.run(com.todolist.shared.Tables.Tasks += com.todolist.shared.Tables.TasksRow(text = arr.drop(1).mkString(\" \"),done = false,id=0))         case \"done\" =>           val arr1 = arr(1).toInt           db.run((for { c &lt;- com.todolist.shared.Tables.Tasks  if c.id === arr1 } yield c.done).update(true))         case _ =>  sender() ! \"Unknown command\"       }   } } <\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e plain SQL &#8212; \u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e, \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0440\u0443\u043a\u0430\u043c\u0438 \u043c\u0430\u043f\u0438\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0411\u0414 \u043d\u0430 case \u043a\u043b\u0430\u0441\u0441\u044b Entities.<\/p>\n<p>\u041a\u043e\u0434 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 (\u0432\u043e\u043e\u0431\u0449\u0435-\u0442\u043e, \u044f \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u0435\u0433\u043e \u0441 \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430, \u043d\u043e \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0432\u043e\u0434 \u0441 \u043a\u043b\u0430\u0432\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u0430\u043a\u0442\u043e\u0440\u0430 \u0433\u043b\u044e\u0447\u0438\u043b, \u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u043e \u0441\u0443\u0442\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c):<\/p>\n<pre><code class=\"scala\">package com.todolist  import akka.actor.{Actor, ActorRef, ActorSystem, Props}  object Client {   case class Connect(server: ActorRef)   case class Process(cmd: String) }  class Client extends Actor {   override def receive: Actor.Receive = {     case Client.Connect(server) =>       context become process(server)   }   def process(server: ActorRef): Receive = {     case Client.Process(cmd) =>       server ! cmd     case x:String =>       println(s\"$x\")     case _ =>   } }  object ClientApp extends App {   import com.typesafe.config.ConfigFactory   import scala.concurrent.duration._   val actorSystem = ActorSystem(\"client-system\", ConfigFactory.load(\"client\"))   val client: ActorRef = actorSystem.actorOf(Props[Client])   val serverPath = \"akka:\/\/serversystem@127.0.0.1:2552\/user\/todolistserver\"   val serverSelection = actorSystem.actorSelection(serverPath)   serverSelection.resolveOne(FiniteDuration(10, SECONDS)).foreach { (server: ActorRef) =>     println(s\"Connected to $server\")     client ! Client.Connect(server)     while (true){       println(\"Enter command:\")       scala.io.StdIn.readLine() match {         case cmd => client ! Client.Process(cmd)       }     }   } (actorSystem.dispatcher) } <\/code><\/pre>\n<p>\u0410\u043a\u0442\u043e\u0440-\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u044b \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0445\u043e\u0441\u0442\u0435, \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u0438\u0441\u0435\u0442\u044c \u043d\u0435 \u043e\u0434\u043d\u043e\u043c \u0438 \u0442\u043e\u043c \u0436\u0435 \u043f\u043e\u0440\u0442\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 application.conf, client.conf. \u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e, \u0434\u043b\u044f sbt \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0432\u044b\u0440\u0443\u0431\u0438\u0442\u044c jmx, \u0442\u0430\u043c \u0442\u043e\u0436\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442 \u043f\u043e\u0440\u0442\u043e\u0432 (\u043b\u0438\u0431\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0440\u0430\u0437\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0438 \u0434\u043b\u044f sbt \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430).<\/p>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430, \u0432 \u043e\u0434\u043d\u043e\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c: <\/p>\n<p>sbt &#171;runMain com.todolist.Server&#187;<\/p>\n<p>\u0412 \u0434\u0440\u0443\u0433\u043e\u043c:<\/p>\n<p>sbt &#171;runMain com.todolist.ClientApp&#187;<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430:<\/p>\n<blockquote>\n<p>Enter command: list <\/p>\n<p>5. task2 <\/p>\n<p>7. task3 <\/p>\n<p>9. task5 <\/p>\n<p>Enter command: add task6 <\/p>\n<p>Enter command: list <\/p>\n<p>5. task2 <\/p>\n<p>7. task3 <\/p>\n<p>9. task5 <\/p>\n<p>10. task6 <\/p>\n<p>Enter command: done 9 <\/p>\n<p>Enter command: list <\/p>\n<p>5. task2 <\/p>\n<p>7. task3 <\/p>\n<p>10. task6<\/p>\n<\/blockquote>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c, \u043d\u0435 \u043f\u043e\u0431\u043e\u044e\u0441\u044c \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430, \u0442\u0440\u0435\u0445\u0437\u0432\u0435\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u044f \u043b\u0438\u0447\u043d\u043e \u0437\u0430\u043a\u043e\u0434\u0438\u043b \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 80 \u0441\u0442\u0440\u043e\u043a; \u043f\u0440\u0438 \u044d\u0442\u043e\u043c, \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0445\u0435\u043c\u044b \u0411\u0414 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u0435 \u0435\u0435 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, IDEA \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0430 \u043c\u043d\u0435, \u043a\u0430\u043a\u0438\u0435 \u043f\u043e\u043b\u044f \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u0443 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439, \u0438 \u043d\u0435 \u043d\u0430\u043b\u0435\u043f\u0438\u043b \u043b\u0438  \u044f \u043e\u0448\u0438\u0431\u043e\u043a. \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u044d\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 1\u0421:\u041f\u0440\u0435\u0434\u043f\u0440\u0438\u044f\u0442\u0438\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0438 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 plain SQL \u044f \u043d\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043b. \u041d\u043e, \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 1\u0421 \u043c\u043e\u0436\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e select`\u044b, \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e &#8212; \u0430 \u0442\u0443\u0442, \u043a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0438 Insert, \u0438 Update. <\/p>\n<p>\u0410 \u0432\u043e\u043e\u0431\u0449\u0435-\u0442\u043e, \u0432 \u0442\u0430\u043a\u043e\u043c \u0436\u0435 \u0441\u0442\u0438\u043b\u0435, \u043d\u0430 Slick \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043a\u043e\u0434\u0438\u0442\u044c \u043c\u0435\u0433\u0430<\/p>\n<\/div>\n<\/div>\n<\/div>\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-414438","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/414438","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=414438"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/414438\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=414438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=414438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=414438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}