{"id":16512,"date":"2014-12-30T09:58:40","date_gmt":"2014-12-30T04:28:40","guid":{"rendered":"https:\/\/2thenew.xyz\/blog\/?p=16512"},"modified":"2014-12-30T09:58:40","modified_gmt":"2014-12-30T04:28:40","slug":"grails-unique-constraint-optimization-part-2","status":"publish","type":"post","link":"https:\/\/2thenew.xyz\/blog\/grails-unique-constraint-optimization-part-2\/","title":{"rendered":"Grails unique constraint optimization part 2"},"content":{"rendered":"<p>In the previous blog\u00a0<a title=\"Grails performance optimization - Unique constraint\" href=\"https:\/\/2thenew.xyz\/blog\/grails-performance-optimization-unique-constraint\/\" target=\"_blank\">Grails performance optimization &#8211; Unique constraint<\/a>\u00a0we have optimized Grails unique constraint. Now in this blog\u00a0we will check another use case and will optimize unique constraint according to it. Suppose we have two domains having the following structure:<\/p>\n<p>[code]<br \/>\nclass Address {<br \/>\n String addressLine1<br \/>\n String addressLine2<\/p>\n<p> static constraints = {<br \/>\n }<br \/>\n}<br \/>\n[\/code]<\/p>\n<p>[code]<br \/>\nclass User {<\/p>\n<p> String firstName<br \/>\n String lastName<br \/>\n String emailId<br \/>\n Address address<\/p>\n<p> static constraints = {<br \/>\n  address nullable: true, blank: false<br \/>\n  emailId nullable: false, blank: true, email: true, unique: true<br \/>\n }<\/p>\n<p> static mapping = {<br \/>\n  address fetch: &#8216;join&#8217;<br \/>\n }<br \/>\n}<br \/>\n[\/code]<\/p>\n<p>Now create user object and check the database queries triggered by grails application:<\/p>\n<p>[code]<br \/>\nUser user = new User(firstName: &#8216;Deepak&#8217;, lastName: &#8216;Mittal&#8217;, emailId: &#8216;deepak.krmittal@intelligrape.com&#8217;)<br \/>\nif(user.validate() &amp;&amp; user.save(flush: true, validate: false)) {<br \/>\n  println(&#8216;Success&#8217;)<br \/>\n} else {<br \/>\n  println(&#8216;Error&#8217;)<br \/>\n}<br \/>\n[\/code]<\/p>\n<p>Check the application console, it has the queries like this:<\/p>\n<p>[code]<br \/>\nHibernate: select this_.id as id1_1_1_, this_.version as version2_1_1_, this_.address_id as address_3_1_1_, this_.email_id as email_id4_1_1_, this_.first_name as first_na5_1_1_, this_.last_name as last_nam6_1_1_, address2_.id as id1_0_0_, address2_.version as version2_0_0_, address2_.address_line1 as address_3_0_0_, address2_.address_line2 as address_4_0_0_ from user this_ left outer join address address2_ on this_.address_id=address2_.id where this_.email_id=?<br \/>\nHibernate: insert into user (version, address_id, email_id, first_name, last_name) values (?, ?, ?, ?, ?)<br \/>\n[\/code]<\/p>\n<p>In the first\u00a0query for unique check, there are 2 issues.<\/p>\n<ol>\n<li>User domain is joined with address domain due to <strong>fetch join<\/strong> specified in user mapping closure, which really doesn&#8217;t needed in unique check.<\/li>\n<li>All fields of user and address domain are fetched while there is no need of them.<\/li>\n<\/ol>\n<p>To solve the issue, we have replaced\u00a0the unique constraint with custom validator like this:<\/p>\n<p>[code]<br \/>\nclass User {<\/p>\n<p> String firstName<br \/>\n String lastName<br \/>\n String emailId<br \/>\n Address address<\/p>\n<p> static constraints = {<br \/>\n  address nullable: true, blank: false<br \/>\n  emailId nullable: false, blank: true, email: true, validator: { val, obj -&gt;<br \/>\n   if (obj.id) {<br \/>\n    if (User.countByEmailIdAndIdNotEqual(val, obj.id)) {<br \/>\n     return &quot;already.exist&quot;<br \/>\n    }<br \/>\n   } else {<br \/>\n    if (User.countByEmailId(val)) {<br \/>\n     return &quot;already.exist&quot;<br \/>\n    }<br \/>\n   }<br \/>\n }<br \/>\n }<\/p>\n<p> static mapping = {<br \/>\n  address fetch: &#8216;join&#8217;<br \/>\n }<br \/>\n}<br \/>\n[\/code]<\/p>\n<p>Now again create the user object and check your application console, it has the queries as shown below:<\/p>\n<p>[code]<br \/>\nHibernate: select count(*) as y0_ from user this_ where this_.email_id=?<br \/>\nHibernate: insert into user (version, address_id, email_id, first_name, last_name) values (?, ?, ?, ?, ?)<br \/>\n[\/code]<\/p>\n<p>Now your purpose is solved with a little bit optimized code.<\/p>\n<p>Code written with Grails 2.4.3.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the previous blog\u00a0Grails performance optimization &#8211; Unique constraint\u00a0we have optimized Grails unique constraint. Now in this blog\u00a0we will check another use case and will optimize unique constraint according to it. Suppose we have two domains having the following structure: [code] class Address { String addressLine1 String addressLine2 static constraints = { } } [\/code] [&hellip;]<\/p>\n","protected":false},"author":145,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":10,"footnotes":""},"categories":[7,1],"tags":[29,4840,1576,1579,1589,1588],"class_list":["post-16512","post","type-post","status-publish","format-standard","hentry","category-grails","category-technology","tag-gorm","tag-grails","tag-grails-constraints","tag-grails-hibernate","tag-grails-performance-optimization","tag-grails-unique-constraints"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"In the previous blog Grails performance optimization - Unique constraint we have optimized Grails unique constraint. Now in this blog we will check another use case and will optimize unique constraint according to it. Suppose we have two domains having the following structure: [code] class Address { String addressLine1 String addressLine2 static constraints = { } } [\/code]\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Deepak Kumar Mittal\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/2thenew.xyz\/blog\/grails-unique-constraint-optimization-part-2\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.0.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"TO THE NEW BLOG\" \/>\n\t\t<meta property=\"og:type\" content=\"blog\" \/>\n\t\t<meta property=\"og:title\" content=\"Grails unique constraint optimization part 2 | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"In the previous blog Grails performance optimization - Unique constraint we have optimized Grails unique constraint. Now in this blog we will check another use case and will optimize unique constraint according to it. Suppose we have two domains having the following structure: [code] class Address { String addressLine1 String addressLine2 static constraints = { } } [\/code]\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/2thenew.xyz\/blog\/grails-unique-constraint-optimization-part-2\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/2thenew.xyz\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/2thenew.xyz\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@tothenew\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Grails unique constraint optimization part 2 | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"In the previous blog Grails performance optimization - Unique constraint we have optimized Grails unique constraint. Now in this blog we will check another use case and will optimize unique constraint according to it. Suppose we have two domains having the following structure: [code] class Address { String addressLine1 String addressLine2 static constraints = { } } [\/code]\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/2thenew.xyz\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/grails-unique-constraint-optimization-part-2\\\/#article\",\"name\":\"Grails unique constraint optimization part 2 | TO THE NEW Blog\",\"headline\":\"Grails unique constraint optimization part 2\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/deepak-krmittal\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"datePublished\":\"2014-12-30T09:58:40+05:30\",\"dateModified\":\"2014-12-30T09:58:40+05:30\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/grails-unique-constraint-optimization-part-2\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/grails-unique-constraint-optimization-part-2\\\/#webpage\"},\"articleSection\":\"Grails, Technology, GORM, Grails, grails constraints, grails hibernate, grails performance optimization, grails unique constraints\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/grails-unique-constraint-optimization-part-2\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"position\":2,\"name\":\"Technology\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/grails-unique-constraint-optimization-part-2\\\/#listItem\",\"name\":\"Grails unique constraint optimization part 2\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/grails-unique-constraint-optimization-part-2\\\/#listItem\",\"position\":3,\"name\":\"Grails unique constraint optimization part 2\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/technology\\\/#listItem\",\"name\":\"Technology\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\",\"name\":\"TO THE NEW Blog\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/deepak-krmittal\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/deepak-krmittal\\\/\",\"name\":\"Deepak Kumar Mittal\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/grails-unique-constraint-optimization-part-2\\\/#authorImage\",\"url\":\"https:\\\/\\\/newersworld-sf-static.tothenew.net\\\/prod\\\/profilePicFolder\\\/da9e6037-b214-46e2-8db4-ead6ae22187e_310-Deepak-Kumar-Mittal-PROFILEPICTURE.jpeg\",\"width\":96,\"height\":96,\"caption\":\"Deepak Kumar Mittal\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/grails-unique-constraint-optimization-part-2\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/grails-unique-constraint-optimization-part-2\\\/\",\"name\":\"Grails unique constraint optimization part 2 | TO THE NEW Blog\",\"description\":\"In the previous blog Grails performance optimization - Unique constraint we have optimized Grails unique constraint. Now in this blog we will check another use case and will optimize unique constraint according to it. Suppose we have two domains having the following structure: [code] class Address { String addressLine1 String addressLine2 static constraints = { } } [\\\/code]\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/grails-unique-constraint-optimization-part-2\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/deepak-krmittal\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/deepak-krmittal\\\/#author\"},\"datePublished\":\"2014-12-30T09:58:40+05:30\",\"dateModified\":\"2014-12-30T09:58:40+05:30\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/\",\"name\":\"TO THE NEW Blog\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Grails unique constraint optimization part 2 | TO THE NEW Blog","description":"In the previous blog Grails performance optimization - Unique constraint we have optimized Grails unique constraint. Now in this blog we will check another use case and will optimize unique constraint according to it. Suppose we have two domains having the following structure: [code] class Address { String addressLine1 String addressLine2 static constraints = { } } [\/code]","canonical_url":"https:\/\/2thenew.xyz\/blog\/grails-unique-constraint-optimization-part-2\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/2thenew.xyz\/blog\/grails-unique-constraint-optimization-part-2\/#article","name":"Grails unique constraint optimization part 2 | TO THE NEW Blog","headline":"Grails unique constraint optimization part 2","author":{"@id":"https:\/\/2thenew.xyz\/blog\/author\/deepak-krmittal\/#author"},"publisher":{"@id":"https:\/\/2thenew.xyz\/blog\/#organization"},"datePublished":"2014-12-30T09:58:40+05:30","dateModified":"2014-12-30T09:58:40+05:30","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/2thenew.xyz\/blog\/grails-unique-constraint-optimization-part-2\/#webpage"},"isPartOf":{"@id":"https:\/\/2thenew.xyz\/blog\/grails-unique-constraint-optimization-part-2\/#webpage"},"articleSection":"Grails, Technology, GORM, Grails, grails constraints, grails hibernate, grails performance optimization, grails unique constraints"},{"@type":"BreadcrumbList","@id":"https:\/\/2thenew.xyz\/blog\/grails-unique-constraint-optimization-part-2\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog#listItem","position":1,"name":"Home","item":"https:\/\/2thenew.xyz\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog\/category\/technology\/#listItem","name":"Technology"}},{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog\/category\/technology\/#listItem","position":2,"name":"Technology","item":"https:\/\/2thenew.xyz\/blog\/category\/technology\/","nextItem":{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog\/grails-unique-constraint-optimization-part-2\/#listItem","name":"Grails unique constraint optimization part 2"},"previousItem":{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog\/grails-unique-constraint-optimization-part-2\/#listItem","position":3,"name":"Grails unique constraint optimization part 2","previousItem":{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog\/category\/technology\/#listItem","name":"Technology"}}]},{"@type":"Organization","@id":"https:\/\/2thenew.xyz\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/2thenew.xyz\/blog\/"},{"@type":"Person","@id":"https:\/\/2thenew.xyz\/blog\/author\/deepak-krmittal\/#author","url":"https:\/\/2thenew.xyz\/blog\/author\/deepak-krmittal\/","name":"Deepak Kumar Mittal","image":{"@type":"ImageObject","@id":"https:\/\/2thenew.xyz\/blog\/grails-unique-constraint-optimization-part-2\/#authorImage","url":"https:\/\/newersworld-sf-static.tothenew.net\/prod\/profilePicFolder\/da9e6037-b214-46e2-8db4-ead6ae22187e_310-Deepak-Kumar-Mittal-PROFILEPICTURE.jpeg","width":96,"height":96,"caption":"Deepak Kumar Mittal"}},{"@type":"WebPage","@id":"https:\/\/2thenew.xyz\/blog\/grails-unique-constraint-optimization-part-2\/#webpage","url":"https:\/\/2thenew.xyz\/blog\/grails-unique-constraint-optimization-part-2\/","name":"Grails unique constraint optimization part 2 | TO THE NEW Blog","description":"In the previous blog Grails performance optimization - Unique constraint we have optimized Grails unique constraint. Now in this blog we will check another use case and will optimize unique constraint according to it. Suppose we have two domains having the following structure: [code] class Address { String addressLine1 String addressLine2 static constraints = { } } [\/code]","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/2thenew.xyz\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/2thenew.xyz\/blog\/grails-unique-constraint-optimization-part-2\/#breadcrumblist"},"author":{"@id":"https:\/\/2thenew.xyz\/blog\/author\/deepak-krmittal\/#author"},"creator":{"@id":"https:\/\/2thenew.xyz\/blog\/author\/deepak-krmittal\/#author"},"datePublished":"2014-12-30T09:58:40+05:30","dateModified":"2014-12-30T09:58:40+05:30"},{"@type":"WebSite","@id":"https:\/\/2thenew.xyz\/blog\/#website","url":"https:\/\/2thenew.xyz\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/2thenew.xyz\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"Grails unique constraint optimization part 2 | TO THE NEW Blog","og:description":"In the previous blog Grails performance optimization - Unique constraint we have optimized Grails unique constraint. Now in this blog we will check another use case and will optimize unique constraint according to it. Suppose we have two domains having the following structure: [code] class Address { String addressLine1 String addressLine2 static constraints = { } } [\/code]","og:url":"https:\/\/2thenew.xyz\/blog\/grails-unique-constraint-optimization-part-2\/","og:image":"https:\/\/2thenew.xyz\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/2thenew.xyz\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"Grails unique constraint optimization part 2 | TO THE NEW Blog","twitter:description":"In the previous blog Grails performance optimization - Unique constraint we have optimized Grails unique constraint. Now in this blog we will check another use case and will optimize unique constraint according to it. Suppose we have two domains having the following structure: [code] class Address { String addressLine1 String addressLine2 static constraints = { } } [\/code]","twitter:image":"https:\/\/2thenew.xyz\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"16512","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2021-04-30 07:45:54","updated":"2024-02-29 10:17:28","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/2thenew.xyz\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/2thenew.xyz\/blog\/category\/technology\/\" title=\"Technology\">Technology<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tGrails unique constraint optimization part 2\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/2thenew.xyz\/blog"},{"label":"Technology","link":"https:\/\/2thenew.xyz\/blog\/category\/technology\/"},{"label":"Grails unique constraint optimization part 2","link":"https:\/\/2thenew.xyz\/blog\/grails-unique-constraint-optimization-part-2\/"}],"_links":{"self":[{"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/posts\/16512","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/users\/145"}],"replies":[{"embeddable":true,"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/comments?post=16512"}],"version-history":[{"count":0,"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/posts\/16512\/revisions"}],"wp:attachment":[{"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/media?parent=16512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/categories?post=16512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/tags?post=16512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}