Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use criteria clousure, i need more information about it #43

Open
angelique360 opened this issue Mar 1, 2019 · 2 comments
Open

Comments

@angelique360
Copy link

I need to use Restrictions, for example:

Restrictions:
eq
isNotNull

But i dont now how implement in search().list {} clousure

I am trying to do something like this:

def myDomainClasses = Book.search().list {

        criteria{
            Restrictions.isNotNull("id_author")
        }

}

@pabloto88
Copy link

Hi @angelique360 , Did you resolve this problem? I have the same issue, I know that there is "Must" and "MustNot" but it doesn't work! I don't know what happen. I'm new in Grails and I'm working with a main entity and 4 childs entities.

@angelique360
Copy link
Author

Que onda amigo veo que eres de ecuador, mira a si logre hacer funcionar, ahí te van unos ejemplos:

criteria{
add(Restrictions.isNull("fechaBaja"))
if(aseguradora){
add(Restrictions.eq("aseguradora",aseguradora))
}
}

Saludos desde México

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants