Uploaded image for project: 'Spring Data JPA'
  1. Spring Data JPA
  2. DATAJPA-300

Specifications must support null as a parent Specification

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: 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
        olivergierke Oliver Gierke added a comment -

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

        Show
        olivergierke Oliver Gierke added a comment - Changed Specifications to accept null values. Available in 1.4 snapshots.
        Hide
        svlada Vladimir Stanković added a comment -

        Hi Oliver,

        What's the correct way to construct the predicate so that all lazy collections are brought in?

        This feature is not documented.

        Show
        svlada Vladimir Stanković added a comment - Hi Oliver, What's the correct way to construct the predicate so that all lazy collections are brought in? This feature is not documented.

          People

          • Assignee:
            olivergierke Oliver Gierke
            Reporter:
            mavarazy Anton Oparin
            Last updater:
            Vladimir Stanković
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: