###前提・実現したいこと
Convert SQL statement to JPQL statement
###発生している問題・エラーメッセージ
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'itemDeleteAdminController': Unsatisfied dependency expressed through field 'itemRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'itemRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract java.util.List jp.co.sss.shop.repository.ItemRepository.findItemOrderByQuantity()! java.lang.NullPointerException: null
###該当のソースコード
I wonder how I convert this SQL statement to JPQL: SELECT i.NAME,i.price, c.name, sum(quantity) FROM ORDER_ITEMS o INNER JOIN Items i ON o.item_id = i.id INNER JOIN CATEGORIES c ON i.category_id = c.id GROUP BY i.NAME , i.price , c.name ORDER BY sum(quantity) DESC; wouldnt it be something like this: @Query("SELECT i.name,i.price, c.name,sum(quantity) FROM OrderItem o INNER JOIN o.item i INNER JOIN i.category c GROUP BY i.name,i.price ,c.name ORDER BY sum(quantity) DESC") public List<Item> findItemOrderByQuantity();
###試したこと
###補足情報(言語/FW/ツール等のバージョンなど)
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。