Spring Data JPA
  1. Spring Data JPA
  2. DATAJPA-300

Specifications must support null as a parent Specification

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.3 GA
    • Fix Version/s: 1.3.1, 1.4 M1
    • Component/s: Core
    • Labels:
      None

      Description

      Specification interface and utility Specifications should be more consistent.

      If your Specification A is null, for some reason, it's fine with JPASpecificationExecutor, and it ignores it, returning all the values.

      If you decide to combine your Specification A, with other Specification B, which might also be null, using Specifications utility, null becomes a problem, for current Specifications implementations.

      I made a workaround, in my project so that my implementation of XSpecifications would support null Specification and just ignore all null conditions, but I believe it should be part of the original Specifications implementation, so I could get rid of mine.

        Activity

        Hide
        Oliver Gierke added a comment -

        Changed Specifications to accept null values. Available in 1.4 snapshots.

        Show
        Oliver Gierke added a comment - Changed Specifications to accept null values. Available in 1.4 snapshots.

          People

          • Assignee:
            Oliver Gierke
            Reporter:
            Anton Oparin
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: