2

I'm having a problem getting Projections to work with Joda LocalDateTime.

public interface SomeProjection {
   Long getId();
   LocalDateTime getDateCreated()
}

Results in the following error:

Caused by: com.fasterxml.jackson.databind.JsonMappingException: Projection type must be an interface! (through reference chain: org.springframework.data.domain.PageImpl["content"]->java.util.Collections$UnmodifiableRandomAccessList[0]->com.sun.proxy.$Proxy358["dateCreated"])

I tried adding the same conversion type that I have in the entity.

@Type(type = "org.jadira.usertype.dateandtime.joda.PersistentLocalDateTime")

But that doesn't seem to matter for Projections. Any tips or tricks here?

Crowie
  • 3,220
  • 7
  • 28
  • 48
Gregg
  • 34,973
  • 19
  • 109
  • 214
  • This looks to a bug in the latest spring data version for me. I get this error in one of my tests when trying to update to the latest version (while working with the previous version). Edit: There is already an issue for that in their jira: https://jira.spring.io/browse/DATACMNS-1836 – rubengees Dec 04 '20 at 10:38

0 Answers0