spring-data-commons icon indicating copy to clipboard operation
spring-data-commons copied to clipboard

Properly reject unsupported types for version properties [DATACMNS-1347]

Open spring-projects-issues opened this issue 7 years ago • 1 comments

Wyatt Smith opened DATACMNS-1347 and commented

When I add an @Version to my model, the @DateCreated is no longer set. I do not think this makes sense because a versioned resource can still logically have a created date.

Here is a simple project with two tests exposing this bug: https://github.com/wyattjsmith1/data-rest-version-createdby-bug.

 

In this example, ModelWithVersion fails it's test because the @DateCreated field is null, but it is properly set in ModelWithoutVersion


Reference URL: https://github.com/wyattjsmith1/data-rest-version-createdby-bug

spring-projects-issues avatar Jun 27 '18 18:06 spring-projects-issues

Oliver Drotbohm commented

That seems to be caused by using String as type of the version property. If you switch to something numeric (e.g. Long), your tests succeed. Is that an oversight?

I'll keep this ticket around to improve on our detection of invalid types being used

spring-projects-issues avatar Jun 28 '18 09:06 spring-projects-issues