How to make an aggregate query?

35 views Asked by At

There is an entity :

@Entity
@Table(name = "t_pms_reservation")
@Data
public class TPmsReservation implements Serializable {
    .....
}

and there is the PanacheRepository associated to it :

@ApplicationScoped
public class ReservationRepository implements PanacheRepository<TPmsReservation> {
    
}

With JPA we can make aggregate query like this :

LocalDate dateOccupation = (LocalDate) entityManager.createQuery("select MIN(dateArrivee) from TPmsReservation").getSingleResult();

So how to make it with quarkus ?

0

There are 0 answers