-
Notifications
You must be signed in to change notification settings - Fork 83
Description
Why does @EdmAnnotation(term = "Core.Description", constantExpression = @EdmAnnotation.ConstantExpression(type = CsdlConstantExpression.ConstantExpressionType.String, value = "Description Test")) result in the xml output of http://localhost:8080/Cases/V1.0/$metadata only in <Annotation> <String>Description Test</String> </Annotation> - without the string "Term=Core.Description" in the Annotation tag?
I would expect it to behave similar to the qualifier parameter @EdmAnnotation(term = "Core.Description", qualifier = "Qualifier", constantExpression = @EdmAnnotation.ConstantExpression(type = CsdlConstantExpression.ConstantExpressionType.String, value = "Description Test")) that gives <Annotation Qualifier="Qualifier">. At the moment "term" does not matter at all.
Background:
A GET http://localhost:8080/Cases/V1.0/$metadata of a project with Entity
package some.package.example;
import com.sap.olingo.jpa.metadata.core.edm.annotation.EdmAnnotation;
import lombok.*;
import org.apache.olingo.commons.api.edm.provider.annotation.CsdlConstantExpression;
import javax.persistence.*;
@Entity
@Table(name = "Example_case")
@Getter
@Setter
@EqualsAndHashCode
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class ExampleEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@EdmAnnotation(term = "Core.Description", qualifier = "Qualifier",
constantExpression = @EdmAnnotation.ConstantExpression(type = CsdlConstantExpression.ConstantExpressionType.String,
value = "Description Test"))
@Column(name = "OrderNumber")
private String order_nr;
}
gives
<?xml version='1.0' encoding='UTF-8'?>
<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
<edmx:DataServices>
<Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="Cases">
<EntityType Name="ExampleEntity">
<Key>
<PropertyRef Name="Id"/>
</Key>
<Property Name="Order_nr" Type="Edm.String" MaxLength="255">
<Annotation Qualifier="Qualifier">
<String>Description Test</String>
</Annotation>
</Property>
<Property Name="Id" Type="Edm.Int64"/>
</EntityType>
<EntityContainer Name="Cases">
<EntitySet Name="ExampleEntities" EntityType="Cases.ExampleEntity"/>
</EntityContainer>
</Schema>
</edmx:DataServices>
</edmx:Edmx>
I seek for a solution with an output off
<Annotation Term="Core.Description" String="Description Test"/>