Home Ebeans - trying to add an order by to a query
Reply: 0

Ebeans - trying to add an order by to a query

user816
1#
user816 Published in April 23, 2018, 8:54 pm

I am trying to add an orderBy to an Ebeans query, and I am somewhat unfamiliar with this ORM.

This is my query:

    List<UserOffer> userOffers = Ebean.find(UserOffer.class)
            .fetch("offer")
            .where()
            .eq("user_id", userId)
            .eq("status_id", offerViewedStatus)
            .orderBy("updated_at")
            .findList();

Everything worked (and was written by a developer more experienced with Ebeans than me) before adding the orderBy, but as soon as I do, the query stops working.

Is there some sort of syntax issue I am missing?

The UserOffer class is based on the user_offer table which has the column updated_at which is a timestamp with timezone field.

The backend is Postgres.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.565921 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO