0
を抽出できませんでした:SQLGrammarException:私は次のクエリを実行したいのResultSet
@Query(value = "select * from wash_history w where w.wash_id IN \n"
+ "(select w.id from wash w where w.car_wash_id=?1) order BY w.time
?2", nativeQuery = true)
List<WashHistory> findDesc(Integer carWashId,String descOrAsc);
しかし、私はこのクエリでdesc
またはac
の間で選択することができますどのように次のエラー
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet] with root cause
がありますか?
完全なスタックトレースを追加します。また、クエリによる注文のプレースホルダは一般的にサポートされていません(ただし、JDBCドライバによって異なる場合があります)。注文するにはメソッドの最後の引数として渡せる 'Sort'クラスがあります。 –
ありがとうございます。しかし、@Query(value = "update car_wash set lon_lat = ST_GeomFromText( 'POINT(:lon:lat)')のid =:id;"、nativeQuery = trueの場合はどうでしょうか? void upateLonLatダブルlon、ダブルラト、整数id); 私はparamsを照会する方法を知る必要があります。何か提案がありますか? –
これは別の質問です。また、なぜその更新クエリが必要でしょうか?最初にJPAを使用するという目的をはるかに超え、JPAの代わりにJPAを使用しているように見えます。 –