{"id":32008,"date":"2016-01-30T20:52:24","date_gmt":"2016-01-30T15:22:24","guid":{"rendered":"https:\/\/tothenewco.pro\/blog\/?p=32008"},"modified":"2016-02-08T15:07:29","modified_gmt":"2016-02-08T09:37:29","slug":"hooking-into-the-instance-methods-of-the-gorm-api","status":"publish","type":"post","link":"https:\/\/tothenewco.pro\/blog\/hooking-into-the-instance-methods-of-the-gorm-api\/","title":{"rendered":"Hooking into the Instance methods of the GORM API"},"content":{"rendered":"<p>In my grails plugin I was needed to add some fields that were common to a set of domains. For eg: for some domains we wanted to store fields like createdBy and lastUpdatedBy to keep track of users who created and last updated each record in that domain.<\/p>\n<p><a title=\"Grails Development\" href=\"https:\/\/tothenewco.pro\/grails-application-development\">Grails framework<\/a> provides timestamping using which we can keep track of the time a record was created and last modified, but doesn&#8217;t provide something for user stamping. Although there is a grails plugin named <code>Audit Logging Plugin<\/code>, that provides this feature. But this plugin has its own limitations and was not a perfect choice for our case. I&#8217;ll discuss the issues with this plugin and the possible solutions in my next blog. Apart from these two fields you may want to add some other fields that are common to multiple domains and their values are populated based on some business logic.<\/p>\n<p><strong>So how to handle this:<\/strong><br \/>\nOne way to handle this scenario is by extending the <code>GormInstanceApi<\/code>. This is the class that contains all the GORM persistence methods which are available to each domain in Grails application. An instance of GormInstanceApi is injected to each domain class which is used to invoke the persistence methods. We&#8217;ll use the decorator design pattern here to override the default instance of GormInstanceApi in each domain.<\/p>\n<ul>\n<li>Create a new class <code>GormInstanceApiDecorator<\/code> that extends <code>GormInstanceApi<\/code>.<\/li>\n<li>Decorate instance of GormInstanceApi with GormInstanceApiDecorator and inject it to each domain.<\/li>\n<\/ul>\n<p>Code for GormInstanceApiDecorator:<\/p>\n<p>[code lang=&#8221;groovy&#8221;]<br \/>\npackage org.tothenew.datastore.gorm<\/p>\n<p>import org.codehaus.groovy.grails.orm.hibernate.HibernateDatastore<br \/>\nimport org.grails.datastore.gorm.GormInstanceApi<br \/>\nimport org.grails.datastore.mapping.core.Session<br \/>\nimport org.grails.datastore.mapping.core.SessionCallback<\/p>\n<p>class GormInstanceApiDecorator&lt;D&gt; extends GormInstanceApi&lt;D&gt; {<\/p>\n<p>\tprivate GormInstanceApi gormInstanceApi<\/p>\n<p>\tGormInstanceApiDecorator(GormInstanceApi gormInstanceApi) {<br \/>\n\t\tsuper(gormInstanceApi.persistentClass, gormInstanceApi.datastore as HibernateDatastore)<br \/>\n\t\tthis.gormInstanceApi = gormInstanceApi<br \/>\n\t}<\/p>\n<p>\t@Override<br \/>\n\tD save(D instance) {<br \/>\n\t\tsave(instance, Collections.emptyMap())<br \/>\n\t}<\/p>\n<p>\t@Override<br \/>\n\tD save(D instance, boolean validate) {<br \/>\n\t\tsave(instance, [validate: validate])<br \/>\n\t}<\/p>\n<p>\t@Override<br \/>\n\tD save(D instance, Map params) {<br \/>\n\t\texecute({ Session session -&gt;<br \/>\n\t\t\tdoSave instance, params, session<br \/>\n\t\t} as SessionCallback)<br \/>\n\t}<\/p>\n<p>\t@Override<br \/>\n\tprotected D doSave(D instance, Map params, Session session, boolean isInsert = false) {<br \/>\n\t\t\/\/method that updates the common properties before instance is saved<br \/>\n\t\tupdateStamp instance<br \/>\n\t\tgormInstanceApi.doSave(instance, params, session, isInsert)<br \/>\n\t}<\/p>\n<p>\tprivate updateStamp(Object instance) {<br \/>\n\t\tString actor = &quot;Sandeep Poonia&quot; \/\/fetch the user who is currently logged in<\/p>\n<p>\t\t\/\/set createdBy- first time only<br \/>\n\t\tif (!instance.id) {<br \/>\n\t\t\t\/\/check if domain has createdBy property<br \/>\n\t\t\tif(instance.hasProperty(&quot;createdBy&quot;){<br \/>\n\t\t\t\tinstance.setProperty(&quot;createdBy&quot;, actor)<br \/>\n\t\t\t}<br \/>\n\t\t}<br \/>\n\t\t\/\/check if domain has lastUpdatedBy property<br \/>\n        if(instance.hasProperty(&quot;lastUpdatedBy&quot;){<br \/>\n        \tinstance.setProperty(&quot;lastUpdatedBy&quot;, actor)<br \/>\n        }<br \/>\n\t}<br \/>\n}<br \/>\n[\/code]<\/p>\n<p>Here I&#8217;m taking the example of save method only. If required same can be done with other methods. Before updating the property, I&#8217;m checking whether that property exists in domain or not. This can be done in a different way or you can modify the dafault instance of GromInstanceApi for those domains only which has these properties.<\/p>\n<p>To inject the GormInstanceApiDecorator instance in each Domain:<br \/>\nAdd below code inside <code>doWithDynamicMethods<\/code> of the plugin-<\/p>\n<p>[code lang=&#8221;groovy&#8221;]<br \/>\ndef doWithDynamicMethods = { context -&gt;<br \/>\n\tcontext.grailsApplication.domainClasses.findAll {<br \/>\n\t\tDefaultGrailsDomainClass domainClass -&gt;<br \/>\n\t\t\t\/\/Domain class should have a db mapping<br \/>\n\t\t\tdomainClass.mappingStrategy in [GrailsDomainClass.GORM, GrailsDomainClass.ORM_MAPPING]<br \/>\n\t}.each {<br \/>\n\t\tDefaultGrailsDomainClass domainClass -&gt;<br \/>\n\t\t\tdef gormInstanceApi = domainClass.clazz.currentGormInstanceApi()<br \/>\n\t\t\tGormInstanceApiDecorator decoratedInstance = new GormInstanceApiDecorator(gormInstanceApi)<br \/>\n\t\t\tdomainClass.clazz.setInstanceGormInstanceApi(decoratedInstance)<br \/>\n\t}<br \/>\n}<br \/>\n[\/code]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my grails plugin I was needed to add some fields that were common to a set of domains. For eg: for some domains we wanted to store fields like createdBy and lastUpdatedBy to keep track of users who created and last updated each record in that domain. Grails framework provides timestamping using which we [&hellip;]<\/p>\n","protected":false},"author":182,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":12,"footnotes":""},"categories":[7],"tags":[29,4840,3078,3030],"class_list":["post-32008","post","type-post","status-publish","format-standard","hentry","category-grails","tag-gorm","tag-grails","tag-grails-gorm","tag-grails-hooks"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.0.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"How to hook into GORM instance methods to do some custom logic or update some properties before an instance is persisted into db.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Sandeep Poonia\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/tothenewco.pro\/blog\/hooking-into-the-instance-methods-of-the-gorm-api\/\" \/>\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=\"Hooking into the Instance methods of the GORM API\" \/>\n\t\t<meta property=\"og:description\" content=\"How to hook into GORM instance methods to do some custom logic or update some properties before an instance is persisted into db.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/tothenewco.pro\/blog\/hooking-into-the-instance-methods-of-the-gorm-api\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/tothenewco.pro\/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=\"Hooking into the Instance methods of the GORM API\" \/>\n\t\t<meta name=\"twitter:description\" content=\"How to hook into GORM instance methods to do some custom logic or update some properties before an instance is persisted into db.\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/tothenewco.pro\/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\\\/hooking-into-the-instance-methods-of-the-gorm-api\\\/#article\",\"name\":\"Hooking into the Instance methods of the GORM API | TO THE NEW Blog\",\"headline\":\"Hooking into the Instance methods of the GORM API\",\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/sandeeppoonia\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#organization\"},\"datePublished\":\"2016-01-30T20:52:24+05:30\",\"dateModified\":\"2016-02-08T15:07:29+05:30\",\"inLanguage\":\"en-US\",\"commentCount\":2,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/hooking-into-the-instance-methods-of-the-gorm-api\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/hooking-into-the-instance-methods-of-the-gorm-api\\\/#webpage\"},\"articleSection\":\"Grails, GORM, Grails, Grails GORM, Grails Hooks\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/hooking-into-the-instance-methods-of-the-gorm-api\\\/#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\\\/hooking-into-the-instance-methods-of-the-gorm-api\\\/#listItem\",\"name\":\"Hooking into the Instance methods of the GORM API\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/hooking-into-the-instance-methods-of-the-gorm-api\\\/#listItem\",\"position\":3,\"name\":\"Hooking into the Instance methods of the GORM API\",\"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\\\/sandeeppoonia\\\/#author\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/sandeeppoonia\\\/\",\"name\":\"Sandeep Poonia\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/hooking-into-the-instance-methods-of-the-gorm-api\\\/#authorImage\",\"url\":\"https:\\\/\\\/newersworld-sf-static.tothenew.net\\\/prod\\\/profilePicFolder\\\/8d46cfd3-1f3e-4c89-85b1-cec1718995da_839-Sandeep-Poonia-PROFILEPICTURE.jpeg\",\"width\":96,\"height\":96,\"caption\":\"Sandeep Poonia\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/hooking-into-the-instance-methods-of-the-gorm-api\\\/#webpage\",\"url\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/hooking-into-the-instance-methods-of-the-gorm-api\\\/\",\"name\":\"Hooking into the Instance methods of the GORM API | TO THE NEW Blog\",\"description\":\"How to hook into GORM instance methods to do some custom logic or update some properties before an instance is persisted into db.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/hooking-into-the-instance-methods-of-the-gorm-api\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/sandeeppoonia\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.tothenew.com\\\/blog\\\/author\\\/sandeeppoonia\\\/#author\"},\"datePublished\":\"2016-01-30T20:52:24+05:30\",\"dateModified\":\"2016-02-08T15:07:29+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":"Hooking into the Instance methods of the GORM API | TO THE NEW Blog","description":"How to hook into GORM instance methods to do some custom logic or update some properties before an instance is persisted into db.","canonical_url":"https:\/\/tothenewco.pro\/blog\/hooking-into-the-instance-methods-of-the-gorm-api\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/tothenewco.pro\/blog\/hooking-into-the-instance-methods-of-the-gorm-api\/#article","name":"Hooking into the Instance methods of the GORM API | TO THE NEW Blog","headline":"Hooking into the Instance methods of the GORM API","author":{"@id":"https:\/\/tothenewco.pro\/blog\/author\/sandeeppoonia\/#author"},"publisher":{"@id":"https:\/\/tothenewco.pro\/blog\/#organization"},"datePublished":"2016-01-30T20:52:24+05:30","dateModified":"2016-02-08T15:07:29+05:30","inLanguage":"en-US","commentCount":2,"mainEntityOfPage":{"@id":"https:\/\/tothenewco.pro\/blog\/hooking-into-the-instance-methods-of-the-gorm-api\/#webpage"},"isPartOf":{"@id":"https:\/\/tothenewco.pro\/blog\/hooking-into-the-instance-methods-of-the-gorm-api\/#webpage"},"articleSection":"Grails, GORM, Grails, Grails GORM, Grails Hooks"},{"@type":"BreadcrumbList","@id":"https:\/\/tothenewco.pro\/blog\/hooking-into-the-instance-methods-of-the-gorm-api\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog#listItem","position":1,"name":"Home","item":"https:\/\/tothenewco.pro\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/category\/grails\/#listItem","name":"Grails"}},{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/category\/grails\/#listItem","position":2,"name":"Grails","item":"https:\/\/tothenewco.pro\/blog\/category\/grails\/","nextItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/hooking-into-the-instance-methods-of-the-gorm-api\/#listItem","name":"Hooking into the Instance methods of the GORM API"},"previousItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/hooking-into-the-instance-methods-of-the-gorm-api\/#listItem","position":3,"name":"Hooking into the Instance methods of the GORM API","previousItem":{"@type":"ListItem","@id":"https:\/\/tothenewco.pro\/blog\/category\/grails\/#listItem","name":"Grails"}}]},{"@type":"Organization","@id":"https:\/\/tothenewco.pro\/blog\/#organization","name":"TO THE NEW Blog","url":"https:\/\/tothenewco.pro\/blog\/"},{"@type":"Person","@id":"https:\/\/tothenewco.pro\/blog\/author\/sandeeppoonia\/#author","url":"https:\/\/tothenewco.pro\/blog\/author\/sandeeppoonia\/","name":"Sandeep Poonia","image":{"@type":"ImageObject","@id":"https:\/\/tothenewco.pro\/blog\/hooking-into-the-instance-methods-of-the-gorm-api\/#authorImage","url":"https:\/\/newersworld-sf-static.tothenew.net\/prod\/profilePicFolder\/8d46cfd3-1f3e-4c89-85b1-cec1718995da_839-Sandeep-Poonia-PROFILEPICTURE.jpeg","width":96,"height":96,"caption":"Sandeep Poonia"}},{"@type":"WebPage","@id":"https:\/\/tothenewco.pro\/blog\/hooking-into-the-instance-methods-of-the-gorm-api\/#webpage","url":"https:\/\/tothenewco.pro\/blog\/hooking-into-the-instance-methods-of-the-gorm-api\/","name":"Hooking into the Instance methods of the GORM API | TO THE NEW Blog","description":"How to hook into GORM instance methods to do some custom logic or update some properties before an instance is persisted into db.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/tothenewco.pro\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/tothenewco.pro\/blog\/hooking-into-the-instance-methods-of-the-gorm-api\/#breadcrumblist"},"author":{"@id":"https:\/\/tothenewco.pro\/blog\/author\/sandeeppoonia\/#author"},"creator":{"@id":"https:\/\/tothenewco.pro\/blog\/author\/sandeeppoonia\/#author"},"datePublished":"2016-01-30T20:52:24+05:30","dateModified":"2016-02-08T15:07:29+05:30"},{"@type":"WebSite","@id":"https:\/\/tothenewco.pro\/blog\/#website","url":"https:\/\/tothenewco.pro\/blog\/","name":"TO THE NEW Blog","inLanguage":"en-US","publisher":{"@id":"https:\/\/tothenewco.pro\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"TO THE NEW BLOG","og:type":"blog","og:title":"Hooking into the Instance methods of the GORM API","og:description":"How to hook into GORM instance methods to do some custom logic or update some properties before an instance is persisted into db.","og:url":"https:\/\/tothenewco.pro\/blog\/hooking-into-the-instance-methods-of-the-gorm-api\/","og:image":"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","og:image:secure_url":"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png","twitter:card":"summary","twitter:site":"@tothenew","twitter:title":"Hooking into the Instance methods of the GORM API","twitter:description":"How to hook into GORM instance methods to do some custom logic or update some properties before an instance is persisted into db.","twitter:image":"https:\/\/tothenewco.pro\/blog\/wp-content\/themes\/ttn\/images\/social-logo.png"},"aioseo_meta_data":{"post_id":"32008","title":null,"description":"How to hook into GORM instance methods to do some custom logic or update some properties before an instance is persisted into db.","keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":"Hooking into the Instance methods of the GORM API","og_description":"How to hook into GORM instance methods to do some custom logic or update some properties before an instance is persisted into db.","og_object_type":"blog","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":"","og_custom_url":null,"og_article_section":"","og_article_tags":"","twitter_use_og":false,"twitter_card":"summary","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 14:28:57","updated":"2024-02-29 09:13:24","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:\/\/tothenewco.pro\/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:\/\/tothenewco.pro\/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\tHooking into the Instance methods of the GORM API\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/tothenewco.pro\/blog"},{"label":"Grails","link":"https:\/\/tothenewco.pro\/blog\/category\/grails\/"},{"label":"Hooking into the Instance methods of the GORM API","link":"https:\/\/tothenewco.pro\/blog\/hooking-into-the-instance-methods-of-the-gorm-api\/"}],"_links":{"self":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/posts\/32008","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/users\/182"}],"replies":[{"embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/comments?post=32008"}],"version-history":[{"count":0,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/posts\/32008\/revisions"}],"wp:attachment":[{"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/media?parent=32008"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/categories?post=32008"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tothenewco.pro\/blog\/wp-json\/wp\/v2\/tags?post=32008"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}