Dynamic domain methods missing from grails service when injected into java service in grails app
I had the idea that I would write my GroovyDao as a grails service.
Next I would write a MyJavaService in java and locate it in the java sources dir in my grails app. MyJavaService contains a instance reference to groovyDao for spring injection.
I would wire up in resources.groovy the MyJavaService with a g开发者_开发问答roovyDao = ref("GroovyDao").
Everything starts up fine.
However if I make call to MyJavaService any Domain method like Domain.list() returns a Method not found error.
Any help is appreciated.
The Dynamic methods are only available in Groovy. Try putting you code in the src/groovy directory.
Also try putting the services in grails-app/services
Hope this helps
精彩评论