{"id":1993,"date":"2010-11-14T22:28:06","date_gmt":"2010-11-14T16:58:06","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=1993"},"modified":"2010-11-14T22:28:53","modified_gmt":"2010-11-14T16:58:53","slug":"only-read-and-insert-in-domain-class","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/only-read-and-insert-in-domain-class\/","title":{"rendered":"Only Read and Insert In Domain Class"},"content":{"rendered":"<p>In my recent Project, I wanted to create a domain class in which records could only be added and read and no update was to be allowed on any of the records and I found a very nice way of doing it. Adding<br \/>\n[java]<br \/>\nstatic mapping = {<br \/>\n    cache usage: &#8216;read-only&#8217;<br \/>\n    version false<br \/>\n  }<br \/>\n[\/java] <\/p>\n<p>in the domain class did the trick for me and now, in this domain only read and create is possible. No updates and deletes. \ud83d\ude42<\/p>\n<p>With Regards<br \/>\nSachin Anand<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my recent Project, I wanted to create a domain class in which records could only be added and read and no update was to be allowed on any of the records and I found a very nice way of doing it. Adding [java] static mapping = { cache usage: &#8216;read-only&#8217; version false } [\/java] [&hellip;]<\/p>\n","protected":false},"author":14,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":1},"categories":[7],"tags":[457],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/1993"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=1993"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/1993\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=1993"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=1993"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=1993"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}