{"id":3971,"date":"2011-07-01T14:01:04","date_gmt":"2011-07-01T08:31:04","guid":{"rendered":"https:\/\/2thenew.xyz\/blog\/?p=3971"},"modified":"2016-12-19T15:06:15","modified_gmt":"2016-12-19T09:36:15","slug":"grails-data-binding-criteria-reuse","status":"publish","type":"post","link":"https:\/\/2thenew.xyz\/blog\/grails-data-binding-criteria-reuse\/","title":{"rendered":"Grails Data Binding &#038; criteria reuse"},"content":{"rendered":"<p>Data Binding in grails is something that I love alot. In most of the cases we look at the Binding with respect to some domain class but binding can be one of the best candidate for searching and filtration.<br \/>\nIn my recent project we had a domain Class Article and the user could filter articles on different criteria. The page looks something like following<\/p>\n<p><a href=\"\/blog\/wp-ttn-blog\/uploads\/2011\/07\/Vis\u00e3o-geral-dos-autores_1309498803105.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3974\" title=\"Vis\u00e3o geral dos autores_1309498803105\" src=\"\/blog\/wp-ttn-blog\/uploads\/2011\/07\/Vis\u00e3o-geral-dos-autores_1309498803105.png\" alt=\"Blog image\" width=\"700\" height=\"445\" \/><\/a><\/p>\n<p>We had 3-4 such pages but with some extra states (Enum property) of article. So for doing this we created two CO classes, one for basic search properties like max, offset, order and sort and other for article related fields. So the CO goes like following<\/p>\n<p>[java]<br \/>\nclass SearchCO {<br \/>\n  Integer max = 10<br \/>\n  Integer offset = 0<br \/>\n  String sort = &quot;id&quot;<br \/>\n  String order = &quot;asc&quot;<\/p>\n<p>  def searchCriteria = {<br \/>\n    order(sort, order)<br \/>\n  }<br \/>\n}<\/p>\n<p>class ArticleSearchCO extends SearchCO {<br \/>\n  List&lt;ArticleType&gt; types  \/\/ This is Enum<br \/>\n  List&lt;Long&gt; styleIds<br \/>\n  List&lt;Long&gt; categoryIds<br \/>\n  String topic<br \/>\n  def searchCriteria = {<br \/>\n     and {<br \/>\n      if (topic) {<br \/>\n        ilike(&quot;topic&quot;, &quot;%${topic}%&quot;)<br \/>\n      }<\/p>\n<p>      if (categoryIds) {<br \/>\n        subCategory {<br \/>\n              inList(&quot;id&quot;, categoryIds)<br \/>\n          }<br \/>\n      }<\/p>\n<p>      if (styleIds) {<br \/>\n        writingStyle {<br \/>\n             inList(&quot;id&quot;, styleIds)<br \/>\n         }<br \/>\n      }<\/p>\n<p>      if (types) {<br \/>\n            inList(&quot;type&quot;, types)<br \/>\n        }<br \/>\n    }<br \/>\n    super.searchCriteria<br \/>\n  }<br \/>\n}<br \/>\n[\/java]<\/p>\n<p>In our controller side we got the fully populated object that can be used for searching the different articles based on searching. So our controller side code was something like<\/p>\n<p>[java]<br \/>\ndef findWork = {ArticleSearchCO co -&gt;<br \/>\n    List&lt;Article&gt; articles = authorService.findWork(co)<br \/>\n    render(template:&quot;articles&quot;,model:[articles:articles,totalCount:articles.totalCount])<br \/>\n}<\/p>\n<p>def currentWork = {ArticleSearchCO co -&gt;<br \/>\n    List&lt;Article&gt; articles = authorService.currentWork(co)<br \/>\n    render(template:&quot;articles&quot;,model:[articles:articles,totalCount:articles.totalCount])<br \/>\n}<br \/>\n[\/java]<\/p>\n<p>As I already have the searching closures in my CO so the code in my service was something like<\/p>\n<p>[java]<br \/>\npublic List&lt;Article&gt; findWork(ArticleSearchCO co) {<br \/>\n    def articleCriteria = Article.createCriteria()<br \/>\n    Closure searchCriteria = co.searchCriteria<br \/>\n    searchCriteria.delegate = articleCriteria<br \/>\n    List&lt;Article&gt; articles = articleCriteria.list([max: co.max, offset: co.offset]) {<br \/>\n      eq(&quot;status&quot;, ArticleStatus.Unassigned)<br \/>\n      searchCriteria()<br \/>\n    }<br \/>\n    return articles<br \/>\n  }<br \/>\n[\/java]<\/p>\n<p>In the same way for currentWork method I just changed the status i.e; ArticleStatus.InProgress. Thats how I handled the searching, filtering, pagination which was all Ajax. I tried to make my code as DRY as possible . There are still few things that I dont like about it one is so many if statements and other is delegating the searching criteria in each method. I think now with the support of namedQuery I can optimize the method.<br \/>\n<\/p>\n<p>Hope it helps<br \/>\n<a href=\"https:\/\/2thenew.xyz\/blog\/author\/uday\/\">Uday Pratap Singh<\/a><br \/>\n<a href=\"mailto:uday@intelligrape.com\">uday@intelligrape.com<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Data Binding in grails is something that I love alot. In most of the cases we look at the Binding with respect to some domain class but binding can be one of the best candidate for searching and filtration. In my recent project we had a domain Class Article and the user could filter articles [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":34,"footnotes":""},"categories":[7],"tags":[602,606,607,601,604,605],"class_list":["post-3971","post","type-post","status-publish","format-standard","hentry","category-grails","tag-bind-data-in-grails","tag-grails-createcriteria","tag-how-to-create-conditional-query-in-grails","tag-how-to-reuse-grails-criteria","tag-searching-and-filteration-in-grails","tag-usage-of-command-objects"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Data Binding in grails is something that I love alot. In most of the cases we look at the Binding with respect to some domain class but binding can be one of the best candidate for searching and filtration. In my recent project we had a domain Class Article and the user could filter articles\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Uday Pratap Singh\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/2thenew.xyz\/blog\/grails-data-binding-criteria-reuse\/\" \/>\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 Data Binding &amp; criteria reuse | TO THE NEW Blog\" \/>\n\t\t<meta property=\"og:description\" content=\"Data Binding in grails is something that I love alot. In most of the cases we look at the Binding with respect to some domain class but binding can be one of the best candidate for searching and filtration. In my recent project we had a domain Class Article and the user could filter articles\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/2thenew.xyz\/blog\/grails-data-binding-criteria-reuse\/\" \/>\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 Data Binding &amp; criteria reuse | TO THE NEW Blog\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Data Binding in grails is something that I love alot. In most of the cases we look at the Binding with respect to some domain class but binding can be one of the best candidate for searching and filtration. In my recent project we had a domain Class Article and the user could filter articles\" \/>\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-data-binding-criteria-reuse\\\/#article\",\"name\":\"Grails Data Binding & criteria reuse | TO THE NEW Blog\",\"headline\":\"Grails Data Binding &#038; criteria reuse\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/uday\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"\\\/blog\\\/wp-ttn-blog\\\/uploads\\\/2011\\\/07\\\/Vis\\u00e3o-geral-dos-autores_1309498803105.png\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/grails-data-binding-criteria-reuse\\\/#articleImage\"},\"datePublished\":\"2011-07-01T14:01:04+05:30\",\"dateModified\":\"2016-12-19T15:06:15+05:30\",\"inLanguage\":\"en-US\",\"commentCount\":1,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/grails-data-binding-criteria-reuse\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/grails-data-binding-criteria-reuse\\\/#webpage\"},\"articleSection\":\"Grails, bind data in grails, grails createCriteria, How to create conditional query in grails, How to reuse grails criteria, Searching and filteration in grails, Usage of command objects\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/grails-data-binding-criteria-reuse\\\/#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\\\/grails\\\/#listItem\",\"name\":\"Grails\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/grails\\\/#listItem\",\"position\":2,\"name\":\"Grails\",\"item\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/grails\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/grails-data-binding-criteria-reuse\\\/#listItem\",\"name\":\"Grails Data Binding &#038; criteria reuse\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/grails-data-binding-criteria-reuse\\\/#listItem\",\"position\":3,\"name\":\"Grails Data Binding &#038; criteria reuse\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/category\\\/grails\\\/#listItem\",\"name\":\"Grails\"}}]},{\"@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\\\/uday\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/uday\\\/\",\"name\":\"Uday Pratap Singh\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/grails-data-binding-criteria-reuse\\\/#authorImage\",\"url\":\"https:\\\/\\\/newersworld-sf-static.tothenew.net\\\/prod\\\/profilePicFolder\\\/d4c98503-ff55-4112-8fc2-e3c4fcc6fc3a_282-Uday-Pratap-Singh-PROFILEPICTURE.jpeg\",\"width\":96,\"height\":96,\"caption\":\"Uday Pratap Singh\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/grails-data-binding-criteria-reuse\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/grails-data-binding-criteria-reuse\\\/\",\"name\":\"Grails Data Binding & criteria reuse | TO THE NEW Blog\",\"description\":\"Data Binding in grails is something that I love alot. In most of the cases we look at the Binding with respect to some domain class but binding can be one of the best candidate for searching and filtration. In my recent project we had a domain Class Article and the user could filter articles\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/grails-data-binding-criteria-reuse\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/uday\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/uday\\\/#author\"},\"datePublished\":\"2011-07-01T14:01:04+05:30\",\"dateModified\":\"2016-12-19T15:06:15+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 Data Binding & criteria reuse | TO THE NEW Blog","description":"Data Binding in grails is something that I love alot. In most of the cases we look at the Binding with respect to some domain class but binding can be one of the best candidate for searching and filtration. In my recent project we had a domain Class Article and the user could filter articles","canonical_url":"https:\/\/2thenew.xyz\/blog\/grails-data-binding-criteria-reuse\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/2thenew.xyz\/blog\/grails-data-binding-criteria-reuse\/#article","name":"Grails Data Binding & criteria reuse | TO THE NEW Blog","headline":"Grails Data Binding &#038; criteria reuse","author":{"@id":"https:\/\/2thenew.xyz\/blog\/author\/uday\/#author"},"publisher":{"@id":"https:\/\/2thenew.xyz\/blog\/#organization"},"image":{"@type":"ImageObject","url":"\/blog\/wp-ttn-blog\/uploads\/2011\/07\/Vis\u00e3o-geral-dos-autores_1309498803105.png","@id":"https:\/\/2thenew.xyz\/blog\/grails-data-binding-criteria-reuse\/#articleImage"},"datePublished":"2011-07-01T14:01:04+05:30","dateModified":"2016-12-19T15:06:15+05:30","inLanguage":"en-US","commentCount":1,"mainEntityOfPage":{"@id":"https:\/\/2thenew.xyz\/blog\/grails-data-binding-criteria-reuse\/#webpage"},"isPartOf":{"@id":"https:\/\/2thenew.xyz\/blog\/grails-data-binding-criteria-reuse\/#webpage"},"articleSection":"Grails, bind data in grails, grails createCriteria, How to create conditional query in grails, How to reuse grails criteria, Searching and filteration in grails, Usage of command objects"},{"@type":"BreadcrumbList","@id":"https:\/\/2thenew.xyz\/blog\/grails-data-binding-criteria-reuse\/#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\/grails\/#listItem","name":"Grails"}},{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog\/category\/grails\/#listItem","position":2,"name":"Grails","item":"https:\/\/2thenew.xyz\/blog\/category\/grails\/","nextItem":{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog\/grails-data-binding-criteria-reuse\/#listItem","name":"Grails Data Binding &#038; criteria reuse"},"previousItem":{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog\/grails-data-binding-criteria-reuse\/#listItem","position":3,"name":"Grails Data Binding &#038; criteria reuse","previousItem":{"@type":"ListItem","@id":"https:\/\/2thenew.xyz\/blog\/category\/grails\/#listItem","name":"Grails"}}]},{"@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\/uday\/#author","url":"https:\/\/2thenew.xyz\/blog\/author\/uday\/","name":"Uday Pratap Singh","image":{"@type":"ImageObject","@id":"https:\/\/2thenew.xyz\/blog\/grails-data-binding-criteria-reuse\/#authorImage","url":"https:\/\/newersworld-sf-static.tothenew.net\/prod\/profilePicFolder\/d4c98503-ff55-4112-8fc2-e3c4fcc6fc3a_282-Uday-Pratap-Singh-PROFILEPICTURE.jpeg","width":96,"height":96,"caption":"Uday Pratap Singh"}},{"@type":"WebPage","@id":"https:\/\/2thenew.xyz\/blog\/grails-data-binding-criteria-reuse\/#webpage","url":"https:\/\/2thenew.xyz\/blog\/grails-data-binding-criteria-reuse\/","name":"Grails Data Binding & criteria reuse | TO THE NEW Blog","description":"Data Binding in grails is something that I love alot. In most of the cases we look at the Binding with respect to some domain class but binding can be one of the best candidate for searching and filtration. In my recent project we had a domain Class Article and the user could filter articles","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/2thenew.xyz\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/2thenew.xyz\/blog\/grails-data-binding-criteria-reuse\/#breadcrumblist"},"author":{"@id":"https:\/\/2thenew.xyz\/blog\/author\/uday\/#author"},"creator":{"@id":"https:\/\/2thenew.xyz\/blog\/author\/uday\/#author"},"datePublished":"2011-07-01T14:01:04+05:30","dateModified":"2016-12-19T15:06:15+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 Data Binding &amp; criteria reuse | TO THE NEW Blog","og:description":"Data Binding in grails is something that I love alot. In most of the cases we look at the Binding with respect to some domain class but binding can be one of the best candidate for searching and filtration. In my recent project we had a domain Class Article and the user could filter articles","og:url":"https:\/\/2thenew.xyz\/blog\/grails-data-binding-criteria-reuse\/","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 Data Binding &amp; criteria reuse | TO THE NEW Blog","twitter:description":"Data Binding in grails is something that I love alot. In most of the cases we look at the Binding with respect to some domain class but binding can be one of the best candidate for searching and filtration. In my recent project we had a domain Class Article and the user could filter articles","twitter:image":"https:\/\/2thenew.xyz\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"3971","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-29 19:44:43","updated":"2024-02-29 09:30:27","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\/grails\/\" title=\"Grails\">Grails<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tGrails Data Binding &amp; criteria reuse\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/2thenew.xyz\/blog"},{"label":"Grails","link":"https:\/\/2thenew.xyz\/blog\/category\/grails\/"},{"label":"Grails Data Binding &#038; criteria reuse","link":"https:\/\/2thenew.xyz\/blog\/grails-data-binding-criteria-reuse\/"}],"_links":{"self":[{"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/posts\/3971","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\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/comments?post=3971"}],"version-history":[{"count":0,"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/posts\/3971\/revisions"}],"wp:attachment":[{"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/media?parent=3971"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/categories?post=3971"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2thenew.xyz\/blog\/wp-json\/wp\/v2\/tags?post=3971"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}