NamedQuery格式

时间:2014-08-10 03:05:19

标签: netbeans glassfish named-query

使用以下命名查询时出错,我做错了。

@NamedQuery(name = "TblStationActionCodes.findNextByStationName", query = "SELECT t FROM TblStationActionCodes t, TblStationStations t1 WHERE t1.stationName = :stationName and t.stationId = t1.stationId AND t.isSentFlag = false")

这会导致Glassfish出现错误,如下所示:

SELECT t1.action_code_id AS a1, t1.action_code AS a2, t1.comment_text AS a3, t1.creation_date AS a4, t1.is_sent_flag AS a5, t1.sent_date AS a6, t1.station_id AS a7 FROM tbl_station_stations t0, tbl_station_action_codes t1 WHERE (((t0.station_name = ?) AND (t1.station_id = t0.station_id.t0.station_id)) AND (t1.is_sent_flag = ?)) LIMIT ?, ?

问题显然是以下

t1.station_id = t0.station_id.t0.station_id

这是一个错误还是我的命名查询定义中有些东西我做错了?

0 个答案:

没有答案