Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1.0.M1
    • Fix Version/s: 2.3 M1 (Fowler)
    • Component/s: None
    • Labels:

      Description

      It would be great to be able to use the JPA @Version annotation, or something similar, with Spring Data REST. Right now it doesn't work, presumably for the reason I offered in the reference URL.

      It's possible to implement a workaround using events (for sure at the SDR level, and presumably at the JPA and Hibernate levels as well), but direct support would be nice. For instance, I could see SDR doing load/test/update in the context of a transaction where a @Version is involved.

        Issue Links

          Activity

          Hide
          olivergierke Oliver Gierke added a comment -

          Thanks for the feedback, Pablo. And even more so, thanks for the contribution. This is in master now and scheduled to be released next week.

          Show
          olivergierke Oliver Gierke added a comment - Thanks for the feedback, Pablo. And even more so, thanks for the contribution. This is in master now and scheduled to be released next week.
          Hide
          Altaflux Pablo Lozano added a comment -

          No problem, it was a pleasure and I hope to to contribute more in the future.

          Thanks

          Show
          Altaflux Pablo Lozano added a comment - No problem, it was a pleasure and I hope to to contribute more in the future. Thanks
          Hide
          mkadan Mikhail Kadan added a comment -

          How is it possible to get ETag value when requesting a collection of items? If it's not, is it possible to make this entities contain the "version" field so an "If-Match" header could be constructed later?

          Show
          mkadan Mikhail Kadan added a comment - How is it possible to get ETag value when requesting a collection of items? If it's not, is it possible to make this entities contain the "version" field so an "If-Match" header could be constructed later?
          Hide
          Altaflux Pablo Lozano added a comment -

          Mikhail, seems like data-rest does not exposes the version value, PersistentEntityToJsonSchemaConverter would need to be changed for it not to skip the exposure of the version property.

          I don't remember the exact reason why it was preferred to not expose that @Version fields but Oliver may know better.
          I think opening another ticket might raise visibility around this request.

          Show
          Altaflux Pablo Lozano added a comment - Mikhail, seems like data-rest does not exposes the version value, PersistentEntityToJsonSchemaConverter would need to be changed for it not to skip the exposure of the version property. I don't remember the exact reason why it was preferred to not expose that @Version fields but Oliver may know better. I think opening another ticket might raise visibility around this request.
          Hide
          mkadan Mikhail Kadan added a comment - - edited

          I have found out that I can use projections (explicit or excerpt) to expose the version value. That requires some configuration, but actually is very easy to do and works just perfect.

          Show
          mkadan Mikhail Kadan added a comment - - edited I have found out that I can use projections (explicit or excerpt) to expose the version value. That requires some configuration, but actually is very easy to do and works just perfect.

            People

            • Assignee:
              olivergierke Oliver Gierke
              Reporter:
              ww4 Willie Wheeler
              Last updater:
              Mikhail Kadan
            • Votes:
              8 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Agile