Only Read and Insert In Domain Class

14 / Nov / 2010 by Sachin 3 comments

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: ‘read-only’
version false
}
[/java]

in the domain class did the trick for me and now, in this domain only read and create is possible. No updates and deletes. 🙂

With Regards
Sachin Anand

FOUND THIS USEFUL? SHARE IT

Tag -

read only

comments (3)

Leave a Reply to New Articles 2015 Cancel reply

Your email address will not be published. Required fields are marked *