Why don't Domain class static methods work from inside a grails "service"?
- by ?????
I want a grails service to be able to access Domain static methods, for queries, etc.
For example, in a controller, I can call
IncomingCall.count()
to get the number of records in table "IncomingCall"
but if I try to do this from inside a service, I get the error:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'incomingStatusService': Invocation of init method failed; nested exception is groovy.lang.MissingMethodException: No signature of method: static ms.wdw.tropocontrol.IncomingCall.count() is applicable for argument types: () values: []
How do these methods get injected? There's no magic def statement in a controller that appears to do this. Or is the problem that Hibernate isn't available from my Service class?