{"id":271449,"date":"2015-12-31T06:07:01","date_gmt":"2015-12-31T03:07:01","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=271449"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=271449","title":{"rendered":"\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Google App Engine\/Google Cloud Endpoints \u043d\u0430 Java: \u0444\u0440\u0435\u0439\u043c\u043e\u0440\u043a Objectify"},"content":{"rendered":"<p>       \u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 (<br \/>  <a href=\"http:\/\/habrahabr.ru\/post\/268863\/\">Google Cloud Endpoints \u043d\u0430 Java: \u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e. \u0447. 1<\/a><br \/>  <a href=\"http:\/\/habrahabr.ru\/post\/270459\/\">Google Cloud Endpoints \u043d\u0430 Java: \u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e. \u0447. 2 (Frontend)<\/a><br \/>  <a href=\"http:\/\/habrahabr.ru\/post\/271385\/\">Google Cloud Endpoints \u043d\u0430 Java: \u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e. \u0447. 3 <\/a> ) <br \/>  \u043c\u044b \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 API \u043d\u0430 <a href=\"https:\/\/cloud.google.com\/appengine\/docs\/java\/endpoints\/\">Google Cloud Endpoints<\/a> \u0438 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430 \u043a \u043d\u0435\u043c\u0443 \u043d\u0430 <a href=\"https:\/\/angularjs.org\/\">AngularJS<\/a>.<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e API \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u043f\u043e\u043b\u043d\u044b\u043c \u0431\u0435\u0437 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a <a href=\"https:\/\/github.com\/objectify\/objectify\">Objectify<\/a> \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0432 GAE \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 <a href=\"https:\/\/cloud.google.com\/appengine\/docs\/java\/datastore\/\">App Engine Datastore<\/a>.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>App Engine Datastore<\/h4>\n<p>  App Engine Datastore \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043d\u0435\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u0443\u044e NoSQL-\u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 (schemaless NoSQL datastore) \u0442\u0438\u043f\u0430 \u00ab\u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u043a\u043b\u044e\u0447-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u00bb (Key-value database).<\/p>\n<h5>\u041a\u043b\u044e\u0447<\/h5>\n<p>  \u041a\u043b\u044e\u0447 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c \u00ab\u043e\u0431\u044a\u0435\u043a\u0442\u0430\u00bb (\u0432 App Engine datastore \u044d\u0442\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u00abEntity\u00bb) \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  \u041a\u043b\u044e\u0447 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0442\u0440\u0435\u0445 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0445:<\/p>\n<p>  <b>Kind<\/b> (\u0442\u0438\u043f): \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0438\u043f\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 (\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Objectify \u043c\u044b \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u043c kind \u0432 \u0432\u0438\u0434\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 Java, \u0442.\u0435. <i>\u0443\u0441\u043b\u043e\u0432\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f<\/i> \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 kind \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u043d\u043e\u0433\u043e \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445)<\/p>\n<p>  <b>Identifier <\/b>(\u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440): \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u0438\u0431\u043e \u0441\u0442\u0440\u043e\u043a\u043e\u0439 (String), \u0438 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <b>name<\/b>, \u043b\u0438\u0431\u043e \u0447\u0438\u0441\u043b\u043e\u043c (Long) \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <b>Id<\/b>. \u0422.\u0435. \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0432\u0438\u0434\u0430 <code>&quot;01234&quot;<\/code> \u2014 \u044d\u0442\u043e <i>name<\/i>, \u0430 \u0432\u0438\u0434\u0430 <code>01234<\/code> \u2014 \u044d\u0442\u043e<b><i> Id<\/i><\/b>. \u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u0441\u0440\u0435\u0434\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043e\u0434\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043c\u043e\u0433\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440, \u0442.\u0435. \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u043c\u0435\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430 \u00ab\u0441\u0442\u0440\u043e\u043a\u0430\u00bb \u0441 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c \u00ab01\u00bb, \u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430 \u00ab\u043a\u043e\u043b\u043e\u043d\u043a\u0430\u00bb \u0441 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c \u00ab01\u00bb. \u0414\u043b\u044f \u0432\u043d\u043e\u0432\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440, \u0435\u0441\u043b\u0438 \u043e\u043d \u043d\u0435 \u0437\u0430\u0434\u0430\u043d \u044f\u0432\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<p>  <b>Parent<\/b>(\u0433\u0440\u0443\u043f\u043f\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432): \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u0431\u0430\u0437\u0435 \u043c\u043e\u0433\u0443\u0442 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u00ab\u0433\u0440\u0443\u043f\u043f\u044b \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432\u00bb, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 parent \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043b\u0438\u0431\u043e \u043a\u043b\u044e\u0447 \u00ab\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e\u00bb \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043b\u0438\u0431\u043e \u0442\u0430\u043a\u043e\u0432\u044b\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f null (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e) \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0445 \u0432 \u0433\u0440\u0443\u043f\u043f\u044b.<\/p>\n<h5>\u041e\u0431\u044a\u0435\u043a\u0442 (Entity)<\/h5>\n<p>  \u041e\u0431\u044a\u0435\u043a\u0442 (Entity) \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 (properties) \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (Value type), \u0438\u0445 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0442\u0438\u043f\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0445 Java (Java types)) \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043e \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435:  <\/p>\n<table>\n<tr>\n<th>Value type<\/th>\n<th>Java type(s)<\/th>\n<th>Sort order<\/th>\n<th>Notes<\/th>\n<\/tr>\n<tr>\n<td>Integer<\/td>\n<td><code>short<\/code><br \/>  <code>int<\/code><br \/>  <code>long<\/code><br \/>  <code>java.lang.Short<\/code><br \/>  <code>java.lang.Integer<\/code><br \/>  <code>java.lang.Long<\/code><\/td>\n<td>Numeric<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Floating-point number<\/td>\n<td><code>float<\/code><br \/>  <code>double<\/code><br \/>  <code>java.lang.Float<\/code><br \/>  <code>java.lang.Double<\/code><\/td>\n<td>Numeric<\/td>\n<td>64-bit double precision,<br \/>  IEEE 754<\/td>\n<\/tr>\n<tr>\n<td>Boolean<\/td>\n<td><code>boolean<\/code><br \/>  <code>java.lang.Boolean<\/code><\/td>\n<td><code>false<\/code> or <code>true<\/code><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Text string (short)<\/td>\n<td><code>java.lang.String<\/code><\/td>\n<td>Unicode<\/td>\n<td>\u0414\u043e 1500 bytes<\/p>\n<p>  \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u0435 1500 bytes \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <code>IllegalArgumentException<\/code><\/td>\n<\/tr>\n<tr>\n<td>Text string (long)<\/td>\n<td><a href=\"https:\/\/cloud.google.com\/appengine\/docs\/java\/javadoc\/com\/google\/appengine\/api\/datastore\/Text\"><code>com.google.appengine.api.datastore.Text<\/code><\/a><\/td>\n<td>None<\/td>\n<td>\u0414\u043e 1 megabyte<\/p>\n<p>  \u041d\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/td>\n<\/tr>\n<tr>\n<td>Byte string (short)<\/td>\n<td><a href=\"https:\/\/cloud.google.com\/appengine\/docs\/java\/javadoc\/com\/google\/appengine\/api\/datastore\/ShortBlob\"><code>com.google.appengine.api.datastore.ShortBlob<\/code><\/a><\/td>\n<td>Byte order<\/td>\n<td>\u0414\u043e 1500 bytes<\/p>\n<p>  \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0435 1500 bytes \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u044e\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <code>IllegalArgumentException<\/code><\/td>\n<\/tr>\n<tr>\n<td>Byte string (long)<\/td>\n<td><a href=\"https:\/\/cloud.google.com\/appengine\/docs\/java\/javadoc\/com\/google\/appengine\/api\/datastore\/Blob\"><code>com.google.appengine.api.datastore.Blob<\/code><\/a><\/td>\n<td>None<\/td>\n<td>\u0414\u043e 1 megabyte<\/p>\n<p>  \u041d\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/td>\n<\/tr>\n<tr>\n<td>Date and time<\/td>\n<td><code>java.util.Date<\/code><\/td>\n<td>Chronological<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Geographical point<\/td>\n<td><a href=\"https:\/\/cloud.google.com\/appengine\/docs\/java\/javadoc\/com\/google\/appengine\/api\/datastore\/GeoPt\"><code>com.google.appengine.api.datastore.GeoPt<\/code><\/a><\/td>\n<td>By latitude,<br \/>  then longitude<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Postal address<\/td>\n<td><a href=\"https:\/\/cloud.google.com\/appengine\/docs\/java\/javadoc\/com\/google\/appengine\/api\/datastore\/PostalAddress\"><code>com.google.appengine.api.datastore.PostalAddress<\/code><\/a><\/td>\n<td>Unicode<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Telephone number<\/td>\n<td><a href=\"https:\/\/cloud.google.com\/appengine\/docs\/java\/javadoc\/com\/google\/appengine\/api\/datastore\/PhoneNumber\"><code>com.google.appengine.api.datastore.PhoneNumber<\/code><\/a><\/td>\n<td>Unicode<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Email address<\/td>\n<td><a href=\"https:\/\/cloud.google.com\/appengine\/docs\/java\/javadoc\/com\/google\/appengine\/api\/datastore\/Email\"><code>com.google.appengine.api.datastore.Email<\/code><\/a><\/td>\n<td>Unicode<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Google Accounts user<\/td>\n<td><a href=\"https:\/\/cloud.google.com\/appengine\/docs\/java\/javadoc\/com\/google\/appengine\/api\/users\/User\"><code>com.google.appengine.api.users.User<\/code><\/a><\/td>\n<td>Email address<br \/>  in Unicode order<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Instant messaging handle<\/td>\n<td><a href=\"https:\/\/cloud.google.com\/appengine\/docs\/java\/javadoc\/com\/google\/appengine\/api\/datastore\/IMHandle\"><code>com.google.appengine.api.datastore.IMHandle<\/code><\/a><\/td>\n<td>Unicode<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Link<\/td>\n<td><a href=\"https:\/\/cloud.google.com\/appengine\/docs\/java\/javadoc\/com\/google\/appengine\/api\/datastore\/Link\"><code>com.google.appengine.api.datastore.Link<\/code><\/a><\/td>\n<td>Unicode<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Category<\/td>\n<td><a href=\"https:\/\/cloud.google.com\/appengine\/docs\/java\/javadoc\/com\/google\/appengine\/api\/datastore\/Category\"><code>com.google.appengine.api.datastore.Category<\/code><\/a><\/td>\n<td>Unicode<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Rating<\/td>\n<td><a href=\"https:\/\/cloud.google.com\/appengine\/docs\/java\/javadoc\/com\/google\/appengine\/api\/datastore\/Rating\"><code>com.google.appengine.api.datastore.Rating<\/code><\/a><\/td>\n<td>Numeric<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>Datastore key<\/td>\n<td><a href=\"https:\/\/cloud.google.com\/appengine\/docs\/java\/javadoc\/com\/google\/appengine\/api\/datastore\/Key\"><code>com.google.appengine.api.datastore.Key<\/code><\/a><br \/>  or the referenced object (as a child)<\/td>\n<td>By path elements<br \/>  (kind, identifier,<br \/>  kind, identifier&#8230;)<\/td>\n<td>\u0414\u043e 1500 bytes<\/p>\n<p>  \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0435 1500 bytes \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u044e\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <code>IllegalArgumentException<\/code><\/td>\n<\/tr>\n<tr>\n<td>Blobstore key<\/td>\n<td><a href=\"https:\/\/cloud.google.com\/appengine\/docs\/java\/javadoc\/com\/google\/appengine\/api\/blobstore\/BlobKey\"><code>com.google.appengine.api.blobstore.BlobKey<\/code><\/a><\/td>\n<td>Byte order<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/cloud.google.com#Java_Embedded_entities\">Embedded entity<\/a><\/td>\n<td><a href=\"https:\/\/cloud.google.com\/appengine\/docs\/java\/datastore\/entities#Java_Embedded_entities\"><code>com.google.appengine.api.datastore.EmbeddedEntity<\/code><\/a><\/td>\n<td>None<\/td>\n<td>\u043d\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/td>\n<\/tr>\n<tr>\n<td>Null<\/td>\n<td><code>null<\/code><\/td>\n<td>None<\/td>\n<td><\/td>\n<\/tr>\n<\/table>\n<p>  <\/p>\n<h5>\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445<\/h5>\n<p>  Objectify \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u0442\u0440\u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438:<\/p>\n<p>  <b>save()<\/b>: \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<p>  <b>delete()<\/b>: \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0438\u0437 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<p>  <b>load()<\/b>: \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0438\u043b\u0438 \u0441\u043f\u0438\u0441\u043e\u043a (List) \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438\u0437 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<h5>\u0422\u0440\u0430\u043d\u0441\u0430\u043a\u0446\u0438\u0438 (Transactions) \u0438 \u0433\u0440\u0443\u043f\u043f\u044b \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 (Entity Groups)<\/h5>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u0433\u0440\u0443\u043f\u043f\u0443 \u00ab\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439\u00bb \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u0431\u0430\u0437\u0435, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u043b\u044e\u0447 \u043e\u0431\u044a\u0435\u043a\u0442\u0430. \u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u00ab\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u00bb \u043d\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044e \u00ab\u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445\u00bb, \u043e\u043d\u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442 \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0435\u0433\u043e \u043a\u043b\u044e\u0447.<\/p>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440.<br \/>  \u041e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u00ab\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442\u00bb \u2014 \u00ab\u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442\u00bb (parent\u2013child relationship) \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u043a\u0430\u043a \u043c\u0435\u0436\u0434\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0430\u0434\u0435\u0434 -&gt; \u0434\u0435\u0434 -&gt; \u043e\u0442\u0435\u0446 -&gt; \u044f -&gt; \u0441\u044b\u043d) \u0442\u0430\u043a \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0442\u0438\u043f\u0430 \u00ab\u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044c\u00bb \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0442\u0438\u043f\u0430 \u00ab\u043a\u043e\u043b\u0435\u0441\u043e\u00bb, \u00ab\u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044c\u00bb)<\/p>\n<p>  \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u00ab\u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0433\u043e\u00bb \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u00ab\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439\u00bb \u043e\u0431\u044a\u0435\u043a\u0442. \u0418, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043a\u043b\u044e\u0447 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u043a\u043b\u044e\u0447\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u043b\u0438 \u0443\u0431\u0438\u0440\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u043e\u0437\u0434\u0430\u043d \u2014 \u043a\u043b\u044e\u0447 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u00ab\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043a\u043b\u044e\u0447\u0430\u00bb \u043d\u0430\u0434\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442\u044c \u0441 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<p>  \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0439 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A2%D1%80%D0%B0%D0%BD%D0%B7%D0%B0%D0%BA%D1%86%D0%B8%D1%8F_%28%D0%B8%D0%BD%D1%84%D0%BE%D1%80%D0%BC%D0%B0%D1%82%D0%B8%D0%BA%D0%B0%29\">\u0442\u0440\u0430\u043d\u0441\u0430\u043a\u0446\u0438\u0438<\/a> \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 (\u043d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u0434\u043d\u043e\u0439 \u0442\u0440\u0430\u043d\u0441\u0430\u043a\u0446\u0438\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0433\u0440\u0443\u043f\u043f)<br \/>  \u041a\u043e\u0433\u0434\u0430 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043b\u044e\u0431\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u0433\u0440\u0443\u043f\u043f\u0435 \u0434\u043b\u044f \u0433\u0440\u0443\u043f\u043f\u044b \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u043c\u0435\u0442\u043a\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 (timestamp). \u041e\u0442\u043c\u0435\u0442\u043a\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0442\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0446\u0435\u043b\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b, \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u0433\u0434\u0430 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043b\u044e\u0431\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u0433\u0440\u0443\u043f\u043f\u0435.<\/p>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c \u0442\u0440\u0430\u043d\u0441\u0430\u043a\u0446\u0438\u044e, \u0442\u043e \u043a\u0430\u0436\u0434\u0430\u044f \u0433\u0440\u0443\u043f\u043f\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u0435\u0442 \u0442\u0440\u0430\u043d\u0441\u0430\u043a\u0446\u0438\u044f \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u0430\u044f (enlisted) \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u0440\u0430\u043d\u0441\u0430\u043a\u0446\u0438\u0438. \u041a\u043e\u0433\u0434\u0430 \u0442\u0440\u0430\u043d\u0441\u0430\u043a\u0446\u0438\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u0430 (committed), \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u043e\u0442\u043c\u0435\u0442\u043a\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0433\u0440\u0443\u043f\u043f, \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432 \u0442\u0440\u0430\u043d\u0441\u0430\u043a\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u043b\u044e\u0431\u0430\u044f \u0438\u0437 \u043e\u0442\u043c\u0435\u0442\u043e\u043a \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0430\u0441\u044c (\u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0434\u0440\u0443\u0433\u0430\u044f \u0442\u0440\u0430\u043d\u0441\u0430\u043a\u0446\u0438\u044f \u0432 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0430 \u043e\u0431\u044a\u0435\u043a\u0442(\u044b) \u0432 \u0433\u0440\u0443\u043f\u043f\u0435) \u0442\u043e \u0432\u0441\u044f \u0442\u0440\u0430\u043d\u0441\u0430\u043a\u0446\u0438\u044f \u043e\u0442\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0438 \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 ConcurrentModificationException. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441\u043c. <a href=\"https:\/\/github.com\/objectify\/objectify\/wiki\/Concepts#optimistic-concurrency\">github.com\/objectify\/objectify\/wiki\/Concepts#optimistic-concurrency<\/a><br \/>  Objectify \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442 \u0442\u0440\u0430\u043d\u0441\u0430\u043a\u0446\u0438\u044e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0440\u0430\u043d\u0441\u0430\u043a\u0446\u0438\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%98%D0%B4%D0%B5%D0%BC%D0%BF%D0%BE%D1%82%D0%B5%D0%BD%D1%82%D0%BD%D0%BE%D1%81%D1%82%D1%8C#.D0.92_.D0.B8.D0.BD.D1.84.D0.BE.D1.80.D0.BC.D0.B0.D1.82.D0.B8.D0.BA.D0.B5\">\u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u044b<\/a> (idempotent), \u0442.\u0435. \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u0442\u0440\u0430\u043d\u0441\u0430\u043a\u0446\u0438\u044e \u043b\u044e\u0431\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<p>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u0442\u0440\u0430\u043d\u0441\u0430\u043a\u0446\u0438\u044f\u0445 \u0432 Objectify, \u0441\u043c.: <a href=\"https:\/\/github.com\/objectify\/objectify\/wiki\/Transactions\">github.com\/objectify\/objectify\/wiki\/Transactions<\/a><\/p>\n<h4>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 Objectify \u0432 \u043f\u0440\u043e\u0435\u043a\u0442<\/h4>\n<p>  \u0414\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 objectify.jar \u0438 <a href=\"https:\/\/github.com\/google\/guava\/wiki\">guava.jar<\/a>.<br \/>  Objectify \u0435\u0441\u0442\u044c \u0432 <a href=\"http:\/\/search.maven.org\/#artifactdetails|com.googlecode.objectify|\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 Maven<\/a>, \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 pom.xml:  <\/p>\n<pre><code class=\"xml\">  &lt;dependencies&gt;     &lt;dependency&gt;       &lt;groupId&gt;com.googlecode.objectify&lt;\/groupId&gt;       &lt;artifactId&gt;objectify&lt;\/artifactId&gt;       &lt;version&gt;5.1.9&lt;\/version&gt;     &lt;\/dependency&gt;   &lt;\/dependencies&gt; <\/code><\/pre>\n<p>   \u2014 objectify.jar \u0438 guava.jar \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u043f\u0440\u043e\u0435\u043a\u0442.<br \/>  Objectify \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0444\u0438\u043b\u044c\u0442\u0440 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0432 WEB-INF\/web.xml:  <\/p>\n<pre><code class=\"xml\">&lt;filter&gt;     &lt;filter-name&gt;ObjectifyFilter&lt;\/filter-name&gt;     &lt;filter-class&gt;com.googlecode.objectify.ObjectifyFilter&lt;\/filter-class&gt; &lt;\/filter&gt; &lt;filter-mapping&gt;     &lt;filter-name&gt;ObjectifyFilter&lt;\/filter-name&gt;     &lt;url-pattern&gt;\/*&lt;\/url-pattern&gt; &lt;\/filter-mapping&gt; <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 UserData, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 (Entity) \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445:  <\/p>\n<pre><code class=\"java\">package com.appspot.hello_habrahabr_api;  import com.googlecode.objectify.annotation.Entity; import com.googlecode.objectify.annotation.Id; import com.googlecode.objectify.annotation.Index; import com.googlecode.objectify.annotation.Cache;  import java.io.Serializable;   @Entity \/\/ indicates that this is an Entity @Cache  \/\/ Annotate your entity classes with @Cache to make them cacheable.         \/\/ The cache is shared by all running instances of your application         \/\/ and can both improve the speed and reduce the cost of your application.         \/\/ Memcache requests are free and typically complete in a couple milliseconds.         \/\/ Datastore requests are metered and typically complete in tens of milliseconds. public class UserData implements Serializable {     @Id     \/\/ indicates that the userId is to be used in the Entity's key             \/\/ @Id field can be of type Long, long, or String             \/\/ Entities must have have at least one field annotated with @Id     String userId;     @Index \/\/ this field will be indexed in database     private String  createdBy; \/\/ email     @Index     private String  firstName;     @Index     private String  lastName;      private UserData() {     } \/\/ There must be a no-arg constructor     \/\/ (or no constructors - Java creates a default no-arg constructor).     \/\/ The no-arg constructor can have any protection level (private, public, etc).      public UserData(String createdBy, String firstName, String lastName) {         this.userId = firstName + lastName;         this.createdBy = createdBy;         this.firstName = firstName;         this.lastName = lastName;     }      \/* Getters and setters *\/     \/\/ You need getters and setters to have a serializable class if you need to send it from backend to frontend,     \/\/ to avoid exception:     \/\/ java.io.IOException: com.google.appengine.repackaged.org.codehaus.jackson.map.JsonMappingException: No serializer found for class ...     \/\/      public String getUserId() {         return userId;     }      public void setUserId(String userId) {         this.userId = userId;     }      public String getCreatedBy() {         return createdBy;     }      public void setCreatedBy(String createdBy) {         this.createdBy = createdBy;     }      public String getFirstName() {         return firstName;     }      public void setFirstName(String firstName) {         this.firstName = firstName;     }      public String getLastName() {         return lastName;     }      public void setLastName(String lastName) {         this.lastName = lastName;     } }  <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u043c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u044b \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u0432\u044b\u0434\u0430\u044e\u0449\u0438\u0439 \u0441\u0435\u0440\u0432\u0438\u0441\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 Objectify (Objectify service object), \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0433\u043e OfyService:  <\/p>\n<pre><code class=\"java\">package com.appspot.hello_habrahabr_api;  import com.googlecode.objectify.Objectify; import com.googlecode.objectify.ObjectifyFactory; import com.googlecode.objectify.ObjectifyService;  \/**  * Custom Objectify Service that this application should use.  *\/ public class OfyService {      \/\/ This static block ensure the entity registration.     static {         factory().register(UserData.class);     }      \/\/ Use this static method for getting the Objectify service factory.     public static ObjectifyFactory factory() {         return ObjectifyService.factory();     }      \/**      * Use this static method for getting the Objectify service object in order      * to make sure the above static block is executed before using Objectify.      *      * @return Objectify service object.      *\/     @SuppressWarnings(&quot;unused&quot;)     public static Objectify ofy() {         return ObjectifyService.ofy();     } } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c API (\u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0444\u0430\u0439\u043b UserDataAPI.java):  <\/p>\n<pre><code class=\"java\">package com.appspot.hello_habrahabr_api;  import com.google.api.server.spi.config.Api; import com.google.api.server.spi.config.ApiMethod; import com.google.api.server.spi.config.ApiMethod.HttpMethod; import com.google.api.server.spi.config.Named; import com.google.api.server.spi.response.NotFoundException; import com.google.api.server.spi.response.UnauthorizedException; import com.google.appengine.api.users.User; import com.googlecode.objectify.Key; import com.googlecode.objectify.Objectify;  import java.io.Serializable; import java.util.List; import java.util.logging.Logger;  \/**  * explore this API on:  * hello-habrahabr-api.appspot.com\/_ah\/api\/explorer  * {project ID}.appspot.com\/_ah\/api\/explorer  *\/  @Api(         name = &quot;userDataAPI&quot;, \/\/ The api name must match '[a-z]+[A-Za-z0-9]*'         version = &quot;v1&quot;,         scopes = {Constants.EMAIL_SCOPE},         clientIds = {Constants.WEB_CLIENT_ID, Constants.API_EXPLORER_CLIENT_ID},         description = &quot;UserData API using OAuth2&quot;) public class UserDataAPI {      private static final Logger LOG = Logger.getLogger(UserDataAPI.class.getName());      \/\/ Primitives and enums are not allowed as return type in @ApiMethod     \/\/ So we create inner class (which should be a JavaBean) to serve as wrapper for String     private class MessageToUser implements Serializable {          private String message;          public MessageToUser() {         }          public MessageToUser(String message) {             this.message = message;         }          public String getMessage() {             return message;         }          public void setMessage(String message) {             this.message = message;         }     }      @ApiMethod(             name = &quot;createUser&quot;,             path = &quot;createUser&quot;,             httpMethod = HttpMethod.POST)     @SuppressWarnings(&quot;unused&quot;)     public MessageToUser createUser(final User gUser,                                     @Named(&quot;firstName&quot;) final String firstName,                                     @Named(&quot;lastName&quot;) final String lastName                                     \/\/ instead of @Named arguments, we could also use                                     \/\/ another JavaBean for modelling data received from frontend     ) throws UnauthorizedException {          if (gUser == null) {             LOG.warning(&quot;User not logged in&quot;);             throw new UnauthorizedException(&quot;Authorization required&quot;);         }          Objectify ofy = OfyService.ofy();          UserData user = new UserData(gUser.getEmail(), firstName, lastName);          ofy.save().entity(user).now();          return new MessageToUser(&quot;user created: &quot; + firstName + &quot; &quot; + lastName);     }      @ApiMethod(             name = &quot;deleteUser&quot;,             path = &quot;deleteUser&quot;,             httpMethod = HttpMethod.DELETE)     @SuppressWarnings(&quot;unused&quot;)     public MessageToUser deleteUser(final User gUser,                                     @Named(&quot;firstName&quot;) final String firstName,                                     @Named(&quot;lastName&quot;) final String lastName     ) throws UnauthorizedException {          if (gUser == null) {             LOG.warning(&quot;User not logged in&quot;);             throw new UnauthorizedException(&quot;Authorization required&quot;);         }          Objectify ofy = OfyService.ofy();          String userId = firstName + lastName;         Key&lt;UserData&gt; userDataKey = Key.create(UserData.class, userId);          ofy.delete().key(userDataKey);          return new MessageToUser(&quot;User deleted: &quot; + firstName + &quot; &quot; + lastName);     }      @ApiMethod(             name = &quot;findUsersByLastName&quot;,             path = &quot;findUsersByLastName&quot;,             httpMethod = HttpMethod.GET)     @SuppressWarnings(&quot;unused&quot;)     public List&lt;UserData&gt; findUsers(final User gUser,                                     @Named(&quot;query&quot;) final String query     ) throws UnauthorizedException, NotFoundException {          if (gUser == null) {             LOG.warning(&quot;User not logged in&quot;);             throw new UnauthorizedException(&quot;Authorization required&quot;);         }          Objectify ofy = OfyService.ofy();          List&lt;UserData&gt; result = ofy.load().type(UserData.class).filter(&quot;lastName ==&quot;, query).list();         \/\/ for queries see:          \/\/ https:\/\/github.com\/objectify\/objectify\/wiki\/Queries#executing-queries           if (result.isEmpty()) {             throw new NotFoundException(&quot;no results found&quot;);         }          return result; \/\/ we need to return a serializable object     } }  <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 {project ID}.appspot.com\/_ah\/api\/explorer \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c API \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f, \u0443\u0434\u0430\u043b\u044f\u044f \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0438\u0437 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/6d2\/95c\/96d\/6d295c96db3c45e59dc32e4af867a1ca.png\"\/><\/p>\n<p>  \u0412 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <a href=\"https:\/\/console.developers.google.com\/datastore\/entities\/query\">console.developers.google.com\/datastore\/entities\/query<\/a>, \u0432\u044b\u0431\u0440\u0430\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u0432 \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0435\u043c\u0443 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c, \u0443\u0434\u0430\u043b\u044f\u0442\u044c, \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/670\/62a\/30d\/67062a30dd284ed4bc12b97d1d1ec1da.png\"\/><\/p>\n<h4>\u0421\u0441\u044b\u043b\u043a\u0438: <\/h4>\n<p>  <a href=\"https:\/\/github.com\/objectify\/objectify\/wiki\">Objectify wiki<\/a><\/p>\n<p>  <a href=\"http:\/\/www.javadoc.io\/doc\/com.googlecode.objectify\/objectify\">Objectify JavaDoc<\/a><\/p>\n<p>  <a href=\"https:\/\/cloud.google.com\/appengine\/docs\/java\/datastore\/\">Java Datastore API <\/a><\/p>\n<p>  <a href=\"https:\/\/cloud.google.com\/appengine\/docs\/java\/gettingstarted\/usingdatastore\">Storing Data in Datastore<\/a> (Google Tutorial)<\/p>\n<p>  \u041a\u0440\u0430\u0442\u043a\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u043e\u0442 \u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u044f <a href=\"https:\/\/github.com\/stickfigure\">Jeff Schnitzer<\/a> (<a href=\"https:\/\/twitter.com\/jeffschnitzer\">@jeffschnitzer<\/a>) \u043d\u0430 Google I\/O 2011:<br \/>  <iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/imiquTOLl64?feature=oembed\" frameborder=\"0\" allowfullscreen><\/iframe>               <\/p>\n<div class=\"clear\"><\/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=\"http:\/\/habrahabr.ru\/post\/274239\/\"> http:\/\/habrahabr.ru\/post\/274239\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 (<br \/>  <a href=\"http:\/\/habrahabr.ru\/post\/268863\/\">Google Cloud Endpoints \u043d\u0430 Java: \u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e. \u0447. 1<\/a><br \/>  <a href=\"http:\/\/habrahabr.ru\/post\/270459\/\">Google Cloud Endpoints \u043d\u0430 Java: \u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e. \u0447. 2 (Frontend)<\/a><br \/>  <a href=\"http:\/\/habrahabr.ru\/post\/271385\/\">Google Cloud Endpoints \u043d\u0430 Java: \u0420\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e. \u0447. 3 <\/a> ) <br \/>  \u043c\u044b \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 API \u043d\u0430 <a href=\"https:\/\/cloud.google.com\/appengine\/docs\/java\/endpoints\/\">Google Cloud Endpoints<\/a> \u0438 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0430 \u043a \u043d\u0435\u043c\u0443 \u043d\u0430 <a href=\"https:\/\/angularjs.org\/\">AngularJS<\/a>.<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e API \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u043f\u043e\u043b\u043d\u044b\u043c \u0431\u0435\u0437 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a <a href=\"https:\/\/github.com\/objectify\/objectify\">Objectify<\/a> \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0432 GAE \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 <a href=\"https:\/\/cloud.google.com\/appengine\/docs\/java\/datastore\/\">App Engine Datastore<\/a>.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-271449","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/271449","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=271449"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/271449\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=271449"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=271449"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=271449"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}