开发者

How to implement service using xfire in grails to store data in database?

开发者 https://www.devze.com 2023-03-28 13:44 出处:网络
Hi i am using xfire plugin in grails app,Belov is service written, class HelloWorldService { static expose=[\'xfire\']

Hi i am using xfire plugin in grails app,Belov is service written,

class HelloWorldService {

static expose=['xfire']
void addBook(String pName,String pAuthor) {
    def b=new Book()
    b.name=pName
    b.author=pAuthor
    println b.name
    println b.author
    if(!b.save())
    {
        b.errors.each { println it }
    }
    else
    {
        println "saved"
    }

}
}

when client requests this addBook method with parameters, getting error as,

groovy开发者_StackOverflow社区.lang.MissingMethodException: No signature of method: patienthealthhistory.Book.save() is applicable for argument types: () values: []

why is it so?

PLz can anybody help me to solve this issue..Waiting for answer..


I'm assuming the error is occurring on this line

if(!b.save())

The only reason I can think of why the save() method would be missing is that Book is not a domain class

0

精彩评论

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