## org.codehaus.groovy.grails.orm.hibernate.metaclass
Class GetPersistentMethod

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

All Implemented Interfaces:
  StaticMethodInvocation

    public class GetPersistentMethod

extends AbstractStaticPersistentMethod

The "get" static persistent method for Grails domain classes. This method takes an id and returns the instance eg. Account.get(2) Or an HQL query and tries to retrieve a unique result (note an exception is thrown if the result is not unique) eg. Account.get("from Account as a where a.id=2)

Author:
  Graeme Rocher

Field Summary
`static String` `METHOD_SIGNATURE`

Constructor Summary
`GetPersistentMethod(GrailsApplication application, org.hibernate.SessionFactory sessionFactory, ClassLoader classLoader)`

Method Summary
`protected Object` `doInvokeInternal(Class clazz, String methodName, Object[] arguments)`

Methods inherited from class org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractStaticPersistentMethod
`getHibernateTemplate, 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`

Field Detail

### METHOD_SIGNATURE

    public static final String METHOD_SIGNATURE

See Also:
  Constant Field Values

Constructor Detail

### GetPersistentMethod

    public GetPersistentMethod(GrailsApplication application,
                               org.hibernate.SessionFactory sessionFactory,
                               ClassLoader classLoader)

Method Detail

### doInvokeInternal

    protected Object doInvokeInternal(Class clazz,
                                      String methodName,
                                      Object[] arguments)

  Specified by:
    `doInvokeInternal` in class `AbstractStaticPersistentMethod`

Copyright (c) 2005-2006 The Grails project