Piotr Chowaniec
Piotr Chowaniec

Reputation: 1230

Adding condition to findAll and findAllBy methods

In my domain class User I would like to have boolean flag active. Is there any way to override methods like User.findAll and User.findAllBy... by adding condition active == true?

What I want to achieve is calling User.findAll means find all users where active is true, and calling dynamic method like User.findAllByName('mike') will return all users with name mike and active flag set to true.

My grails version is 3.0.3

Upvotes: 2

Views: 620

Answers (1)

Piotr Chowaniec
Piotr Chowaniec

Reputation: 1230

I've migrated original hibernate-filter plugin to be able to use it with new Grails 3. New version is published at official Grails 3 plugins repository with grails-hibernate-filter name, direct link to plugin here

Upvotes: 3

Related Questions