views:

46

answers:

1

I started to write a simple named query in grails ..but it says missing method on the domain for the named query:( am i doing something wrong? I referred the documentation and i find no problem with the code.Any help??

I just tried the example in the documentation.

class Publication { String title String author Date datePublished Integer numberOfPages

static namedQueries = { recentPublications { def now = new Date() gt 'datePublished', now - 365 } } }

invoked the named query like Publication.recentPublications()

It was complaining that the method recent publication was missing. I am using grails 1.3.1

+1  A: 

try:

Publication.recentPublications.list()

instead of:

Publication.recentPlublications()
proflux