The code listed here works, but STS shows an annoying error: Groovy: unable to resolve class Comentario
:
This is a extract of the Service code with the line of the error (new Comentario(params).save()
)":
package alojamiento
import org.springframework.transaction.annotation.Transactional
class ComentarioJQGridService {
static transactional = true
@Transactional
def cambiarComentario(params) {
Comentario.withTransaction { status ->
new Comentario(params).save()
}
}
}
This is an extract of the domain class:
package alojamiento
class Comentario implements Serializable {
Integer id
String comentario
...
It looks similar to the official Grails documentation, so I think it is a STS issue. Why is it? How could I remove this error?