spring data jpa - Issue with projection in SpringDataRest and @Lob attribute -
i have entity person :
@entity public class person implements serializable { @id @generatedvalue(strategy = auto, generator = "person_seq") private integer idperson; private string lastname; private string firstname; @lob private byte[] picture; a repository
public interface personrepository extends pagingandsortingrepository<person, integer> {} a projection
@projection(name = "picture", types = { person.class }) public interface projectionpictureperson { byte[] getpicture(); }
when used projection : ..../persons/1?projection=picture have error
there unexpected error (type=internal server error, status=500). not write content: [b cannot cast [ljava.lang.object; (through reference chain: org.springframework.data.rest.webmvc.json.["content"]->$proxy109["picture"]); nested exception com.fasterxml.jackson.databind.jsonmappingexception: [b cannot cast [ljava.lang.object; (through reference chain: org.springframework.data.rest.webmvc.json.["content"]->$proxy109["picture"])
when use projection on string, exemple lastname works
@projection(name = "lastname", types = { person.class }) public interface projectionlastname { string getlastname(); } when don't use projection works too
jackson serialize image attribute
is there restriction on blob ?
that's bug in proxyprojectionfactory. i've filed , fixed datacmns-722 scheduled in upcoming services releases (mid next week).
Comments
Post a Comment