我面临在 java 中使用 hibernate 对 postgres 表执行以下查询的问题。
该查询用于使用内部联接从 3 个表中检索数据。
询问 :
QryJourney = "SELECT Journey.id, Journey.operatingday, Journey.linename, Journey.scheduledeparture, Journey.scheduledeparturestopname, Journeydetail.stopname, Journeydetail.latitude, Journeydetail.longitude FROM Journey left join Journey_journeydetail ON Journey.id = Journey_journeydetail.journey_id left JOIN Journeydetail ON Journey_journeydetail.journeydetails_id = Journeydetail.id WHERE Journey.id = '155815228' ORDER BY Journeydetail.schedulearrival";
一旦执行,就会发生以下异常。
例外 :
线程“main” org.hibernate.hql.internal.ast.QuerySyntaxException 中的异常:意外令牌:在第 1 行,第 268 列附近打开 [SELECT Journey.id,journey.operatingday,journey.linename,journey.scheduledeparture,journey.scheduledeparturestopname, Journeydetail.stopname ,journeydetail.latitude,journeydetail.longitude FROM de.db.journeyTracker.model.journey 左加入journey_journeydetail ON Journey.id = Journey_journeydetail.journey_id 左加入journeydetail ON Journey_journeydetail.journeydetails_id =journeydetail.id WHEREjourney.id ='155815228 ' ORDER BY traveldetail.schedulearrival]
Tis 查询在其 SQL 窗格上执行时在 postgres 上 100% 正常工作。有人有什么想法吗?
问候乌斯曼