You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using mysema QueryDSL for persistence-ORM functionality. I would like to store built query objects together in JSON format, so that I can load and reuse them. As most of the classes in QueryDSL are abstract, and I would not modify them, I have used mixins to configure their JSON serialization/deserialization:
My issue is with the PathMetadata mixin. The original PathMetadata class can be seen here:
When I serialize an instance of this PathMetadata class, everything works as expected and it is outputted either as a whole, or with the ref attribute if it is already there. But when I try to deserialize the object, it throws a crypric exception:
creatorProps is an array of CreatorProperty objects (although it is declared more generally) and prop is an ObjectIdReferenceProperty. Thus it cannot be added to the array.
How can I solve this?
The text was updated successfully, but these errors were encountered:
Hi,
I am using mysema QueryDSL for persistence-ORM functionality. I would like to store built query objects together in JSON format, so that I can load and reuse them. As most of the classes in QueryDSL are abstract, and I would not modify them, I have used mixins to configure their JSON serialization/deserialization:
My issue is with the PathMetadata mixin. The original PathMetadata class can be seen here:
https://github.com/querydsl/querydsl/blob/master/querydsl-core/src/main/java/com/querydsl/core/types/PathMetadata.java
The mixin that I have created for this class is the following:
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.mysema.query.types.Path;
import com.mysema.query.types.PathType;
import javax.annotation.Nullable;
public abstract class PathMetadataMixin {
}
When I serialize an instance of this PathMetadata class, everything works as expected and it is outputted either as a whole, or with the ref attribute if it is already there. But when I try to deserialize the object, it throws a crypric exception:
Caused by: java.lang.ArrayStoreException: com.fasterxml.jackson.databind.deser.impl.ObjectIdReferenceProperty
I have found that this exception is fired here:
/com/fasterxml/jackson/core/jackson-databind/2.6.0-rc1/jackson-databind-2.6.0-rc1-sources.jar!/com/fasterxml/jackson/databind/deser/BeanDeserializerBase.java:485
Actually, in this line
creatorProps[i] = prop;
creatorProps is an array of CreatorProperty objects (although it is declared more generally) and prop is an ObjectIdReferenceProperty. Thus it cannot be added to the array.
How can I solve this?
The text was updated successfully, but these errors were encountered: