org.codehaus.groovy.grails.orm.hibernate.metaclass
Class ExecuteUpdatePersistentMethod

java.lang.Object
  extended by org.codehaus.groovy.grails.commons.metaclass.AbstractStaticMethodInvocation
      extended by org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractStaticPersistentMethod
          extended by org.codehaus.groovy.grails.orm.hibernate.metaclass.ExecuteUpdatePersistentMethod
All Implemented Interfaces:
StaticMethodInvocation

public class ExecuteUpdatePersistentMethod
extends AbstractStaticPersistentMethod

Allows the executing of abituary HQL updates.

eg. Account.executeUpdate("delete from Account a where a.branch = ?", 'London') or Account.executeUpdate("delete from Account a where a.branch = :branch", [branch:'London'])

Author:
Burt Beckwith

Constructor Summary
ExecuteUpdatePersistentMethod(org.hibernate.SessionFactory sessionFactory, ClassLoader classLoader)
           
 
Method Summary
protected  Object doInvokeInternal(Class clazz, String methodName, groovy.lang.Closure additionalCriteria, Object[] arguments)
           
 
Methods inherited from class org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractStaticPersistentMethod
getCriteria, getHibernateTemplate, invoke, invoke
 
Methods inherited from class org.codehaus.groovy.grails.commons.metaclass.AbstractStaticMethodInvocation
getPattern, isMethodMatch, setPattern, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExecuteUpdatePersistentMethod

public ExecuteUpdatePersistentMethod(org.hibernate.SessionFactory sessionFactory,
                                     ClassLoader classLoader)
Method Detail

doInvokeInternal

protected Object doInvokeInternal(Class clazz,
                                  String methodName,
                                  groovy.lang.Closure additionalCriteria,
                                  Object[] arguments)
Specified by:
doInvokeInternal in class AbstractStaticPersistentMethod


Copyright (c) 2005-2009 The Grails project