javaspring-bootodataolingo

How to expose an odata service for a transient entity


Is it possible to create an odata service (using apache olingo) when we don't have a real persistency i.e., without any DB and table? if yes then how?


Solution

  • I hope I have got your requirements clear, you want to build an Odata service which is not backed by a database.

    Yes you could do it but not Odata was not meant to be used that way.

    One simple way could be to implement this could be via Odata functions.

    For example:

    /api/v1/utils/TimeOfDay(timeZone='UTC')

    You will need to build a Request processor which can delegate the function to whatever business logic service you have.

    Having said that, I do not see any point of using Odata for non database services unless you want to standardize processes.