n33dle
n33dle

Reputation: 289

Grails: Filter gorm query

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.

Upvotes: 3

Views: 1138

Answers (1)

Fabiano Taioli
Fabiano Taioli

Reputation: 5540

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

Upvotes: 2

Related Questions