# ExecuteQueryPersistentMethod (Grails 1.3.6)
Date: 2010-12-15

Groovy Documentation

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

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

    public class ExecuteQueryPersistentMethod
    extends AbstractStaticPersistentMethod

Allows the executing of arbitrary HQL queries.

eg. Account.executeQuery("select distinct a.number from Account a where a.branch = ?", 'London') or Account.executeQuery("select distinct a.number from Account a where a.branch = :branch", [branch:'London'])

Authors:
  Graeme Rocher
  Sergey Nebolsin

See Also:

Since:
  30-Apr-2006

Field Summary
`static SimpleTypeConverter` | `converter`

Constructor Summary
`ExecuteQueryPersistentMethod(SessionFactory sessionFactory, java.lang.ClassLoader classLoader)`

Method Summary
`protected java.lang.Object` | `doInvokeInternal(java.lang.Class clazz, java.lang.String methodName, groovy.lang.Closure additionalCriteria, Object[] arguments)`

Methods inherited from class AbstractStaticPersistentMethod
doInvokeInternal, getCriteria, getHibernateTemplate, invoke, invoke

Methods inherited from class AbstractStaticMethodInvocation
getPattern, invoke, isMethodMatch, setPattern, toString

Field Detail

### converter

    public static SimpleTypeConverter converter

Constructor Detail

### ExecuteQueryPersistentMethod

    public ExecuteQueryPersistentMethod(SessionFactory sessionFactory, java.lang.ClassLoader classLoader)

Method Detail

### doInvokeInternal

    @SuppressWarnings("rawtypes")
    @Override
    protected java.lang.Object doInvokeInternal(java.lang.Class clazz, java.lang.String methodName, groovy.lang.Closure additionalCriteria, Object[] arguments)

Groovy Documentation