开发者

Dynamic domain methods missing from grails service when injected into java service in grails app

开发者 https://www.devze.com 2022-12-29 22:25 出处:网络
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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消