Uploaded image for project: 'Spring Data MongoDB'
  1. Spring Data MongoDB
  2. DATAMONGO-2348

Initial value of @Version annotated fields not described correctly in reference documentation

    XMLWordPrintable

    Details

      Description

      The reference documentation of Spring Data MongoDB states the following:

      "@Version: Applied at field level is used for optimistic locking and checked for modification on save operations. The initial value is zero which is bumped automatically on every update."

      The initial value being zero is the expected behaviour coming from SpringBoot 1.5.
      But the initial value is determined based on the type the version property has. If it is a primitive (long in my example) the initial value is set to one wheras for non-primitives the initial value is still zero (this is done in the EntityOperations class).

        Attachments

          Activity

            People

            Assignee:
            cstrobl Christoph Strobl
            Reporter:
            spring@buchholzjan.de Jan Buchholz
            Last updater:
            Mark Paluch
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: