-
Notifications
You must be signed in to change notification settings - Fork 0
ODataService
DimaAy edited this page Aug 23, 2019
·
2 revisions
The service to populate the data and its metadata as Odata standard.
To build the project and its test it is enough to run, from ODataService
directory:
$ mvn clean install
On the other hand, to run and deploy the project:
$ mvn clean spring-boot:run
Once started, the log files are available in the local target/logs
directory.
After building and deploying the service to the server, you can try the following URLs for:
- Service Document http://localhost:8080/odata
- Metadata Document http://localhost:8080/odata/$metadata
- Read Entity Collection http://localhost:8080/odata/Product_Set
- Read a Single Entity http://localhost:8080/odata/Product_Set(1)
- Read a Property for a Single Entity http://localhost:8080/odata/Product_Set(1)/DESCRIPTION
- System Query Options: the following are some examples
-
$top
The first 2 entities http://localhost:8080/odata/Product_Set?$top=2 -
$skip
Exclude the first 2 entities http://localhost:8080/odata/Product_Set?$skip=2 -
$count
Add the full number of all entities to the response payload http://localhost:8080/odata/Product_Set?$count=true -
$orderby
Sort by ID descending http://localhost:8080/odata/Product_Set?$orderby=ID%20desc -
$select
Select the ID of the entity collection http://localhost:8080/odata/Product_Set?$select=ID
or select the ID for a single entity http://localhost:8080/odata/Product_Set(1)?$select=ID -
$filter
The entities with ID greater than 2 http://localhost:8080/odata/Product_Set?$filter=ID%20gt%202
-