Is there any recommended way to restrict the visibility of a domain in grails?
Normally you you do something like to get some interface for external use:
def productList = Product.list()
withFormat {
html {[productList:productList]}
json { render productList as JSON }
xml { render productList as XML }
rss { render(feedType:"rss", productList)}
}
which is equal to
SELECT * FROM product
But by default there proerties in a domain that should not be populated. So I need something to say
SELECT id, name, foo1, foo2 FROM product
so only a list of properties is included in the answer.