I have implemented Odata V4 service using Olingo. I am trying to include
Aggregation.ApplySupported annotation to my service. However the annotation term value is blank in my $metadata document. Below is my code snippet
List<CsdlAnnotation> list = new ArrayList<CsdlAnnotation>();
CsdlAnnotation annotationAttribute = new CsdlAnnotation();
annotationAttribute.setTerm("Aggregation.ApplySupported");
annotationAttribute.setExpression(new CsdlConstantExpression(CsdlConstantExpression.ConstantExpressionType.String, "true"));
list.add(annotationAttribute);
entityContainer.setAnnotations(list);
$metadata
<EntityContainer Name="myContainer">
<!-- .....sets -->
<Annotation> <!-- term is blank -->
<String>true</String>
</Annotation>
</EntityContainer>
Can't figure out whats I am missing on. Thanks in advance.
You should override getTerm method in your provider.
@Override
public CsdlTerm getTerm(final FullQualifiedName termName) throws ODataException {
return new CsdlTerm().setAppliesTo(Arrays.asList("EntityContainer"))
.setName("ApplySupported");
}