Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9166651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:12:01+00:00 2026-06-17T15:12:01+00:00

Play! Framework does not have group by function. This lack of functionality really starts

  • 0

Play! Framework does not have group by function. This lack of functionality really starts to irritate me. How do I workaround that? I want byRouteId to group by trip_headsign. Simple raw query would look like:

SELECT *
FROM trips
WHERE route_id = 1070
GROUP BY trip_headsign

This is my Trip.java

@Entity  
@Table(name="trips")
public class Trip extends Model {

    @Constraints.Required
    public String route_id;
    @Constraints.Required
    public String service_id;
    @Id
    public String trip_id;
    public String trip_headsign;
    public String direction_id;
    public String block_id;
    public String shape_id;

    @ManyToOne
    @JoinColumn(name="route_id")
    public TRoute troute;

    public static List<Trip> byRouteId(String route_id) {
        List<Trip> trips = 
            Trip.find
            .fetch("troute") // fetch TRoute properties.
            .where().like("route_id", route_id)
            .findList();
        return trips;
    }

    public static Finder<String, Trip> find = new Finder(
            String.class, Trip.class
    );

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T15:12:02+00:00Added an answer on June 17, 2026 at 3:12 pm

    You can use a raw SQL query instead by using the createNativeQuery function from the EntityManager class from javax.persistence.

    EntityManager em = play.db.jpa.JPA.em();
    List<Trip> tripList = em.createNativeQuery("insert raw sql query here").getResultList();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does play framework server have a rewrite_mode functionality like apache? That is: how can
Does Play Framework 2.0 have any built-in equivalent to 1.2.x's jsAction ? If not,
I am using Play Framework 2.0 with Scala. So I have an action that
I have a Play! Framework Job that executes every 30 seconds: @Every(30s) public class
I have developed 2 applications with Play Framework, accessing different information, so it does
Let's say I have a Student entity like this implemented using the Play Framework's
We have recently started to see this exception while running the play framework in
I'm designing a very secure login mechanism using play framework2. Since Play does not
I have two Play framework web applications running on my system on ports 9001
I'm following the Play Framework 2.0 tutorial for Java and get this error when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.