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
Suppose you have a class Notification.class with a field:
private Map<String, Object> data;
And you're querying "data.category==cat-1" where category is a key of a map.
Then EntityFieldTypeResolver throws a null pointer exception.
I changed its apply method as follows: @OverRide
public Class apply(FieldPath path, Class root) {
String[] splitField = path.asKey().split("\.", 2);
Field field = getField(root, splitField[0], true);
if(field == null) {
return Object.class;
}
if(rsql != null) {
QueryConversionPipeline pipeline = QueryConversionPipeline.defaultPipeline();
Condition condition = pipeline.apply(rsql, Notification.class);
Criteria criteria = condition.query(new MongoVisitor());
query.addCriteria(criteria);
}
Suppose you have a class Notification.class with a field:
private Map<String, Object> data;
And you're querying "data.category==cat-1" where category is a key of a map.
Then EntityFieldTypeResolver throws a null pointer exception.
I changed its apply method as follows:
@OverRide
public Class apply(FieldPath path, Class root) {
String[] splitField = path.asKey().split("\.", 2);
Field field = getField(root, splitField[0], true);
if(field == null) {
return Object.class;
}
But is this the right approach? Is it possible to add map inside maps etc. a more generic approach I mean.
The text was updated successfully, but these errors were encountered: