選択の結果を別のテーブルと結合する HQL クエリを作成しようとしています。私が現在持っているのは
SELECT e FROM Experience e JOIN (SELECT f FROM Follow f WHERE f.username = :username AND f.contentType = :contentType) AS A ON (e.experienceId = A.contentId);
現在機能している SQL の同等物は
SELECT t_experiences.* FROM t_experiences JOIN (SELECT * FROM t_follows WHERE t_follows.username = :username AND t_follows.content_type = :contentType) AS A ON (t_experiences.experience_id = A.content_id);
t_experiences.experience_id
は などと同等です。HQLExperience.experienceId
の現在のエラーは、エラーのある最初の(
ものunexpected token: (
です。
どんな助けでも大歓迎です!