Code Monkey home page Code Monkey logo

blaze-persistence-querydsl's People

Contributors

jwgmeligmeyling avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

afbenhassine

blaze-persistence-querydsl's Issues

Left nested set support

Left nested sets can be used for the following two purposes:

  • Specifying an order by and/or limit clause on a set operation sub result
  • Overriding default precedence (INTERSECT (ALL) takes precedence over UNION/EXCEPT (ALL) according to ANSI SQL).

Left nested sets are not considered in #8. There's a few things to address in order to resolve this:

  • Currently we render against a CriteriaBuilder. In order to support a left nested set in the root, we have to render against a CriteriaBuilderFactory in order to be able to use CriteriaBuilderFactory#startSet.
  • That said, we also need an equivalent for CriteriaBuilderFactory in the QueryDSL integration for consistency
  • Because BlazeJPAQuery and SetOperation are derived from QueryDSL's ProjectableSQLQuery and UnionOperation respectively, which do not support left nested sets, the underlying expression model has to change to store the nesting information.

Fluent set operation criteria builders

For example:

String queryString = new BlazeJPAQuery<TestEntity>(entityManager, cbf)
    .select(book).from(book).where(book.id.lt(1337L))
    .union()
         .select(book).from(book).where(book.id.gt(42L))
    .end()
     .getQueryString();

Instead of:

String queryString = new BlazeJPAQuery<TestEntity>(entityManager, cbf)
        .union(
            select(book).from(book).where(book.id.lt(1337L)),
            select(book).from(book).where(book.id.gt(1337L))
        )
        .getQueryString();

Keep in mind that it should also support deeper nesting, which is problematic as with QueryDSL every builder is also its own expression. That means that we can only assign the right-handside of the set operation after the ongoing builder has ended.

This also makes it easier to use CTE binds that rely on bind expansion.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.