Skip to content

ETag getVersionInformation fails with proxied Entities for projections [DATAREST-581] #955

Closed
@spring-projects-issues

Description

@spring-projects-issues

Tim te Beek opened DATAREST-581 and commented

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


Affects: 2.3 GA (Fowler)

Reference URL: https://github.com/timtebeek/etag-projection

Backported to: 2.3.1 (Fowler SR1)

Metadata

Metadata

Assignees

Labels

type: regressionA regression from a previous release

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions