01-10-2018 9:26 AM - edited 02-04-2024 1:09 AM
Dear Mr. lpradel & SAP Community,
I have a requirement to map business data entities (collections in MongoDB, a NoSQL database) to OData entities (Apache Olingo OData since we use Java-backend with Spring Boot) and expose the OData endpoint contains business data which can be consumed by Fiori UI.
I saw tutorial series from https://blogs.sap.com/author/lpradel/ , which matches more-or-less with my requirements. Here I want to know that can we map business entities (e.g. collection in MongoDB i.e. a NoSQL Database instead of tables in a relational DBMS) to OData entities in this scenario (i.e. Java Back-end) ?
Best Regards, Mahdi
Hello, Mahdi. So far as I know you can map business entity to OData entity by customizing a converter. You Know the data from MongoDB are kinds of XML, JSON or Strings Let's say they actually are kind of String. You can get those Strings base on your business logic and add to OData Entity. What I am trying to say is you can customize your OData Entity base on your requirements.
final Entity e1 = new Entity()
.addProperty(new Property(null, "ID", ValueType.PRIMITIVE, 1))
.addProperty(new Property(null, "Name", ValueType.PRIMITIVE, "Notebook Basic 15"))
.addProperty(new Property(null, "Description", ValueType.PRIMITIVE,
"Notebook Basic, 1.7GHz - 15 XGA - 1024MB DDR2 SDRAM - 40GB"));
e1.setId(createId("Products", 1));
productList.add(e1);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
9 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.