Skip to Content
RESTful Java Web Services - Third Edition
book

RESTful Java Web Services - Third Edition

by Balachandar Bogunuva Mohanram
November 2017
Intermediate to advanced
420 pages
10h 29m
English
Packt Publishing
Content preview from RESTful Java Web Services - Third Edition

Relationship operations

OData supports the linking of related resources. Relationships from one entity to another are represented as navigation properties. The following API reads employees in the HR department:

http://localhost:8080/hrapp/odata/Departments("HR")/   EmployeeDetails

The OData service even allows you to add, update, and remove a relation via navigation properties. The following example shows how you can use the navigation properties to link the employee with the id value of 1700 to the IT department:

POST odata/Departments('IT')/Employees/$ref 
OData-Version: 4.0 
Content-Type: application/json;odata.metadata=minimal 
Accept: application/json 
{ 
  "@odata.id": "odata/Employees(1700)" 
} 
Many API vendors have started considering OData ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

RESTful Java Web Services, Second Edition

RESTful Java Web Services, Second Edition

Jobinesh Purushothaman
Java Web Services

Java Web Services

David A Chappell, Tyler Jewell

Publisher Resources

ISBN: 9781788294041Supplemental Content