I'm trying to do something which I thought would take less than a second to do but unfortunately it has not.
I'm trying to order the list view but maybe I'm doing it wrong?
Here is a snippet of my code in products class. By default products are displayed as they are in the table I'm guessing.
I added a order by clause in the query to make order the default value but no dice. Am I missing something?
(no caching issues, I've made sure of that)
@DecimalMax(value = "2")
private BigDecimal product_percentoff;
@DecimalMax(value = "2")
private BigDecimal product_saleprice;
@NotNull
@Size(max = 200)
private String product_url;
private Integer scategory_id;
private Integer store_id;
public static List<Product> findAllProducts() {
return entityManager().createQuery("SELECT o FROM Product o order by o.product_percentoff desc", Product.class).getResultList();
}
}


Reply With Quote