Announcement Announcement Module
Collapse
No announcement yet.
Ordering List Views Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ordering List Views

    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();
    }
    }

  • #2
    There is another method with seamless name and two parameters (start and end).
    This is a method you need push-in and modify too.

    Comment

    Working...
    X