【发布时间】:2012-05-11 01:43:40
【问题描述】:
我有一个名为 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])
根据the grails docs 它应该可以工作。但是,我收到了这个错误:
| 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。
【问题讨论】:
标签: grails hql grails-orm