org.codehaus.groovy.grails.orm.hibernate.metaclass
Class FindAllByPersistentMethod
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.FindAllByPersistentMethod
- All Implemented Interfaces:
- org.codehaus.groovy.grails.commons.metaclass.StaticMethodInvocation, org.grails.datastore.gorm.finders.FinderMethod
- Direct Known Subclasses:
- FindAllByBooleanPropertyPersistentMethod
public class FindAllByPersistentMethod
- extends AbstractClausedStaticPersistentMethod
The "findBy*" static persistent method. This method allows querying for
instances of grails domain classes based on their properties. This method returns a list of all found results
eg.
Account.findAllByHolder("Joe Blogs"); // Where class "Account" has a property called "holder"
Account.findAllByHolderAndBranch("Joe Blogs", "London"); // Where class "Account" has a properties called "holder" and "branch"
|
Constructor Summary |
FindAllByPersistentMethod(HibernateDatastore datastore,
org.codehaus.groovy.grails.commons.GrailsApplication application,
org.hibernate.SessionFactory sessionFactory,
java.lang.ClassLoader classLoader)
Constructor. |
|
Method Summary |
protected java.lang.Object |
doInvokeInternalWithExpressions(java.lang.Class clazz,
java.lang.String methodName,
java.lang.Object[] arguments,
java.util.List expressions,
java.lang.String operatorInUse,
grails.gorm.DetachedCriteria detachedCriteria,
groovy.lang.Closure additionalCriteria)
|
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.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 |
FindAllByPersistentMethod
public FindAllByPersistentMethod(HibernateDatastore datastore,
org.codehaus.groovy.grails.commons.GrailsApplication application,
org.hibernate.SessionFactory sessionFactory,
java.lang.ClassLoader classLoader)
- Constructor.
- Parameters:
application - sessionFactory - classLoader -
doInvokeInternalWithExpressions
protected java.lang.Object doInvokeInternalWithExpressions(java.lang.Class clazz,
java.lang.String methodName,
java.lang.Object[] arguments,
java.util.List expressions,
java.lang.String operatorInUse,
grails.gorm.DetachedCriteria detachedCriteria,
groovy.lang.Closure additionalCriteria)
- Specified by:
doInvokeInternalWithExpressions in class AbstractClausedStaticPersistentMethod
firstExpressionIsRequiredBoolean
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.
- Returns:
- true if the first expression is a required boolean property, false otherwise
- See Also:
FindAllByBooleanPropertyPersistentMethod