3
votes

is there a way to filter any gorm query like the Hibernate Filter Plugin (http://grails.org/plugin/hibernate-filter) does but on an easier way without a plugin?

What I need: On every query concerning a concrete model, gorm should check an enabled-attribute. If it's fales gorm should not return it.

Thank you for you help.

1
Did Fabiano's solution work for you? What DB are you using? - Alexander Suraphel

1 Answers

2
votes

You can bypass gorm DSL and use hibernate annotation.

Declare your class with annotation as explained here

and than add all Hibernate Filters Annotation you want as explained here