Uploaded image for project: 'Hibernate ODM'
  1. Hibernate ODM
  2. HIBERNATE-70

Limit/skip aggregate stages MQL translation

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Usually, limit/skip feature goes hand in hand with sorting. Notice that we have two kinds of skip/limit info sources:

      • HQL/Criteria
      List<Call> calls1 = entityManager.createQuery(
      	"select c " +
      	"from Call c " +
      	"join c.phone p " +
      	"order by p.number " +
      	"limit 50",
      	Call.class)
      .getResultList();
      
      // same thing
      List<Call> calls2 = entityManager.createQuery(
      	"select c " +
      	"from Call c " +
      	"join c.phone p " +
      	"order by p.number " +
      	"fetch first 50 rows only",
      	Call.class)
      .getResultList();
      • QueryOptions's `setFirstResult()` and `setMaxResults()` methods
      List<Person> persons = entityManager.createQuery("select p " +
              "from Person p " + 
              "order by p.age ", Person.class).
            .setFirstResult(20)
            .setMaxResults(50)
            .getResultList();

      We need to cover both cases.

      It is possible that we'll need to use the jdbcParameterBindings parameter of the SelectMqlTranslator.translate method when working on this ticket.
       

      Addressing the source code notes tagged with TODO-HIBERNATE-70 is in scope of this ticket.

            Assignee:
            nathan.xu@mongodb.com Nathan Xu
            Reporter:
            nathan.xu@mongodb.com Nathan Xu
            None
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: