org.codehaus.groovy.grails.orm.hibernate.metaclass
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
- All Implemented Interfaces:
- StaticMethodInvocation
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.
- Author:
- Jeff Brown
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. |
FindByBooleanPropertyPersistentMethod
public FindByBooleanPropertyPersistentMethod(GrailsApplication application,
org.hibernate.SessionFactory sessionFactory,
ClassLoader classLoader)
firstExpressionIsRequiredBoolean
protected boolean firstExpressionIsRequiredBoolean()
- Description copied from class:
FindByPersistentMethod
- 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 FindByPersistentMethod
- Returns:
- true if the first expression is a required boolean property, false otherwise
- See Also:
FindByBooleanPropertyPersistentMethod
Copyright (c) 2005-2009 The Grails project