I see there is documentation that describes using annotations with Olingo for Odata v2: https://olingo.apache.org/doc/odata2/tutorials/AnnotationProcessorExtension.html
So for example, instead of manually creating a provider that details all the EDM metadata, I'd like to add annotations to my model and have a generic EDM provider to generate all the meta data. And similarly for the data provider. It would like something like this:
@EdmEntityType
@EdmEntitySet
public class Car {
@EdmKey
@EdmProperty
private String id;
@EdmProperty
private String model;
@EdmNavigationProperty
private Manufacturer manufacturer;
}
Is there similar functionality for Olingo Odata4? I couldn't find any examples and searching didn't seen the annotations defined in their source code. As I recall this approach works with other frameworks, .Nets web API, SDL Odata, Olingo Odata2, etc.
Update: I ended up using SDL Odata instead which also supports Odata v4 and has notations. For an example look here: https://github.com/sdl/odata-example
Here is what a model looks like in Scala:
@EdmEntity(namespace = "SDL.OData.Example", key = Array("id"), containerName = "SDLExample")
@EdmEntitySet
case class Person (
@(EdmProperty @field)(name="id", nullable = false) var personId: String,
@(EdmProperty @field)(name="firstName",nullable = false) var firstName: String,
@(EdmProperty @field)(name="lastName", nullable = false) var lastName: String,
@(EdmProperty @field)(name="age", nullable = false) var age: Int
)