Groovy Documentation

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

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.AbstractFindByPersistentMethod
                  org.codehaus.groovy.grails.orm.hibernate.metaclass.FindByPersistentMethod

public class FindByPersistentMethod
extends AbstractFindByPersistentMethod

The "findBy*" static persistent method. This method allows querying for instances of grails domain classes based on their properties. This method returns the first result of the query eg. Account.findByHolder("Joe Blogs"); // Where class "Account" has a property called "holder" Account.findByHolderAndBranch("Joe Blogs", "London"); // Where class "Account" has a properties called "holder" and "branch"

Authors:
Graeme Rocher
Since:
31-Aug-2005


Field Summary
 
Fields inherited from class AbstractFindByPersistentMethod
OPERATORS, OPERATOR_AND, OPERATOR_OR
 
Fields inherited from class AbstractStaticPersistentMethod
application
 
Constructor Summary
FindByPersistentMethod(HibernateDatastore datastore, GrailsApplication application, org.hibernate.SessionFactory sessionFactory, java.lang.ClassLoader classLoader)

Constructor.

 
Method Summary
 
Methods inherited from class AbstractFindByPersistentMethod
buildCriteria, doInvokeInternalWithExpressions, firstExpressionIsRequiredBoolean, getResult
 
Methods inherited from class AbstractClausedStaticPersistentMethod
AbstractClausedStaticPersistentMethod, doInvokeInternal, doInvokeInternal, doInvokeInternal, doInvokeInternalWithExpressions
 
Methods inherited from class AbstractStaticPersistentMethod
doInvokeInternal, doInvokeInternal, getCriteria, getHibernateTemplate, invoke, invoke, invoke
 
Methods inherited from class AbstractStaticMethodInvocation
getPattern, invoke, isMethodMatch, setPattern, setPattern, toString
 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Constructor Detail

FindByPersistentMethod

public FindByPersistentMethod(HibernateDatastore datastore, GrailsApplication application, org.hibernate.SessionFactory sessionFactory, java.lang.ClassLoader classLoader)
Constructor.
Parameters:
application
sessionFactory
classLoader


 

Groovy Documentation