use of org.camunda.bpm.engine.impl.QueryPropertyImpl in project camunda-bpm-platform by camunda.
the class JsonQueryOrderingPropertyConverter method toObject.
public QueryOrderingProperty toObject(JSONObject jsonObject) {
String relation = null;
if (jsonObject.has(RELATION)) {
relation = jsonObject.getString(RELATION);
}
QueryOrderingProperty property = null;
if (QueryOrderingProperty.RELATION_VARIABLE.equals(relation)) {
property = new VariableOrderProperty();
} else {
property = new QueryOrderingProperty();
}
property.setRelation(relation);
if (jsonObject.has(QUERY_PROPERTY)) {
String propertyName = jsonObject.getString(QUERY_PROPERTY);
String propertyFunction = null;
if (jsonObject.has(QUERY_PROPERTY_FUNCTION)) {
propertyFunction = jsonObject.getString(QUERY_PROPERTY_FUNCTION);
}
QueryProperty queryProperty = new QueryPropertyImpl(propertyName, propertyFunction);
property.setQueryProperty(queryProperty);
}
if (jsonObject.has(DIRECTION)) {
String direction = jsonObject.getString(DIRECTION);
property.setDirection(Direction.findByName(direction));
}
if (jsonObject.has(RELATION_CONDITIONS)) {
List<QueryEntityRelationCondition> relationConditions = JsonQueryFilteringPropertyConverter.ARRAY_CONVERTER.toObject(jsonObject.getJSONArray(RELATION_CONDITIONS));
property.setRelationConditions(relationConditions);
}
return property;
}
Aggregations