Uploaded image for project: 'Spring Data REST'
  1. Spring Data REST
  2. DATAREST-581

ETag getVersionInformation fails with proxied Entities for projections

    XMLWordPrintable

    Details

      Description

      See the reference GitHub project.

      I've got an @Entity with a @Version'ed field, a @Projection, and a Repository. When I try to GET the projection of a single entry, I get a 500 Internal server error, because of a failed assertion in BasicPersistentEntity line 394, as called from Etag line 191:
      > Assert.isTrue(getType().isInstance(bean), "Target bean is not of type of the persistent entity!");

      The argument bean here is of type $Proxy90 / JdkDynamicAopProxy, not Book.

      The projection only works again when the @Version annotation is removed. This is since Fowler, as I had no such issues with Evans.

        Attachments

          Activity

            People

            Assignee:
            olivergierke Oliver Drotbohm
            Reporter:
            timtebeek Tim te Beek
            Last updater:
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: