Uploaded image for project: 'Spring Data Commons'
  1. Spring Data Commons
  2. DATACMNS-875

Add support for exists projection in repository query derivation

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.13 RC1 (Ingalls)
    • Component/s: Repositories
    • Labels:
      None

      Description

      While parsing a method name with PartTree it doesn't have in count the possible Subject "exists". The solutions seems to be as simple as applying the same changes as with the "count/delete" additions.

        Issue Links

          Activity

          Hide
          olivergierke Oliver Gierke added a comment -

          Parsing is only the start of the story as individual stores have to actually turn the expression into an actual query. Note, that as a workaround you could go ahead and manually declare a JPQL query select case when (count >0) then true else false end from ….

          Show
          olivergierke Oliver Gierke added a comment - Parsing is only the start of the story as individual stores have to actually turn the expression into an actual query. Note, that as a workaround you could go ahead and manually declare a JPQL query select case when (count >0) then true else false end from … .
          Hide
          mp911de Mark Paluch added a comment -

          Spiked at the implementation for commons and pushed the code to https://github.com/spring-projects/spring-data-commons/tree/issue/DATACMNS-875.

          The implementation in JPA requires a bit more thought, whether to solve exists projections via count or tuple-queries with LIMIT 1 and how that could into Spring Data JPA.

          Show
          mp911de Mark Paluch added a comment - Spiked at the implementation for commons and pushed the code to https://github.com/spring-projects/spring-data-commons/tree/issue/DATACMNS-875 . The implementation in JPA requires a bit more thought, whether to solve exists projections via count or tuple-queries with LIMIT 1 and how that could into Spring Data JPA.
          Hide
          rubasace Ruben Pahino added a comment -

          In my case I use it for my own implementation using the same approach as JPA but for jdbc, using JdbcTemplate. In this case I also have in count how to implement the exists clause, but had to implement a temporal fix by using the method return type and not the PartTree. Now I can move on with the good implementation.

          Thank you

          Show
          rubasace Ruben Pahino added a comment - In my case I use it for my own implementation using the same approach as JPA but for jdbc, using JdbcTemplate. In this case I also have in count how to implement the exists clause, but had to implement a temporal fix by using the method return type and not the PartTree. Now I can move on with the good implementation. Thank you

            People

            • Assignee:
              mp911de Mark Paluch
              Reporter:
              rubasace Ruben Pahino
              Last updater:
              Oliver Gierke
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified

                  Agile