org.codehaus.groovy.grails.orm.hibernate.metaclass
Class FindByBooleanPropertyPersistentMethod

java.lang.Object
  extended by org.codehaus.groovy.grails.commons.metaclass.AbstractStaticMethodInvocation
      extended by org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractStaticPersistentMethod
          extended by org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractClausedStaticPersistentMethod
              extended by org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractFindByPersistentMethod
                  extended by org.codehaus.groovy.grails.orm.hibernate.metaclass.FindByPersistentMethod
                      extended by org.codehaus.groovy.grails.orm.hibernate.metaclass.FindByBooleanPropertyPersistentMethod
All Implemented Interfaces:
org.codehaus.groovy.grails.commons.metaclass.StaticMethodInvocation, org.grails.datastore.gorm.finders.FinderMethod

public class FindByBooleanPropertyPersistentMethod
extends FindByPersistentMethod

The "findBy*" 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.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractClausedStaticPersistentMethod
AbstractClausedStaticPersistentMethod.GrailsMethodExpression
 
Field Summary
 
Fields inherited from class org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractFindByPersistentMethod
OPERATOR_AND, OPERATOR_OR, OPERATORS
 
Fields inherited from class org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractStaticPersistentMethod
application
 
Constructor Summary
FindByBooleanPropertyPersistentMethod(HibernateDatastore datastore, org.codehaus.groovy.grails.commons.GrailsApplication application, org.hibernate.SessionFactory sessionFactory, java.lang.ClassLoader classLoader)
           
 
Method Summary
protected  boolean firstExpressionIsRequiredBoolean()
          Indicates if the first expression in the query is a required boolean property and as such should be ANDed to the other expressions, not ORed.
 
Methods inherited from class org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractFindByPersistentMethod
buildCriteria, doInvokeInternalWithExpressions, getResult
 
Methods inherited from class org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractClausedStaticPersistentMethod
doInvokeInternal, doInvokeInternal, doInvokeInternal
 
Methods inherited from class org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractStaticPersistentMethod
getCriteria, getHibernateTemplate, invoke, invoke, invoke
 
Methods inherited from class org.codehaus.groovy.grails.commons.metaclass.AbstractStaticMethodInvocation
getPattern, isMethodMatch, setPattern, setPattern, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.grails.datastore.gorm.finders.FinderMethod
isMethodMatch, setPattern
 

Constructor Detail

FindByBooleanPropertyPersistentMethod

public FindByBooleanPropertyPersistentMethod(HibernateDatastore datastore,
                                             org.codehaus.groovy.grails.commons.GrailsApplication application,
                                             org.hibernate.SessionFactory sessionFactory,
                                             java.lang.ClassLoader classLoader)
Method Detail

firstExpressionIsRequiredBoolean

protected boolean firstExpressionIsRequiredBoolean()
Description copied from class: AbstractFindByPersistentMethod
Indicates if the first expression in the query is a required boolean property and as such should be ANDed to the other expressions, not ORed.

Overrides:
firstExpressionIsRequiredBoolean in class AbstractFindByPersistentMethod
Returns:
true if the first expression is a required boolean property, false otherwise
See Also:
FindByBooleanPropertyPersistentMethod