SAP / olingo-jpa-processor-v4

The JPA Processor fills the gap between Olingo V4 and the database, by providing a mapping between JPA metadata and OData metadata, generating queries and supporting the entity manipulations.
Apache License 2.0
122 stars 76 forks source link

Decouple entity attribute names from generated edm property names #165

Closed sebgercas closed 1 year ago

sebgercas commented 2 years ago

Hello, currently, the attibute names of the entity classes are being used as property names in the metadata document of our service (the first letters are capitalized in the generated metadata document). Currently, I am looking for a way to decouple the attribute names in the entity classes from the corresponding property names in the generated metadata document. When looking through this library, I found the annotation "EdmAlias", which I hoped could solve my problem. I added the annotation to one of my fields but the name in the generated metadata did not change according to what I specified in the annotation.

Is there any way to achieve what I want to do?

wog48 commented 1 year ago

Hello,

this was done having Domain Driven Design and a Ubiquitous Language in mind. I guess you have good reasons having internally names different from the external names. Unfortunately, there is no annotation that allows you to override the external name. The only option is the usage of the name builder, as described in: How to get own names for the OData artifacts? .

sebgercas commented 1 year ago

Ok, thanks, I will have a look into it. Btw, what is the annotation EdmAlias intended for?

sebgercas commented 1 year ago

We have implemented a solution using a custom name builder. Ticket can be closed.