{"id":324170,"date":"2021-06-01T21:00:18","date_gmt":"2021-06-01T21:00:18","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=324170"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=324170","title":{"rendered":"\u041a\u0430\u043a \u0432\u044b\u0431\u0440\u0430\u0442\u044c 1 \u043c\u043b\u043d. \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0438\u0437 \u0431\u0434, \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 Excel \u0438 \u043d\u0435 \u0443\u043f\u0430\u0441\u0442\u044c \u0441 OutOfMemoryError"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u0421\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u043c\u043d\u0435 \u0431\u044b\u043b\u0430 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430, \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u043e\u0439, \u043d\u043e \u043e\u0447\u0435\u043d\u044c \u0435\u043c\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u2013 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0431\u044a\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0431\u0430\u0437\u044b, \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432\u0441\u0435 \u044d\u0442\u043e \u0432 Excel \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u0443. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u043e\u0438\u0441\u043a\u0430 \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0431\u044b\u043b\u043e \u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432, \u0440\u0435\u0448\u0435\u043d\u044b \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0432\u0430\u043c\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438 \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0438 \u044d\u0442\u0430\u043f\u0430\u043c\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<h3>1. \u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h3>\n<p>\u0412 \u0441\u0432\u044f\u0437\u0438 \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u0440\u0430\u0437\u0433\u043b\u0430\u0448\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0422\u0417, \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0442. \u0434. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0435:<\/p>\n<p>\u0418\u0442\u0430\u043a \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043e\u043d\u043b\u0430\u0439\u043d \u0447\u0430\u0442 \u0441 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c\u044e, \u0438 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a \u0445\u043e\u0447\u0435\u0442 \u0432\u044b\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0432\u0441\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043e\u0431\u043e\u0433\u0430\u0449\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435, \u0437\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0434\u0430\u0442\u0443 \u0432 Excel. \u0412 \u0434\u0435\u043d\u044c \u043c\u043e\u0436\u0435\u0442 \u043a\u043e\u043f\u0438\u0442\u044c\u0441\u044f \u0431\u043e\u043b\u0435\u0435 1 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439.<\/p>\n<p>\u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c 3 \u0442\u0430\u0431\u043b\u0438\u0446\u044b:<\/p>\n<ol>\n<li>\n<p>User. \u0425\u0440\u0430\u043d\u0438\u0442 \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0435\u0433\u043e \u043d\u0435\u043a\u0438\u0439 \u0440\u0435\u0439\u0442\u0438\u043d\u0433 (\u043d\u0435 \u0432\u0430\u0436\u043d\u043e \u043e\u0442\u043a\u0443\u0434\u0430 \u043e\u043d \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0438 \u043a\u0430\u043a \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f)<\/p>\n<\/li>\n<li>\n<p>Message. \u0425\u0440\u0430\u043d\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u2013 \u0418\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0414\u0430\u0442\u0443\u0412\u0440\u0435\u043c\u044f, \u0422\u0435\u043a\u0441\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>Task. \u0417\u0430\u0434\u0430\u0447\u0430 \u043d\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u0447\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a. \u0425\u0440\u0430\u043d\u0438\u0442 ID, \u0421\u0442\u0430\u0442\u0443\u0441 \u0437\u0430\u0434\u0430\u0447\u0438 (\u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e \u0438\u043b\u0438 \u043d\u0435\u0442), \u0438 \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430: \u0414\u0430\u0442\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u0430\u0447\u0430\u043b\u043e, \u0414\u0430\u0442\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0435\u0446.<\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u043e\u0441\u0442\u0430\u0432 \u043a\u043e\u043b\u043e\u043d\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d8f\/fb8\/182\/d8ffb818222ce6c5717ffc2fad30a2ca.jpg\" width=\"537\" height=\"336\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 Excel \u0417\u0430\u043a\u0430\u0437\u0447\u0438\u043a \u0445\u043e\u0447\u0435\u0442 \u0432\u0438\u0434\u0435\u0442\u044c 4 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 1) message_date. 2) name. 3) rating. 4) text. \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0441\u0442\u0440\u043e\u043a 1 \u043c\u043b\u043d. \u041d\u0430\u0434\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u044d\u0442\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 excel, \u0430 \u0434\u0430\u043b\u044c\u0448\u0435 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a \u0443\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u044d\u0442\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u0435\u043a\u0441\u0435\u043b\u0435 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<h3>2. \u0417\u0430\u0434\u0430\u0447\u0430 \u043f\u043e\u043d\u044f\u0442\u043d\u0430, \u043d\u0430\u0447\u043d\u0435\u043c \u043f\u043e\u0438\u0441\u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0432\u0441\u0435 \u0441\u0442\u0430\u0440\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0435\u0434\u0438\u043d\u043e\u0433\u043e \u0441\u0442\u0438\u043b\u044f \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0442\u043e \u0438 \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043d\u0430\u0447\u0430\u0442\u044c \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0430\u0445 \u2013 \u044d\u0442\u043e Spring + Hibernate \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0411\u0414. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0411\u0414 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Oracle, \u0445\u043e\u0442\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0421\u0423\u0411\u0414 \u0431\u0443\u0434\u0435\u0442 \u043f\u043b\u044e\u0441 \u043c\u0438\u043d\u0443\u0441 \u043f\u043e\u0445\u043e\u0436\u0438\u043c.<\/p>\n<p>\u0414\u043b\u044f \u0441\u0442\u0430\u0440\u0442\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c <strong>spring-boot-starter-data-jpa<\/strong>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0441\u0440\u0430\u0437\u0443 Spring Data, Hibernate \u0438 JPA, \u0432\u0441\u0435 \u044d\u0442\u043e \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0411\u0414 \u0438 \u043d\u0430\u0448\u0438\u043c\u0438 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044f\u043c\u0438.<\/p>\n<pre><code>        &lt;dependency&gt;             &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;             &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;\/artifactId&gt;             &lt;version&gt;2.4.5&lt;\/version&gt;         &lt;\/dependency&gt;<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043c <strong>spring-boot-starter-test<\/strong><\/p>\n<pre><code>        &lt;dependency&gt;             &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;             &lt;artifactId&gt;spring-boot-starter-test&lt;\/artifactId&gt;             &lt;scope&gt;test&lt;\/scope&gt;         &lt;\/dependency&gt;<\/code><\/pre>\n<p>\u0418 \u0435\u0449\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0441\u0430\u043c \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0411\u0414<\/p>\n<pre><code>        &lt;dependency&gt;             &lt;groupId&gt;com.oracle.database.jdbc&lt;\/groupId&gt;             &lt;artifactId&gt;ojdbc10&lt;\/artifactId&gt;             &lt;version&gt;19.10.0.0&lt;\/version&gt;         &lt;\/dependency&gt;<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u0423 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 TASK, \u0438\u0441\u043a\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u0432 \u0441\u0442\u0430\u0442\u0443\u0441\u0435 \u201cCREATED\u201d \u0438, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043e\u0442\u0447\u0435\u0442\u0430 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043e\u0442\u0447\u0435\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u043b\u0433\u043e\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0448 \u043c\u0435\u0442\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0432 \u0434\u0432\u0430 \u043f\u043e\u0442\u043e\u043a\u0430 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438. \u0422\u0430\u043a \u0436\u0435 \u0434\u043b\u044f Spring Data \u0443\u043a\u0430\u0436\u0435\u043c \u043d\u0430\u0448 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439. \u041a\u043b\u0430\u0441\u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code>package com.report.generator.demo.config;  import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import org.springframework.scheduling.TaskScheduler; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;  @Configuration @EnableScheduling @EnableAsync @EnableJpaRepositories(basePackages = \"com.report.generator.demo.repository\") @PropertySource({\"classpath:application.properties\"}) @ConditionalOnProperty(     value = \"app.scheduling.enable\", havingValue = \"true\", matchIfMissing = true ) public class DemoConfig {     private static final int CORE_POOL_SIZE = 2;      @Bean(name = \"taskScheduler\")     public TaskScheduler getTaskScheduler() {         ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();         scheduler.setPoolSize(CORE_POOL_SIZE);         scheduler.initialize();         return scheduler;     } } <\/code><\/pre>\n<p>\u041a\u043b\u0430\u0441\u0441 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0442\u0447\u0435\u0442\u043e\u0432 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 <strong>@Scheduled<\/strong> \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0437 \u0432 \u043c\u0438\u043d\u0443\u0442\u0443 \u0438\u0449\u0435\u0442 Task \u0438, \u0435\u0441\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442, \u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043e\u0442\u0447\u0435\u0442\u0430 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0438\u0437 \u044d\u0442\u043e\u0439 \u0442\u0430\u0441\u043a\u0438.<\/p>\n<pre><code>    @Async(\"taskScheduler\")     @Scheduled(fixedDelay = 60000)     public void scheduledTask() {         log.info(\"scheduledTask is started\");         Task task = getTask();         if (Objects.isNull(task)) {             log.info(\"task not found\");             return;         }         log.info(\"task found\");         generate(task);     }<\/code><\/pre>\n<p>\u041a\u043b\u0430\u0441\u0441 \u0441\u0442\u0430\u0440\u0442\u0435\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e, \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 <a href=\"https:\/\/github.com\/EVG-A\/report-generator\" rel=\"noopener noreferrer nofollow\">GitHub<\/a>.<\/p>\n<h3>3. \u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0411\u0414<\/h3>\n<p>\u0422.\u043a. \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u043f\u043e\u0432\u0441\u0435\u043c\u0435\u0441\u0442\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Hibernate \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e. \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e entity MessageData \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u043f\u043e\u043b\u0435\u0439 (id, name, rating, messageDate, test). \u041f\u0435\u0440\u0432\u043e\u0439 \u043f\u043e\u043f\u044b\u0442\u043a\u043e\u0439 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u044b\u043b\u0430 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0432 \u043b\u043e\u0431 \u2013 \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432\u0441\u0435 \u0432 List&lt;Message&gt; \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430:<\/p>\n<pre><code>List&lt;Message&gt; findAllByMessageDateBetween(Instant dateFrom, Instant dateTo);<\/code><\/pre>\n<p>\u0410 \u0434\u0430\u043b\u044c\u0448\u0435 \u0443\u0436\u0435 \u0432 \u0446\u0438\u043a\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b MessageData \u0438 \u043e\u0431\u043e\u0433\u0430\u0449\u0430\u0442\u044c \u0438\u0445 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u044e\u0449\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0411\u044b\u043b\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0434\u0445\u043e\u0434 \u0432 \u043a\u043e\u0440\u043d\u0435 \u043d\u0435 \u0432\u0435\u0440\u043d\u044b\u0439 \u0438 \u0432\u044b\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043c\u0438\u043b\u043b\u0438\u043e\u043d \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 List \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e. \u041d\u043e \u0434\u043b\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u0438 \u0437\u0430\u043c\u0435\u0440\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0442\u043e\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u043c\u0438. \u041d\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432\u044b\u0433\u0440\u0443\u0436\u0430\u043b\u0441\u044f \u043e\u043a\u043e\u043b\u043e 30 \u043c\u0438\u043d\u0443\u0442 \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043e <strong>OutOfMemoryError <\/strong>\u0438 \u043d\u0430 \u044d\u0442\u043e\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0441\u044f.<\/p>\n<p>\u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0434\u0430\u043b \u0443\u0437\u043a\u0438\u0435 \u0440\u0430\u043c\u043a\u0438 \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u0438 \u043d\u0430\u043c \u0431\u044b \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u0432 \u043e\u0434\u0438\u043d List, \u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435 \u043c\u044b \u0431\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u2013 \u0434\u043b\u044f \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043a\u043e\u043b\u043e\u043d\u043e\u043a \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c id \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0438\u0434\u0442\u0438 \u0441\u043d\u043e\u0432\u0430 \u0432 \u0431\u0430\u0437\u0443, \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438\u0445 \u0438\u043c\u0435\u043d\u0430 \u0438 \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0438, \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0443\u0436\u0435 \u0441 \u043f\u043e\u043b\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0432\u044b\u0440\u0430\u0441\u0442\u0430\u043b\u0430 \u0432 \u0440\u0430\u0437\u044b. \u0411\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u043e \u0447\u0430\u0441\u0442\u044f\u043c \u0438 \u043f\u0435\u0440\u0435\u043b\u043e\u0436\u0438\u0442\u044c \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0431\u0434. \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u0440\u0430\u0437\u043e\u043c \u0438, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0433\u043e\u0440\u043e\u0434\u0438\u0442\u044c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u043e\u0432, \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>ScrollableResults<\/strong>. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043a\u0443\u0440\u0441\u043e\u0440 \u0438 \u0438\u0442\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u0448\u0430\u0433\u043e\u043c. \u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u043b \u0441\u0440\u0430\u0437\u0443 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0443\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0445 \u0434\u0436\u043e\u0439\u043d\u043e\u0432, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439, \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043e\u043a \u0438 \u0442. \u0434.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u2013 \u0433\u0434\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u0430\u043c \u0442\u0435\u043a\u0441\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u042d\u0442\u043e \u0431\u044b\u043b \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0442.\u043a. \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u0430\u0431\u043b\u0438\u0446, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u0431\u044b\u043b\u043e \u043e\u043a\u043e\u043b\u043e \u0434\u0435\u0441\u044f\u0442\u0438, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u0436\u043e\u0439\u043d\u043e\u0432 \u0438 \u0432\u0441\u044f\u0447\u0435\u0441\u043a\u0438\u0445 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043e\u043a \u0431\u044b\u043b\u043e \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u043c, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0447\u0435\u0433\u043e \u0442\u0435\u043a\u0441\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432\u044b\u0448\u0435\u043b \u043d\u0430 200+ \u0441\u0442\u0440\u043e\u043a \u043f\u043e\u0441\u043b\u0435 \u0440\u0435\u0432\u044c\u044e \u0432\u0441\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043a\u043e\u043b\u043b\u0435\u0433 \u0438 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0438 \u0441\u0430\u043c\u0438\u043c \u0442\u0435\u0445 \u043b\u0438\u0434\u043e\u043c. \u0425\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 java \u043a\u043e\u0434\u0435 \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c, \u043f\u043b\u044e\u0441 \u0432 \u043d\u0435\u043c \u0431\u044b\u043b\u0438 \u0437\u0430\u0445\u0430\u0440\u0434\u043a\u043e\u0436\u0435\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u0438 \u0441\u0432\u0435\u0442\u0438\u0442\u044c \u0438\u043c\u0438 \u0432 \u043e\u0431\u0449\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u043c\u043d\u0435 \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0448\u043b\u0430 \u0438\u0434\u0435\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/oracleplsql.ru\/view.html\" rel=\"noopener noreferrer nofollow\">view<\/a>. \u0412\u0435\u0441\u044c \u0442\u0435\u043a\u0441\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0442\u0443\u0434\u0430 \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0441\u044f, \u043f\u043b\u044e\u0441 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c hibernate \u043a\u0430\u043a \u0441 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 entity.<\/p>\n<p>\u041f\u043e \u043d\u0430\u0447\u0430\u043b\u0443 \u0432\u0441\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0432\u044b\u0431\u043e\u0440\u043a\u0443 1 \u043c\u043b\u043d \u0442\u0430\u043a\u0438\u0445 \u0441\u0442\u0440\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0441\u044f \u0437\u0430 \u0440\u0430\u0437\u0443\u043c\u043d\u044b\u0435 10 \u043c\u0438\u043d. \u0438\u043b\u0438 \u043e\u043a\u043e\u043b\u043e \u0442\u043e\u0433\u043e. \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b, \u043d\u043e \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430 \u044d\u0442\u043e \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043b\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0441\u044f \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u0439 \u043c\u0438\u043d\u0443\u0441 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u2013 \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c 1 \u043c\u043b\u043d \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f 10 \u043c\u0438\u043d\u0443\u0442, \u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043e\u0442\u0447\u0435\u0442 \u043f\u043e \u043a\u043e\u0440\u043e\u0447\u0435 \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0434\u0430\u0442\u044b \u043f\u043e\u0443\u0436\u0435 \u2013 \u0443 \u043d\u0430\u0441 \u0437\u0430\u043f\u0440\u043e\u0441 \u0442\u0430\u043a \u0436\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f 10 \u043c\u0438\u043d\u0443\u0442, \u043d\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0445\u043e\u0442\u044c 1 \u0437\u0430\u043f\u0438\u0441\u044c, \u0445\u043e\u0442\u044c \u043c\u0438\u043b\u043b\u0438\u043e\u043d. \u0421\u0443\u0442\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u0430 <a href=\"https:\/\/oracleplsql.ru\/view.html\" rel=\"noopener noreferrer nofollow\">view <\/a>\u043d\u0435\u043b\u044c\u0437\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u0443\u0436\u0435 \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0430\u043b\u043e\u0436\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0432\u0430\u0436\u043d\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0443\u0434\u0435\u0442 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0441\u0442\u0440\u043e\u043a, \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u043d\u043e \u0432\u0441\u0435, \u0447\u0442\u043e \u043d\u0430\u0439\u0434\u0435\u0442\u0441\u044f \u0432 \u0431\u0434, \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u044b \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u0417\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0443 \u0431\u044b\u043b\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e, \u0435\u0433\u043e \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043b\u043e \u0438 \u0442\u043e, \u0447\u0442\u043e \u043e\u0442\u0447\u0435\u0442 \u0441 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430 \u0442\u0430\u043a\u043e\u0435 \u0436\u0435 \u0432\u0440\u0435\u043c\u044f, \u0447\u0442\u043e \u0438 \u043e\u0442\u0447\u0435\u0442 \u0441 1 \u043c\u043b\u043d \u0441\u0442\u0440\u043e\u043a. \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u0438\u0437\u043b\u0438\u0448\u043d\u0435 \u043d\u0430\u0433\u0440\u0443\u0436\u0430\u043b\u043e \u0431\u0434 \u0438 \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430.<\/p>\n<p>\u041e\u0441\u0442\u0430\u0432\u0430\u043b\u0441\u044f \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u0438\u043d \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u043b \u2013 \u044d\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u043c\u0430\u044f \u0432 \u0431\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u044f. \u0412 \u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043a\u0443\u0440\u0441\u043e\u0440 \u0438 \u0435\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u043c\u0430\u043f\u043f\u0438\u0442\u044c \u043d\u0430 \u043d\u0430\u0448\u0443 entity. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0431\u044b\u043b\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u043b\u0430 \u043d\u0430 \u0432\u0445\u043e\u0434 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u043b\u0430 <strong>sys_refcursor<\/strong>, \u0432\u0435\u0441\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043d\u044f\u043b \u043e\u043a\u043e\u043b\u043e 300 \u0441\u0442\u0440\u043e\u043a \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0430 \u0432 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u0437\u0434\u0435\u0441\u044c \u043e\u043d\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code>create function message_ref(     date_from timestamp,     date_to timestamp ) return sys_refcursor as     ret_cursor sys_refcursor; begin     open ret_cursor for         select m.id,                u.name,                u.rating,                m.message_date,                m.text         from message m                  left join users u on m.user_id = u.id         where m.message_date between date_from and date_to;     return ret_cursor; end message_ref;<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a\u0430\u043a \u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c? \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 <strong>@NamedNativeQuery<\/strong>. \u0417\u0430\u043f\u0440\u043e\u0441 \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: &#171;{ ? = call message_ref(?, ?) }&#187;, <strong>callable<\/strong> = true \u0434\u0430\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, <strong>cacheMode<\/strong> = CacheModeType.IGNORE \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u044d\u0448, \u0442. \u043a. \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u043c \u043d\u0435 \u0442\u0430\u043a \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u0430, \u043a\u0430\u043a \u0437\u0430\u0442\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c, \u043d\u0443 \u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 <strong>resultClass<\/strong> = MessageData.class \u0434\u043b\u044f \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043d\u0430 \u043d\u0430\u0448\u0443 entity. \u041a\u043b\u0430\u0441\u0441 MessageData \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code>package com.report.generator.demo.repository.entity;  import lombok.Data; import org.hibernate.annotations.CacheModeType; import org.hibernate.annotations.NamedNativeQuery;  import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import java.io.Serializable; import java.time.Instant;  import static com.report.generator.demo.repository.entity.MessageData.MESSAGE_REF_QUERY_NAME;  @Data @Entity @NamedNativeQuery(     name = MESSAGE_REF_QUERY_NAME,     query = \"{ ? = call message_ref(?, ?) }\",     callable = true,     cacheMode = CacheModeType.IGNORE,     resultClass = MessageData.class ) public class MessageData implements Serializable {      public static final String MESSAGE_REF_QUERY_NAME = \"MessageData.callMessageRef\";      private static final long serialVersionUID = -6780765638993961105L;      @Id     private long id;      @Column     private String name;      @Column     private int rating;      @Column(name = \"MESSAGE_DATE\")     private Instant messageDate;      @Column     private String text; }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u044d\u0448 \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 <strong>StatelessSession<\/strong>. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u0442\u044c \u0432\u0430\u0436\u043d\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c: \u0435\u0441\u043b\u0438 \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0432\u044b\u0437\u0432\u0430\u0442\u044c namedQuery \u0442\u043e hibernate \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c CacheMode \u0432\u044b\u0434\u0430\u0441\u0442 <strong>UnsupportedOperationException<\/strong>. \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0434\u0432\u0430 \u0445\u0438\u043d\u0442\u0430:<\/p>\n<pre><code>            query.setHint(JPA_SHARED_CACHE_STORE_MODE, null);             query.setHint(JPA_SHARED_CACHE_RETRIEVE_MODE, null);<\/code><\/pre>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043d\u0430\u0448 \u043c\u0435\u0442\u043e\u0434 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u043c\u0435\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434:<\/p>\n<pre><code> @Transactional     void generate(Task task) {         log.info(\"generating report is started\");         try (             StatelessSession statelessSession = sessionFactory.openStatelessSession()         ) {             ReportExcelStreamWriter writer = new ReportExcelStreamWriter();             Query&lt;MessageData&gt; query = statelessSession.createNamedQuery(MESSAGE_REF_QUERY_NAME, MessageData.class);             query.setParameter(1, task.getDateFrom());             query.setParameter(2, task.getDateTo());             query.setHint(JPA_SHARED_CACHE_STORE_MODE, null);             query.setHint(JPA_SHARED_CACHE_RETRIEVE_MODE, null);             ScrollableResults results = query.scroll(ScrollMode.FORWARD_ONLY);             int index = 0;             while (results.next()) {                 index++;                 writer.createRow(index, (MessageData) results.get(0));                 if (index % 100000 == 0) {                     log.info(\"progress {} rows\", index);                 }             }             writer.writeWorkbook();             task.setStatus(DONE.toString());             log.info(\"task {} complete\", task);         } catch (Exception e) {             task.setStatus(FAIL.toString());             e.printStackTrace();             log.error(\"an error occurred with message {}. While executing the task {}\", e.getMessage(), task);         } finally {             taskRepository.save(task);         }     }<\/code><\/pre>\n<h3>4. \u0417\u0430\u043f\u0438\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Excel<\/h3>\n<p>\u041d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0432\u043e\u043f\u0440\u043e\u0441 \u0441 \u0432\u044b\u0431\u043e\u0440\u043a\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0411\u0414 \u0431\u044b\u043b \u0440\u0435\u0448\u0435\u043d \u0438 \u0432\u043e\u0437\u043d\u0438\u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u2013 \u043a\u0430\u043a \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0435 \u044d\u0442\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0432 excel \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043d\u0435 \u0437\u0430\u0442\u0440\u0430\u0442\u043d\u043e \u043f\u043e \u043f\u0430\u043c\u044f\u0442\u0438. \u041f\u0435\u0440\u0432\u0430\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0431\u044b\u043b\u0430 \u0441\u0430\u043c\u043e\u0439 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0439 \u2013 \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <strong>org.apache.poi<\/strong>. \u0422\u0443\u0442 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e: \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c<\/p>\n<pre><code>        &lt;dependency&gt;             &lt;groupId&gt;org.apache.poi&lt;\/groupId&gt;             &lt;artifactId&gt;poi-ooxml&lt;\/artifactId&gt;             &lt;version&gt;5.0.0&lt;\/version&gt;         &lt;\/dependency&gt;<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c <strong>XSSFWorkbook<\/strong> \u0434\u0430\u043b\u0435\u0435 <strong>XSSFSheet<\/strong>, \u0438\u0437 \u043d\u0435\u0433\u043e \u0443\u0436\u0435 row \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u041d\u0438\u0447\u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e, \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0438\u0436\u0435:<\/p>\n<pre><code>package com.report.generator.demo.service;  import com.report.generator.demo.repository.entity.MessageData; import org.apache.poi.xssf.usermodel.XSSFCell; import org.apache.poi.xssf.usermodel.XSSFRow; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook;  import java.io.FileOutputStream; import java.io.IOException; import java.time.Instant;  public class ReportExcelWriter {      private final XSSFWorkbook wb;     private final XSSFSheet sheet;      public ReportExcelWriter() {         this.wb = new XSSFWorkbook();         this.sheet = wb.createSheet();         createTitle();     }      public void createRow(int index, MessageData data) {         XSSFRow row = sheet.createRow(index);         setCellValue(row.createCell(0), data.getMessageDate());         setCellValue(row.createCell(1), data.getName());         setCellValue(row.createCell(2), data.getRating());         setCellValue(row.createCell(3), data.getText());     }      public void writeWorkbook() throws IOException {         FileOutputStream fileOut = new FileOutputStream(Instant.now().getEpochSecond() + \".xlsx\");         wb.write(fileOut);         fileOut.close();     }      private void createTitle() {         XSSFRow rowTitle = sheet.createRow(0);         setCellValue(rowTitle.createCell(0), \"Date\");         setCellValue(rowTitle.createCell(1), \"Name\");         setCellValue(rowTitle.createCell(2), \"Rating\");         setCellValue(rowTitle.createCell(3), \"Text\");     }      private void setCellValue(XSSFCell cell, String value) {         cell.setCellValue(value);     }      private void setCellValue(XSSFCell cell, long value) {         cell.setCellValue(value);     }      private void setCellValue(XSSFCell cell, Instant value) {         cell.setCellValue(value.toString());     } } <\/code><\/pre>\n<p>\u041d\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c. \u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 3 \u043c\u0438\u043d\u0443\u0442\u044b \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043d\u0430 \u0432\u044b\u0431\u043e\u0440\u043a\u0443 1 \u043c\u043b\u043d \u0441\u0442\u0440\u043e\u043a \u0438\u0437 \u0431\u0434 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u0438\u0445 \u0432 excel. \u0418 \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b \u043a <strong>OutOfMemoryError<\/strong>. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6e0\/ce8\/a44\/6e0ce8a4484bc8623ebde84f51a4e7b8.jpg\" width=\"1444\" height=\"542\"><figcaption><\/figcaption><\/figure>\n<p>\u0410 \u043a\u043e\u0433\u0434\u0430 \u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b \u0435\u0433\u043e \u043d\u0430 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u043a\u0435 \u0441 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0432 2Gb, \u0442\u043e \u043f\u0430\u0434\u0430\u043b \u043e\u043d \u0441 <strong>OutOfMemoryError<\/strong> \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043d\u0430 <strong>30%<\/strong> \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430.<\/p>\n<p>\u0413\u0440\u0443\u0437\u0438\u0442\u044c \u0432\u0435\u0441\u044c \u043c\u0438\u043b\u043b\u0438\u043e\u043d \u0441\u0442\u0440\u043e\u043a \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u0432 excel \u0431\u044b\u043b\u043e \u0442\u0430\u043a \u0436\u0435 \u043f\u043b\u043e\u0445\u043e\u0439 \u0438\u0434\u0435\u0435\u0439, \u043a\u0430\u043a \u0438 \u0432\u044b\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 List, \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0437\u0434\u0435\u0441\u044c \u043d\u0430\u0434\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043a\u0438\u0439 stream, \u043d\u043e \u0445\u043e\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0433\u043e\u0434\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 google \u0442\u043e\u0433\u0434\u0430 \u043c\u043d\u0435 \u043d\u0435 \u0434\u0430\u043b. \u0411\u044b\u043b\u0430 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0435 \u043f\u043e\u0434\u043e\u0431\u0438\u0435 I\/O Stream \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 excel, \u043d\u043e \u043c\u044b\u0441\u043b\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u044f \u043f\u0438\u0448\u0443 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 \u043d\u0435 \u0434\u0430\u0432\u0430\u043b\u0430 \u043c\u043d\u0435 \u043f\u043e\u043a\u043e\u044f. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u044f \u0441\u0442\u0430\u043b \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <strong>org.apache.poi<\/strong> \u043f\u0440\u0438\u0441\u0442\u0430\u043b\u044c\u043d\u0435\u0439 \u0438 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0442\u0430\u043c \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043f\u0430\u043a\u0435\u0442 <a href=\"http:\/\/poi.apache.org\/components\/spreadsheet\/how-to.html#sxssf\" rel=\"noopener noreferrer nofollow\">streaming<\/a>. \u0412 \u044d\u0442\u043e\u043c \u043f\u0430\u043a\u0435\u0442\u0435 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0432\u0435\u0441\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043e\u0431\u044a\u0435\u043c\u043e\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 excel. \u041e\u0441\u0442\u0430\u0432\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043d\u0430 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 <a href=\"http:\/\/poi.apache.org\/components\/spreadsheet\/how-to.html#sxssf\" rel=\"noopener noreferrer nofollow\">streaming <\/a>\u0438 \u0432\u0441\u0435:<\/p>\n<pre><code>package com.report.generator.demo.service;  import com.report.generator.demo.repository.entity.MessageData; import org.apache.poi.xssf.streaming.SXSSFCell; import org.apache.poi.xssf.streaming.SXSSFRow; import org.apache.poi.xssf.streaming.SXSSFSheet; import org.apache.poi.xssf.streaming.SXSSFWorkbook;  import java.io.FileOutputStream; import java.io.IOException; import java.time.Instant;  public class ReportExcelStreamWriter {      private final SXSSFWorkbook wb;     private final SXSSFSheet sheet;      public ReportExcelStreamWriter() {         this.wb = new SXSSFWorkbook();         this.sheet = wb.createSheet();         createTitle();     }      public void createRow(int index, MessageData data) {         SXSSFRow row = sheet.createRow(index);         setCellValue(row.createCell(0), data.getMessageDate());         setCellValue(row.createCell(1), data.getName());         setCellValue(row.createCell(2), data.getRating());         setCellValue(row.createCell(3), data.getText());     }      public void writeWorkbook() throws IOException {         FileOutputStream fileOut = new FileOutputStream(Instant.now().getEpochSecond() + \".xlsx\");         wb.write(fileOut);         fileOut.close();     }      private void createTitle() {         SXSSFRow rowTitle = sheet.createRow(0);         setCellValue(rowTitle.createCell(0), \"Date\");         setCellValue(rowTitle.createCell(1), \"Name\");         setCellValue(rowTitle.createCell(2), \"Rating\");         setCellValue(rowTitle.createCell(3), \"Text\");     }      private void setCellValue(SXSSFCell cell, String value) {         cell.setCellValue(value);     }      private void setCellValue(SXSSFCell cell, long value) {         cell.setCellValue(value);     }      private void setCellValue(SXSSFCell cell, Instant value) {         cell.setCellValue(value.toString());     } } <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0440\u0430\u0432\u043d\u0438\u043c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8bd\/a79\/0cb\/8bda790cb3e54b63099dcfb8a4dcb8b2.jpg\" width=\"1377\" height=\"380\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0441\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0437\u0430\u043d\u044f\u043b\u0430 \u043f\u043e\u043b \u043c\u0438\u043d\u0443\u0442\u044b \u0438, \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u043d\u0438\u043a\u0430\u043a\u0438\u0445 <strong>OutOfMemoryError<\/strong>.<\/p>\n<h3>5. \u0418\u0442\u043e\u0433<\/h3>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0437\u0430 \u0441\u0447\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0445\u0440\u0430\u043d\u0438\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, StatelessSession, ScrollableResults \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 org.apache.poi \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 <a href=\"http:\/\/poi.apache.org\/components\/spreadsheet\/how-to.html#sxssf\" rel=\"noopener noreferrer nofollow\">streaming<\/a>. \u041f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0435\u0449\u0435, \u0435\u0441\u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0435 \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c jdbc, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b, \u043a\u0430\u043a, \u0447\u0442\u043e \u0438 \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c. \u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u0443\u0441\u043b\u044b\u0448\u0430\u0442\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043e\u0442 \u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u044b\u0442\u043d\u044b\u0445 \u0432 \u044d\u0442\u043e\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0442\u043e\u0432. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0435 \u0443\u0447\u0442\u0435\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 1 \u043c\u043b\u043d. \u0441\u0442\u0440\u043e\u043a, \u0442. \u043a. \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0444\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u0430. \u0414\u043b\u044f \u043d\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0411\u0414 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 DemoApplicationTests. \u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u043d\u0430 <a href=\"https:\/\/github.com\/EVG-A\/report-generator\" rel=\"noopener noreferrer nofollow\">GitHub<\/a>.<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/560520\/\"> https:\/\/habr.com\/ru\/post\/560520\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u0421\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u043c\u043d\u0435 \u0431\u044b\u043b\u0430 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430, \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u043e\u0439, \u043d\u043e \u043e\u0447\u0435\u043d\u044c \u0435\u043c\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u2013 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0431\u044a\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0431\u0430\u0437\u044b, \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432\u0441\u0435 \u044d\u0442\u043e \u0432 Excel \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u0443. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043f\u043e\u0438\u0441\u043a\u0430 \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0431\u044b\u043b\u043e \u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432, \u0440\u0435\u0448\u0435\u043d\u044b \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0432\u0430\u043c\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438 \u043c\u043e\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0438 \u044d\u0442\u0430\u043f\u0430\u043c\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<h3>1. \u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h3>\n<p>\u0412 \u0441\u0432\u044f\u0437\u0438 \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u0440\u0430\u0437\u0433\u043b\u0430\u0448\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0422\u0417, \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438, \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0441\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0442. \u0434. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0435:<\/p>\n<p>\u0418\u0442\u0430\u043a \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043e\u043d\u043b\u0430\u0439\u043d \u0447\u0430\u0442 \u0441 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c\u044e, \u0438 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a \u0445\u043e\u0447\u0435\u0442 \u0432\u044b\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0432\u0441\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043e\u0431\u043e\u0433\u0430\u0449\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435, \u0437\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0434\u0430\u0442\u0443 \u0432 Excel. \u0412 \u0434\u0435\u043d\u044c \u043c\u043e\u0436\u0435\u0442 \u043a\u043e\u043f\u0438\u0442\u044c\u0441\u044f \u0431\u043e\u043b\u0435\u0435 1 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439.<\/p>\n<p>\u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c 3 \u0442\u0430\u0431\u043b\u0438\u0446\u044b:<\/p>\n<ol>\n<li>\n<p>User. \u0425\u0440\u0430\u043d\u0438\u0442 \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0435\u0433\u043e \u043d\u0435\u043a\u0438\u0439 \u0440\u0435\u0439\u0442\u0438\u043d\u0433 (\u043d\u0435 \u0432\u0430\u0436\u043d\u043e \u043e\u0442\u043a\u0443\u0434\u0430 \u043e\u043d \u0431\u0435\u0440\u0435\u0442\u0441\u044f \u0438 \u043a\u0430\u043a \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f)<\/p>\n<\/li>\n<li>\n<p>Message. \u0425\u0440\u0430\u043d\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438 \u2013 \u0418\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0414\u0430\u0442\u0443\u0412\u0440\u0435\u043c\u044f, \u0422\u0435\u043a\u0441\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>Task. \u0417\u0430\u0434\u0430\u0447\u0430 \u043d\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u0447\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a. \u0425\u0440\u0430\u043d\u0438\u0442 ID, \u0421\u0442\u0430\u0442\u0443\u0441 \u0437\u0430\u0434\u0430\u0447\u0438 (\u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043e \u0438\u043b\u0438 \u043d\u0435\u0442), \u0438 \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430: \u0414\u0430\u0442\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u0430\u0447\u0430\u043b\u043e, \u0414\u0430\u0442\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0435\u0446.<\/p>\n<\/li>\n<\/ol>\n<p>\u0421\u043e\u0441\u0442\u0430\u0432 \u043a\u043e\u043b\u043e\u043d\u043e\u043a \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 Excel \u0417\u0430\u043a\u0430\u0437\u0447\u0438\u043a \u0445\u043e\u0447\u0435\u0442 \u0432\u0438\u0434\u0435\u0442\u044c 4 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 1) message_date. 2) name. 3) rating. 4) text. \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0441\u0442\u0440\u043e\u043a 1 \u043c\u043b\u043d. \u041d\u0430\u0434\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u044d\u0442\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 excel, \u0430 \u0434\u0430\u043b\u044c\u0448\u0435 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a \u0443\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u044d\u0442\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u0435\u043a\u0441\u0435\u043b\u0435 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<h3>2. \u0417\u0430\u0434\u0430\u0447\u0430 \u043f\u043e\u043d\u044f\u0442\u043d\u0430, \u043d\u0430\u0447\u043d\u0435\u043c \u043f\u043e\u0438\u0441\u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0432\u0441\u0435 \u0441\u0442\u0430\u0440\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0435\u0434\u0438\u043d\u043e\u0433\u043e \u0441\u0442\u0438\u043b\u044f \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0442\u043e \u0438 \u043c\u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043d\u0430\u0447\u0430\u0442\u044c \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0430\u0445 \u2013 \u044d\u0442\u043e Spring + Hibernate \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0411\u0414. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0411\u0414 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Oracle, \u0445\u043e\u0442\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0421\u0423\u0411\u0414 \u0431\u0443\u0434\u0435\u0442 \u043f\u043b\u044e\u0441 \u043c\u0438\u043d\u0443\u0441 \u043f\u043e\u0445\u043e\u0436\u0438\u043c.<\/p>\n<p>\u0414\u043b\u044f \u0441\u0442\u0430\u0440\u0442\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c <strong>spring-boot-starter-data-jpa<\/strong>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0441\u0440\u0430\u0437\u0443 Spring Data, Hibernate \u0438 JPA, \u0432\u0441\u0435 \u044d\u0442\u043e \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0411\u0414 \u0438 \u043d\u0430\u0448\u0438\u043c\u0438 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044f\u043c\u0438.<\/p>\n<pre><code>        &lt;dependency&gt;             &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;             &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;\/artifactId&gt;             &lt;version&gt;2.4.5&lt;\/version&gt;         &lt;\/dependency&gt;<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043c <strong>spring-boot-starter-test<\/strong><\/p>\n<pre><code>        &lt;dependency&gt;             &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;             &lt;artifactId&gt;spring-boot-starter-test&lt;\/artifactId&gt;             &lt;scope&gt;test&lt;\/scope&gt;         &lt;\/dependency&gt;<\/code><\/pre>\n<p>\u0418 \u0435\u0449\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0441\u0430\u043c \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0411\u0414<\/p>\n<pre><code>        &lt;dependency&gt;             &lt;groupId&gt;com.oracle.database.jdbc&lt;\/groupId&gt;             &lt;artifactId&gt;ojdbc10&lt;\/artifactId&gt;             &lt;version&gt;19.10.0.0&lt;\/version&gt;         &lt;\/dependency&gt;<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u0423 \u043d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 TASK, \u0438\u0441\u043a\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u0432 \u0441\u0442\u0430\u0442\u0443\u0441\u0435 \u201cCREATED\u201d \u0438, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043e\u0442\u0447\u0435\u0442\u0430 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043e\u0442\u0447\u0435\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u043b\u0433\u043e\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0448 \u043c\u0435\u0442\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u0432 \u0434\u0432\u0430 \u043f\u043e\u0442\u043e\u043a\u0430 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438. \u0422\u0430\u043a \u0436\u0435 \u0434\u043b\u044f Spring Data \u0443\u043a\u0430\u0436\u0435\u043c \u043d\u0430\u0448 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439. \u041a\u043b\u0430\u0441\u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code>package com.report.generator.demo.config;  import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.PropertySource; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import org.springframework.scheduling.TaskScheduler; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;  @Configuration @EnableScheduling @EnableAsync @EnableJpaRepositories(basePackages = \"com.report.generator.demo.repository\") @PropertySource({\"classpath:application.properties\"}) @ConditionalOnProperty(     value = \"app.scheduling.enable\", havingValue = \"true\", matchIfMissing = true ) public class DemoConfig {     private static final int CORE_POOL_SIZE = 2;      @Bean(name = \"taskScheduler\")     public TaskScheduler getTaskScheduler() {         ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();         scheduler.setPoolSize(CORE_POOL_SIZE);         scheduler.initialize();         return scheduler;     } } <\/code><\/pre>\n<p>\u041a\u043b\u0430\u0441\u0441 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u0442\u0447\u0435\u0442\u043e\u0432 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 <strong>@Scheduled<\/strong> \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0437 \u0432 \u043c\u0438\u043d\u0443\u0442\u0443 \u0438\u0449\u0435\u0442 Task \u0438, \u0435\u0441\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442, \u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043e\u0442\u0447\u0435\u0442\u0430 \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0438\u0437 \u044d\u0442\u043e\u0439 \u0442\u0430\u0441\u043a\u0438.<\/p>\n<pre><code>    @Async(\"taskScheduler\")     @Scheduled(fixedDelay = 60000)     public void scheduledTask() {         log.info(\"scheduledTask is started\");         Task task = getTask();         if (Objects.isNull(task)) {             log.info(\"task not found\");             return;         }         log.info(\"task found\");         generate(task);     }<\/code><\/pre>\n<p>\u041a\u043b\u0430\u0441\u0441 \u0441\u0442\u0430\u0440\u0442\u0435\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e, \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 <a href=\"https:\/\/github.com\/EVG-A\/report-generator\" rel=\"noopener noreferrer nofollow\">GitHub<\/a>.<\/p>\n<h3>3. \u0412\u044b\u0431\u043e\u0440\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0411\u0414<\/h3>\n<p>\u0422.\u043a. \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u043f\u043e\u0432\u0441\u0435\u043c\u0435\u0441\u0442\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Hibernate \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e. \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e entity MessageData \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u043f\u043e\u043b\u0435\u0439 (id, name, rating, messageDate, test). \u041f\u0435\u0440\u0432\u043e\u0439 \u043f\u043e\u043f\u044b\u0442\u043a\u043e\u0439 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u044b\u043b\u0430 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0432 \u043b\u043e\u0431 \u2013 \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0432\u0441\u0435 \u0432 List&lt;Message&gt; \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430:<\/p>\n<pre><code>List&lt;Message&gt; findAllByMessageDateBetween(Instant dateFrom, Instant dateTo);<\/code><\/pre>\n<p>\u0410 \u0434\u0430\u043b\u044c\u0448\u0435 \u0443\u0436\u0435 \u0432 \u0446\u0438\u043a\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b MessageData \u0438 \u043e\u0431\u043e\u0433\u0430\u0449\u0430\u0442\u044c \u0438\u0445 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u044e\u0449\u0438\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0411\u044b\u043b\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0434\u0445\u043e\u0434 \u0432 \u043a\u043e\u0440\u043d\u0435 \u043d\u0435 \u0432\u0435\u0440\u043d\u044b\u0439 \u0438 \u0432\u044b\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043c\u0438\u043b\u043b\u0438\u043e\u043d \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 List \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e. \u041d\u043e \u0434\u043b\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u0438 \u0437\u0430\u043c\u0435\u0440\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0442\u043e\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u043c\u0438. \u041d\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432\u044b\u0433\u0440\u0443\u0436\u0430\u043b\u0441\u044f \u043e\u043a\u043e\u043b\u043e 30 \u043c\u0438\u043d\u0443\u0442 \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043e <strong>OutOfMemoryError <\/strong>\u0438 \u043d\u0430 \u044d\u0442\u043e\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0441\u044f.<\/p>\n<p>\u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0434\u0430\u043b \u0443\u0437\u043a\u0438\u0435 \u0440\u0430\u043c\u043a\u0438 \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u0438 \u043d\u0430\u043c \u0431\u044b \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u0432 \u043e\u0434\u0438\u043d List, \u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435 \u043c\u044b \u0431\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u2013 \u0434\u043b\u044f \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043a\u043e\u043b\u043e\u043d\u043e\u043a \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c id \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0438\u0434\u0442\u0438 \u0441\u043d\u043e\u0432\u0430 \u0432 \u0431\u0430\u0437\u0443, \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438\u0445 \u0438\u043c\u0435\u043d\u0430 \u0438 \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0438, \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0443\u0436\u0435 \u0441 \u043f\u043e\u043b\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0432\u044b\u0440\u0430\u0441\u0442\u0430\u043b\u0430 \u0432 \u0440\u0430\u0437\u044b. \u0411\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u043e \u0447\u0430\u0441\u0442\u044f\u043c \u0438 \u043f\u0435\u0440\u0435\u043b\u043e\u0436\u0438\u0442\u044c \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0431\u0434. \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u0440\u0430\u0437\u043e\u043c \u0438, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0433\u043e\u0440\u043e\u0434\u0438\u0442\u044c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u043e\u0432, \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>ScrollableResults<\/strong>. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043a\u0443\u0440\u0441\u043e\u0440 \u0438 \u0438\u0442\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u0448\u0430\u0433\u043e\u043c. \u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u043b \u0441\u0440\u0430\u0437\u0443 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0443\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0445 \u0434\u0436\u043e\u0439\u043d\u043e\u0432, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439, \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043e\u043a \u0438 \u0442. \u0434.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u2013 \u0433\u0434\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0441\u0430\u043c \u0442\u0435\u043a\u0441\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u042d\u0442\u043e \u0431\u044b\u043b \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0442.\u043a. \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u0430\u0431\u043b\u0438\u0446, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u0431\u044b\u043b\u043e \u043e\u043a\u043e\u043b\u043e \u0434\u0435\u0441\u044f\u0442\u0438, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u0436\u043e\u0439\u043d\u043e\u0432 \u0438 \u0432\u0441\u044f\u0447\u0435\u0441\u043a\u0438\u0445 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043e\u043a \u0431\u044b\u043b\u043e \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u043c, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0447\u0435\u0433\u043e \u0442\u0435\u043a\u0441\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432\u044b\u0448\u0435\u043b \u043d\u0430 200+ \u0441\u0442\u0440\u043e\u043a \u043f\u043e\u0441\u043b\u0435 \u0440\u0435\u0432\u044c\u044e \u0432\u0441\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043a\u043e\u043b\u043b\u0435\u0433 \u0438 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0438 \u0441\u0430\u043c\u0438\u043c \u0442\u0435\u0445 \u043b\u0438\u0434\u043e\u043c. \u0425\u0440\u0430\u043d\u0438\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 java \u043a\u043e\u0434\u0435 \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c, \u043f\u043b\u044e\u0441 \u0432 \u043d\u0435\u043c \u0431\u044b\u043b\u0438 \u0437\u0430\u0445\u0430\u0440\u0434\u043a\u043e\u0436\u0435\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u0438 \u0441\u0432\u0435\u0442\u0438\u0442\u044c \u0438\u043c\u0438 \u0432 \u043e\u0431\u0449\u0435\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u043c\u043d\u0435 \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0448\u043b\u0430 \u0438\u0434\u0435\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/oracleplsql.ru\/view.html\" rel=\"noopener noreferrer nofollow\">view<\/a>. \u0412\u0435\u0441\u044c \u0442\u0435\u043a\u0441\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0442\u0443\u0434\u0430 \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0441\u044f, \u043f\u043b\u044e\u0441 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c hibernate \u043a\u0430\u043a \u0441 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 entity.<\/p>\n<p>\u041f\u043e \u043d\u0430\u0447\u0430\u043b\u0443 \u0432\u0441\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0432\u044b\u0431\u043e\u0440\u043a\u0443 1 \u043c\u043b\u043d \u0442\u0430\u043a\u0438\u0445 \u0441\u0442\u0440\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0441\u044f \u0437\u0430 \u0440\u0430\u0437\u0443\u043c\u043d\u044b\u0435 10 \u043c\u0438\u043d. \u0438\u043b\u0438 \u043e\u043a\u043e\u043b\u043e \u0442\u043e\u0433\u043e. \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b, \u043d\u043e \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430 \u044d\u0442\u043e \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043b\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0441\u044f \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u0439 \u043c\u0438\u043d\u0443\u0441 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u2013 \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c 1 \u043c\u043b\u043d \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f 10 \u043c\u0438\u043d\u0443\u0442, \u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043e\u0442\u0447\u0435\u0442 \u043f\u043e \u043a\u043e\u0440\u043e\u0447\u0435 \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0434\u0430\u0442\u044b \u043f\u043e\u0443\u0436\u0435 \u2013 \u0443 \u043d\u0430\u0441 \u0437\u0430\u043f\u0440\u043e\u0441 \u0442\u0430\u043a \u0436\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f 10 \u043c\u0438\u043d\u0443\u0442, \u043d\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0445\u043e\u0442\u044c 1 \u0437\u0430\u043f\u0438\u0441\u044c, \u0445\u043e\u0442\u044c \u043c\u0438\u043b\u043b\u0438\u043e\u043d. \u0421\u0443\u0442\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u0430 <a href=\"https:\/\/oracleplsql.ru\/view.html\" rel=\"noopener noreferrer nofollow\">view <\/a>\u043d\u0435\u043b\u044c\u0437\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u0443\u0436\u0435 \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0430\u043b\u043e\u0436\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0432\u0430\u0436\u043d\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0443\u0434\u0435\u0442 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0441\u0442\u0440\u043e\u043a, \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u043d\u043e \u0432\u0441\u0435, \u0447\u0442\u043e \u043d\u0430\u0439\u0434\u0435\u0442\u0441\u044f \u0432 \u0431\u0434, \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u044b \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u0417\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0443 \u0431\u044b\u043b\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e, \u0435\u0433\u043e \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043b\u043e \u0438 \u0442\u043e, \u0447\u0442\u043e \u043e\u0442\u0447\u0435\u0442 \u0441 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430 \u0442\u0430\u043a\u043e\u0435 \u0436\u0435 \u0432\u0440\u0435\u043c\u044f, \u0447\u0442\u043e \u0438 \u043e\u0442\u0447\u0435\u0442 \u0441 1 \u043c\u043b\u043d \u0441\u0442\u0440\u043e\u043a. \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u0438\u0437\u043b\u0438\u0448\u043d\u0435 \u043d\u0430\u0433\u0440\u0443\u0436\u0430\u043b\u043e \u0431\u0434 \u0438 \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430.<\/p>\n<p>\u041e\u0441\u0442\u0430\u0432\u0430\u043b\u0441\u044f \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u0438\u043d \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u043b \u2013 \u044d\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u043c\u0430\u044f \u0432 \u0431\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u044f. \u0412 \u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043a\u0443\u0440\u0441\u043e\u0440 \u0438 \u0435\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u043e\u0436\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u043c\u0430\u043f\u043f\u0438\u0442\u044c \u043d\u0430 \u043d\u0430\u0448\u0443 entity. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0431\u044b\u043b\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u043b\u0430 \u043d\u0430 \u0432\u0445\u043e\u0434 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u043b\u0430 <strong>sys_refcursor<\/strong>, \u0432\u0435\u0441\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043d\u044f\u043b \u043e\u043a\u043e\u043b\u043e 300 \u0441\u0442\u0440\u043e\u043a \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0430 \u0432 \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u0437\u0434\u0435\u0441\u044c \u043e\u043d\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code>create function message_ref(     date_from timestamp,     date_to timestamp ) return sys_refcursor as     ret_cursor sys_refcursor; begin     open ret_cursor for         select m.id,                u.name,                u.rating,                m.message_date,                m.text         from message m                  left join users u on m.user_id = u.id         where m.message_date between date_from and date_to;     return ret_cursor; end message_ref;<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a\u0430\u043a \u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c? \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 <strong>@NamedNativeQuery<\/strong>. \u0417\u0430\u043f\u0440\u043e\u0441 \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: &#171;{ ? = call message_ref(?, ?) }&#187;, <strong>callable<\/strong> = true \u0434\u0430\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, <strong>cacheMode<\/strong> = CacheModeType.IGNORE \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u044d\u0448, \u0442. \u043a. \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u043c \u043d\u0435 \u0442\u0430\u043a \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u0430, \u043a\u0430\u043a \u0437\u0430\u0442\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c, \u043d\u0443 \u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 <strong>resultClass<\/strong> = MessageData.class \u0434\u043b\u044f \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043d\u0430 \u043d\u0430\u0448\u0443 entity. \u041a\u043b\u0430\u0441\u0441 MessageData \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code>package com.report.generator.demo.repository.entity;  import lombok.Data; import<\/code><\/pre>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-324170","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/324170","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=324170"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/324170\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=324170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=324170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=324170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}