Groovy Documentation

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

    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.CountByPersistentMethod

    public class CountByPersistentMethod
    extends AbstractClausedStaticPersistentMethod

Dynamic method that allows counting the values of the specified property names eg. Account.countByBranch('London') // returns how many accounts are in london

Authors:
  Graeme Rocher

Field Summary

Fields inherited from class AbstractClausedStaticPersistentMethod
application

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

Method Summary
`protected java.lang.Object` | `doInvokeInternalWithExpressions(java.lang.Class clazz, java.lang.String methodName, Object[] arguments, java.util.List expressions, java.lang.String operatorInUse, groovy.lang.Closure additionalCriteria)`
`protected void` | `populateCriteriaWithExpressions(Criteria crit, java.lang.String operator, java.util.List expressions)`

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

### CountByPersistentMethod

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

Method Detail

### doInvokeInternalWithExpressions

    @SuppressWarnings("rawtypes")
    @Override
    protected java.lang.Object doInvokeInternalWithExpressions(java.lang.Class clazz, java.lang.String methodName, Object[] arguments, java.util.List expressions, java.lang.String operatorInUse, groovy.lang.Closure additionalCriteria)

### populateCriteriaWithExpressions

    @SuppressWarnings({ "unchecked", "rawtypes" })
    protected void populateCriteriaWithExpressions(Criteria crit, java.lang.String operator, java.util.List expressions)

Groovy Documentation