我有一个名为 Event 的域类:
class Event{
String eventID // an ID for the event, (there are multiple events with same eventID)
.....
}
在我的 eventService 类中,我想获取具有不同 eventID 的所有事件,所以我有以下查询:
Event.executeQuery("select distinct e.eventID from Event e", [max: max, offset: offset])
根据grails 文档,它应该可以工作。但是,我收到此错误:
| Error 2012-05-10 18:14:09,643 [http-bio-8080-exec-9] ERROR errors.GrailsExceptionResolver - MissingPropertyException occurred when processing request: [POST] /events/event/list -
No such property: id for class: java.lang.String. Stacktrace follows:
Message: No such property: id for class: java.lang.String
Line | Method
->> 35 | run in C__src_Event_events_grails_app_views_event__List_gsp
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 18 | render . . . . . . in org.events.EventController
| 67 | list . . . . . . . in ''
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run . . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run in java.lang.Thread
我对 grails 相当陌生,任何帮助将不胜感激。顺便说一句,我正在使用 Grails 2.0.1。