Groovy Documentation

## org.codehaus.groovy.grails.orm.hibernate.metaclass
[Java] Class FindByBooleanPropertyPersistentMethod

    java.lang.Object
      org.codehaus.groovy.grails.commons.metaclass.AbstractStaticMethodInvocation
          org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractStaticPersistentMethod
              org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractClausedStaticPersistentMethod
                  org.codehaus.groovy.grails.orm.hibernate.metaclass.FindByPersistentMethod
                      org.codehaus.groovy.grails.orm.hibernate.metaclass.FindByBooleanPropertyPersistentMethod

    public class FindByBooleanPropertyPersistentMethod
    extends FindByPersistentMethod

The "find<booleanProperty>By*" static persistent method. This method allows querying for instances of grails domain classes based on a boolean property and any other arbitrary properties. This method returns the first result of the query. eg. Account.findActiveByHolder("Joe Blogs"); // Where class "Account" has a properties called "active" and "holder" Account.findActiveByHolderAndBranch("Joe Blogs", "London"); // Where class "Account" has a properties called "active', "holder" and "branch" In both of those queries, the query will only select Account objects where active=true.

Authors:
  Jeff Brown

Field Summary

Fields inherited from class AbstractClausedStaticPersistentMethod
application

Constructor Summary
`FindByBooleanPropertyPersistentMethod(GrailsApplication application, SessionFactory sessionFactory, java.lang.ClassLoader classLoader)`

Method Summary
`protected boolean` | `firstExpressionIsRequiredBoolean()`

Methods inherited from class FindByPersistentMethod
doInvokeInternalWithExpressions, firstExpressionIsRequiredBoolean

Methods inherited from class AbstractClausedStaticPersistentMethod
AbstractClausedStaticPersistentMethod, doInvokeInternal, doInvokeInternalWithExpressions

Methods inherited from class AbstractStaticPersistentMethod
doInvokeInternal, getCriteria, getHibernateTemplate, invoke, invoke

Methods inherited from class AbstractStaticMethodInvocation
getPattern, invoke, isMethodMatch, setPattern, toString

Constructor Detail

### FindByBooleanPropertyPersistentMethod

    public FindByBooleanPropertyPersistentMethod(GrailsApplication application, SessionFactory sessionFactory, java.lang.ClassLoader classLoader)

Method Detail

### firstExpressionIsRequiredBoolean

    @Override
    protected boolean firstExpressionIsRequiredBoolean()

Groovy Documentation