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

Support for Javaslang's Option as return type of query methods

    Details

      Description

      Spring Data JPA supports JDK 8 and Guava Optional as well as Scala Option so far. Support for JavaSlang Option would be welcome as well.

      The issue with JavaSlang is that javaslang.control.Option is an interface, not a class as in all other supported libraries. This in conjunction with compiler source level set to 1.6 rises a problem of calling a static method on an interface that is not supported until Java 1.8. Therefore one cannot simply add support for JavaSlang following the pattern in QueryExecutionConverters, as the compiler will not allow it.

      Also current implementation of QueryExecutionConverters is completely closed to extensions. Everything is static and private. Although it's nice Spring Data supports some wrappers out of the box, it'd be even nicer if it allowed adding custom ones in runtime. It'd not be hard to implement using i.e. ServiceLoader.

      I created example implementation here: https://github.com/spring-projects/spring-data-commons/pull/184

        Attachments

          Activity

            People

            • Assignee:
              olivergierke Oliver Gierke
              Reporter:
              roadrunn Darek Kaczynski
              Last updater:
              Oliver Gierke
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: