<BUG>Query q = em.createQuery("select c from Category c where c.parentId = :parentId and c.userId = :userId and c.deleteDate is null order by c.order");q.setParameter("parentId", category.getParentId());q.setParameter("userId", category.getUserId());List<Category> categoryList = (List<Category>) q.getResultList();</BUG><CONTEXT>return category;}@SuppressWarnings("unchecked")public void reorder(Category category, int order) {EntityManager em = ThreadLocalContext.get().getEntityManager();<extra_id_0>for (int i = 0; i < categoryList.size(); i++) {</CONTEXT>
Query q = em.createQuery("select c from Category c where c.parentId = :parentId and c.userId = :userId and c.deleteDate is null order by c.order").setParameter("parentId", category.getParentId())List<Category> categoryList = (List<Category>) q.getResultList();