text
stringlengths 65
20k
|
---|
Note the expand parameter cannot be combined with the fields parameter.If both parameters are provided, only fields will be considered.Content-Type none Payload none Response From Framework Version 3 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 50, "DepartmentName" : "Shipping", "Employee" : { "items" : [ { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item"Chapter 4 Retrieving Business Objects 4-19 } ] }, { "EmployeeId" : 121, "FirstName" : "Adam", "LastName" : "Fripp", "Email" : "AFRIPP", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8200, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/121", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { ... } ] } ], " count " : 3, " hasMore " : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", " href" : "<base_url>/Department/50/child/Employee ", "name" : "Employee", "kind" : "collection" } ] }, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] } REST API Framework Version 1 or Version 2 Version 1 and version 2 of the REST API framework return the nested child resource expanded in the response payload as an array of resource items.If the resource collection being fetched is large, you may have to make several requests since the array of resource items has a limit.The following samples illustrate functionality for REST API framework version 1 and version 2.The first request sample (URL 1) retrieves a single child resource item identified by employee 120.The URL parameter child identifies the relationship of the requested resource Employee .The second request (URL 2) shows the use of the query parameter expand to ensure that all nested Employee resource items will be returned with Department resource collection 50.Chapter 4 Retrieving Business Objects 4-20The third request (URL 3) shows the use of accessor dot notation (for example, Employee.JobHistory ) in combination with the query parameter expand to ensure that all nested JobHistory resource items will be returned with the Employee resource items for the Department resource collection 80.Request Made With Framework Version 1 or Version 2 URL 1 <base_url>/Department/50/child/Employee/120 URL 2 <base_url>/Department/50?expand=Employee URL 3 <base_url>/Department/80?expand=Employee.JobHistory&onlyData=true HTTP Method GET Query Parameter expand When this parameter is provided in combination with REST API framework version 1, the specified children are included as links in the resource payload.The value of this query parameter is all or <accessor1>,<accessor2>,.. .More than one child can be specified using comma as a separator.Example: ?expand=Employee,Localization .Nested children can also be provided following the format " Child.NestedChild " (Example: ?expand=Employee.Manager ).If a nested child is provided (Example: Employee.Manager ), the missing children will be processed implicitly. |
If both parameters are provided, only fields will be considered.Content-Type none Payload none Response From Framework Version 3 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 50, "DepartmentName" : "Shipping", "Employee" : { "items" : [ { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item"Chapter 4 Retrieving Business Objects 4-19 } ] }, { "EmployeeId" : 121, "FirstName" : "Adam", "LastName" : "Fripp", "Email" : "AFRIPP", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8200, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/121", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { ... } ] } ], " count " : 3, " hasMore " : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", " href" : "<base_url>/Department/50/child/Employee ", "name" : "Employee", "kind" : "collection" } ] }, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] } REST API Framework Version 1 or Version 2 Version 1 and version 2 of the REST API framework return the nested child resource expanded in the response payload as an array of resource items.If the resource collection being fetched is large, you may have to make several requests since the array of resource items has a limit.The following samples illustrate functionality for REST API framework version 1 and version 2.The first request sample (URL 1) retrieves a single child resource item identified by employee 120.The URL parameter child identifies the relationship of the requested resource Employee .The second request (URL 2) shows the use of the query parameter expand to ensure that all nested Employee resource items will be returned with Department resource collection 50.Chapter 4 Retrieving Business Objects 4-20The third request (URL 3) shows the use of accessor dot notation (for example, Employee.JobHistory ) in combination with the query parameter expand to ensure that all nested JobHistory resource items will be returned with the Employee resource items for the Department resource collection 80.Request Made With Framework Version 1 or Version 2 URL 1 <base_url>/Department/50/child/Employee/120 URL 2 <base_url>/Department/50?expand=Employee URL 3 <base_url>/Department/80?expand=Employee.JobHistory&onlyData=true HTTP Method GET Query Parameter expand When this parameter is provided in combination with REST API framework version 1, the specified children are included as links in the resource payload.The value of this query parameter is all or <accessor1>,<accessor2>,.. .More than one child can be specified using comma as a separator.Example: ?expand=Employee,Localization .Nested children can also be provided following the format " Child.NestedChild " (Example: ?expand=Employee.Manager ).If a nested child is provided (Example: Employee.Manager ), the missing children will be processed implicitly.For example, ? |
Content-Type none Payload none Response From Framework Version 3 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 50, "DepartmentName" : "Shipping", "Employee" : { "items" : [ { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item"Chapter 4 Retrieving Business Objects 4-19 } ] }, { "EmployeeId" : 121, "FirstName" : "Adam", "LastName" : "Fripp", "Email" : "AFRIPP", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8200, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/121", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { ... } ] } ], " count " : 3, " hasMore " : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", " href" : "<base_url>/Department/50/child/Employee ", "name" : "Employee", "kind" : "collection" } ] }, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] } REST API Framework Version 1 or Version 2 Version 1 and version 2 of the REST API framework return the nested child resource expanded in the response payload as an array of resource items.If the resource collection being fetched is large, you may have to make several requests since the array of resource items has a limit.The following samples illustrate functionality for REST API framework version 1 and version 2.The first request sample (URL 1) retrieves a single child resource item identified by employee 120.The URL parameter child identifies the relationship of the requested resource Employee .The second request (URL 2) shows the use of the query parameter expand to ensure that all nested Employee resource items will be returned with Department resource collection 50.Chapter 4 Retrieving Business Objects 4-20The third request (URL 3) shows the use of accessor dot notation (for example, Employee.JobHistory ) in combination with the query parameter expand to ensure that all nested JobHistory resource items will be returned with the Employee resource items for the Department resource collection 80.Request Made With Framework Version 1 or Version 2 URL 1 <base_url>/Department/50/child/Employee/120 URL 2 <base_url>/Department/50?expand=Employee URL 3 <base_url>/Department/80?expand=Employee.JobHistory&onlyData=true HTTP Method GET Query Parameter expand When this parameter is provided in combination with REST API framework version 1, the specified children are included as links in the resource payload.The value of this query parameter is all or <accessor1>,<accessor2>,.. .More than one child can be specified using comma as a separator.Example: ?expand=Employee,Localization .Nested children can also be provided following the format " Child.NestedChild " (Example: ?expand=Employee.Manager ).If a nested child is provided (Example: Employee.Manager ), the missing children will be processed implicitly.For example, ?expand=Employee.Manager is the same as ?expand=Employee,Employee.Manager (which will expand Employee and Manager ). |
If the resource collection being fetched is large, you may have to make several requests since the array of resource items has a limit.The following samples illustrate functionality for REST API framework version 1 and version 2.The first request sample (URL 1) retrieves a single child resource item identified by employee 120.The URL parameter child identifies the relationship of the requested resource Employee .The second request (URL 2) shows the use of the query parameter expand to ensure that all nested Employee resource items will be returned with Department resource collection 50.Chapter 4 Retrieving Business Objects 4-20The third request (URL 3) shows the use of accessor dot notation (for example, Employee.JobHistory ) in combination with the query parameter expand to ensure that all nested JobHistory resource items will be returned with the Employee resource items for the Department resource collection 80.Request Made With Framework Version 1 or Version 2 URL 1 <base_url>/Department/50/child/Employee/120 URL 2 <base_url>/Department/50?expand=Employee URL 3 <base_url>/Department/80?expand=Employee.JobHistory&onlyData=true HTTP Method GET Query Parameter expand When this parameter is provided in combination with REST API framework version 1, the specified children are included as links in the resource payload.The value of this query parameter is all or <accessor1>,<accessor2>,.. .More than one child can be specified using comma as a separator.Example: ?expand=Employee,Localization .Nested children can also be provided following the format " Child.NestedChild " (Example: ?expand=Employee.Manager ).If a nested child is provided (Example: Employee.Manager ), the missing children will be processed implicitly.For example, ?expand=Employee.Manager is the same as ?expand=Employee,Employee.Manager (which will expand Employee and Manager ).Content-Type none Payload none Response From Framework Version 1 or Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ {Chapter 4 Retrieving Business Objects 4-21 "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] } Payload 2 { "DepartmentId" : 50, "DepartmentName" : "Shipping", "Employee" : [ { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { "EmployeeId" : 121, "FirstName" : "Adam", "LastName" : "Fripp", "Email" : "AFRIPP", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8200, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/121", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { ... } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50",Chapter 4 Retrieving Business Objects 4-22 "name" : "Department", "kind" : "item" } ] } Payload 3 { "DepartmentId" : 80, "DepartmentName" : "Sales", "RelState" : null, "Employee" : [ ... { "EmployeeId" : 176, "FirstName" : "Jonathon", "LastName" : "Taylor", "Email" : "JTAYLOR", "JobId" : "SA_REP", "DepartmentId" : 80, "Salary" : 8600, "CommissionPct" : 0.2, "JobHistory" : [ { "EmployeeId" : 176, "StartDate" : "2011-03-24", "EndDate" : "2012-12-31", "JobId" : "SA_REP", "DepartmentId" : 80 }, { "EmployeeId" : 176, "StartDate" : "2013-01-01", "EndDate" : "2015-03-31", "JobId" : "SA_MAN", "DepartmentId" : 80 } ] }, ... ] } Fetching Data Only for a Business Object REST APIs support retrieving only the data of a resource collection. |
The following samples illustrate functionality for REST API framework version 1 and version 2.The first request sample (URL 1) retrieves a single child resource item identified by employee 120.The URL parameter child identifies the relationship of the requested resource Employee .The second request (URL 2) shows the use of the query parameter expand to ensure that all nested Employee resource items will be returned with Department resource collection 50.Chapter 4 Retrieving Business Objects 4-20The third request (URL 3) shows the use of accessor dot notation (for example, Employee.JobHistory ) in combination with the query parameter expand to ensure that all nested JobHistory resource items will be returned with the Employee resource items for the Department resource collection 80.Request Made With Framework Version 1 or Version 2 URL 1 <base_url>/Department/50/child/Employee/120 URL 2 <base_url>/Department/50?expand=Employee URL 3 <base_url>/Department/80?expand=Employee.JobHistory&onlyData=true HTTP Method GET Query Parameter expand When this parameter is provided in combination with REST API framework version 1, the specified children are included as links in the resource payload.The value of this query parameter is all or <accessor1>,<accessor2>,.. .More than one child can be specified using comma as a separator.Example: ?expand=Employee,Localization .Nested children can also be provided following the format " Child.NestedChild " (Example: ?expand=Employee.Manager ).If a nested child is provided (Example: Employee.Manager ), the missing children will be processed implicitly.For example, ?expand=Employee.Manager is the same as ?expand=Employee,Employee.Manager (which will expand Employee and Manager ).Content-Type none Payload none Response From Framework Version 1 or Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ {Chapter 4 Retrieving Business Objects 4-21 "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] } Payload 2 { "DepartmentId" : 50, "DepartmentName" : "Shipping", "Employee" : [ { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { "EmployeeId" : 121, "FirstName" : "Adam", "LastName" : "Fripp", "Email" : "AFRIPP", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8200, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/121", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { ... } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50",Chapter 4 Retrieving Business Objects 4-22 "name" : "Department", "kind" : "item" } ] } Payload 3 { "DepartmentId" : 80, "DepartmentName" : "Sales", "RelState" : null, "Employee" : [ ... { "EmployeeId" : 176, "FirstName" : "Jonathon", "LastName" : "Taylor", "Email" : "JTAYLOR", "JobId" : "SA_REP", "DepartmentId" : 80, "Salary" : 8600, "CommissionPct" : 0.2, "JobHistory" : [ { "EmployeeId" : 176, "StartDate" : "2011-03-24", "EndDate" : "2012-12-31", "JobId" : "SA_REP", "DepartmentId" : 80 }, { "EmployeeId" : 176, "StartDate" : "2013-01-01", "EndDate" : "2015-03-31", "JobId" : "SA_MAN", "DepartmentId" : 80 } ] }, ... ] } Fetching Data Only for a Business Object REST APIs support retrieving only the data of a resource collection.The following sample fetches the values of the Employee resource collection attributes. |
The first request sample (URL 1) retrieves a single child resource item identified by employee 120.The URL parameter child identifies the relationship of the requested resource Employee .The second request (URL 2) shows the use of the query parameter expand to ensure that all nested Employee resource items will be returned with Department resource collection 50.Chapter 4 Retrieving Business Objects 4-20The third request (URL 3) shows the use of accessor dot notation (for example, Employee.JobHistory ) in combination with the query parameter expand to ensure that all nested JobHistory resource items will be returned with the Employee resource items for the Department resource collection 80.Request Made With Framework Version 1 or Version 2 URL 1 <base_url>/Department/50/child/Employee/120 URL 2 <base_url>/Department/50?expand=Employee URL 3 <base_url>/Department/80?expand=Employee.JobHistory&onlyData=true HTTP Method GET Query Parameter expand When this parameter is provided in combination with REST API framework version 1, the specified children are included as links in the resource payload.The value of this query parameter is all or <accessor1>,<accessor2>,.. .More than one child can be specified using comma as a separator.Example: ?expand=Employee,Localization .Nested children can also be provided following the format " Child.NestedChild " (Example: ?expand=Employee.Manager ).If a nested child is provided (Example: Employee.Manager ), the missing children will be processed implicitly.For example, ?expand=Employee.Manager is the same as ?expand=Employee,Employee.Manager (which will expand Employee and Manager ).Content-Type none Payload none Response From Framework Version 1 or Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ {Chapter 4 Retrieving Business Objects 4-21 "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] } Payload 2 { "DepartmentId" : 50, "DepartmentName" : "Shipping", "Employee" : [ { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { "EmployeeId" : 121, "FirstName" : "Adam", "LastName" : "Fripp", "Email" : "AFRIPP", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8200, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/121", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { ... } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50",Chapter 4 Retrieving Business Objects 4-22 "name" : "Department", "kind" : "item" } ] } Payload 3 { "DepartmentId" : 80, "DepartmentName" : "Sales", "RelState" : null, "Employee" : [ ... { "EmployeeId" : 176, "FirstName" : "Jonathon", "LastName" : "Taylor", "Email" : "JTAYLOR", "JobId" : "SA_REP", "DepartmentId" : 80, "Salary" : 8600, "CommissionPct" : 0.2, "JobHistory" : [ { "EmployeeId" : 176, "StartDate" : "2011-03-24", "EndDate" : "2012-12-31", "JobId" : "SA_REP", "DepartmentId" : 80 }, { "EmployeeId" : 176, "StartDate" : "2013-01-01", "EndDate" : "2015-03-31", "JobId" : "SA_MAN", "DepartmentId" : 80 } ] }, ... ] } Fetching Data Only for a Business Object REST APIs support retrieving only the data of a resource collection.The following sample fetches the values of the Employee resource collection attributes.The query parameter onlyData ensures the resource is filtered to contain only data in the response payload and no links. |
The URL parameter child identifies the relationship of the requested resource Employee .The second request (URL 2) shows the use of the query parameter expand to ensure that all nested Employee resource items will be returned with Department resource collection 50.Chapter 4 Retrieving Business Objects 4-20The third request (URL 3) shows the use of accessor dot notation (for example, Employee.JobHistory ) in combination with the query parameter expand to ensure that all nested JobHistory resource items will be returned with the Employee resource items for the Department resource collection 80.Request Made With Framework Version 1 or Version 2 URL 1 <base_url>/Department/50/child/Employee/120 URL 2 <base_url>/Department/50?expand=Employee URL 3 <base_url>/Department/80?expand=Employee.JobHistory&onlyData=true HTTP Method GET Query Parameter expand When this parameter is provided in combination with REST API framework version 1, the specified children are included as links in the resource payload.The value of this query parameter is all or <accessor1>,<accessor2>,.. .More than one child can be specified using comma as a separator.Example: ?expand=Employee,Localization .Nested children can also be provided following the format " Child.NestedChild " (Example: ?expand=Employee.Manager ).If a nested child is provided (Example: Employee.Manager ), the missing children will be processed implicitly.For example, ?expand=Employee.Manager is the same as ?expand=Employee,Employee.Manager (which will expand Employee and Manager ).Content-Type none Payload none Response From Framework Version 1 or Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ {Chapter 4 Retrieving Business Objects 4-21 "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] } Payload 2 { "DepartmentId" : 50, "DepartmentName" : "Shipping", "Employee" : [ { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { "EmployeeId" : 121, "FirstName" : "Adam", "LastName" : "Fripp", "Email" : "AFRIPP", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8200, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/121", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { ... } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50",Chapter 4 Retrieving Business Objects 4-22 "name" : "Department", "kind" : "item" } ] } Payload 3 { "DepartmentId" : 80, "DepartmentName" : "Sales", "RelState" : null, "Employee" : [ ... { "EmployeeId" : 176, "FirstName" : "Jonathon", "LastName" : "Taylor", "Email" : "JTAYLOR", "JobId" : "SA_REP", "DepartmentId" : 80, "Salary" : 8600, "CommissionPct" : 0.2, "JobHistory" : [ { "EmployeeId" : 176, "StartDate" : "2011-03-24", "EndDate" : "2012-12-31", "JobId" : "SA_REP", "DepartmentId" : 80 }, { "EmployeeId" : 176, "StartDate" : "2013-01-01", "EndDate" : "2015-03-31", "JobId" : "SA_MAN", "DepartmentId" : 80 } ] }, ... ] } Fetching Data Only for a Business Object REST APIs support retrieving only the data of a resource collection.The following sample fetches the values of the Employee resource collection attributes.The query parameter onlyData ensures the resource is filtered to contain only data in the response payload and no links.Request URL <base_url>/Employee?onlyData=true HTTP Method GET Query ParameterChapter 4 Retrieving Business Objects 4-23onlyData This parameter filters the resource item payload to contain only data (no links section, for example). |
The second request (URL 2) shows the use of the query parameter expand to ensure that all nested Employee resource items will be returned with Department resource collection 50.Chapter 4 Retrieving Business Objects 4-20The third request (URL 3) shows the use of accessor dot notation (for example, Employee.JobHistory ) in combination with the query parameter expand to ensure that all nested JobHistory resource items will be returned with the Employee resource items for the Department resource collection 80.Request Made With Framework Version 1 or Version 2 URL 1 <base_url>/Department/50/child/Employee/120 URL 2 <base_url>/Department/50?expand=Employee URL 3 <base_url>/Department/80?expand=Employee.JobHistory&onlyData=true HTTP Method GET Query Parameter expand When this parameter is provided in combination with REST API framework version 1, the specified children are included as links in the resource payload.The value of this query parameter is all or <accessor1>,<accessor2>,.. .More than one child can be specified using comma as a separator.Example: ?expand=Employee,Localization .Nested children can also be provided following the format " Child.NestedChild " (Example: ?expand=Employee.Manager ).If a nested child is provided (Example: Employee.Manager ), the missing children will be processed implicitly.For example, ?expand=Employee.Manager is the same as ?expand=Employee,Employee.Manager (which will expand Employee and Manager ).Content-Type none Payload none Response From Framework Version 1 or Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ {Chapter 4 Retrieving Business Objects 4-21 "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] } Payload 2 { "DepartmentId" : 50, "DepartmentName" : "Shipping", "Employee" : [ { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { "EmployeeId" : 121, "FirstName" : "Adam", "LastName" : "Fripp", "Email" : "AFRIPP", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8200, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/121", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { ... } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50",Chapter 4 Retrieving Business Objects 4-22 "name" : "Department", "kind" : "item" } ] } Payload 3 { "DepartmentId" : 80, "DepartmentName" : "Sales", "RelState" : null, "Employee" : [ ... { "EmployeeId" : 176, "FirstName" : "Jonathon", "LastName" : "Taylor", "Email" : "JTAYLOR", "JobId" : "SA_REP", "DepartmentId" : 80, "Salary" : 8600, "CommissionPct" : 0.2, "JobHistory" : [ { "EmployeeId" : 176, "StartDate" : "2011-03-24", "EndDate" : "2012-12-31", "JobId" : "SA_REP", "DepartmentId" : 80 }, { "EmployeeId" : 176, "StartDate" : "2013-01-01", "EndDate" : "2015-03-31", "JobId" : "SA_MAN", "DepartmentId" : 80 } ] }, ... ] } Fetching Data Only for a Business Object REST APIs support retrieving only the data of a resource collection.The following sample fetches the values of the Employee resource collection attributes.The query parameter onlyData ensures the resource is filtered to contain only data in the response payload and no links.Request URL <base_url>/Employee?onlyData=true HTTP Method GET Query ParameterChapter 4 Retrieving Business Objects 4-23onlyData This parameter filters the resource item payload to contain only data (no links section, for example).Content-Type none Payload none Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "items" : [ { "EmployeeId" : 101, "FirstName" : "Neena", "LastName" : "Smith", "Email" : "NSMITH", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 2000 }, { "EmployeeId" : 102, "FirstName" : "Lex", "LastName" : "De Haan", "Email" : "LDEHAAN", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 3000 }, { "EmployeeId" : 103, "FirstName" : "Alexander", "LastName" : "Hunold", "Email" : "AHUNOLD", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 4000 }, { "EmployeeId" : 104, "FirstName" : "Bruce", "LastName" : "Ernst", "Email" : "BERNST", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 5000 }, { "EmployeeId" : 105, "FirstName" : "David", "LastName" : "Austin", "Email" : "DAUSTIN", "JobId" : "IT_PROG", "DepartmentId" : 60,Chapter 4 Retrieving Business Objects 4-24 "Salary" : 6000 } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Employee", "name" : "Employee", "kind" : "collection" } ] } Filtering a Business Object with a Query Parameter REST APIs support fetching a resource collection using query expression syntax to filter resource items. |
Request Made With Framework Version 1 or Version 2 URL 1 <base_url>/Department/50/child/Employee/120 URL 2 <base_url>/Department/50?expand=Employee URL 3 <base_url>/Department/80?expand=Employee.JobHistory&onlyData=true HTTP Method GET Query Parameter expand When this parameter is provided in combination with REST API framework version 1, the specified children are included as links in the resource payload.The value of this query parameter is all or <accessor1>,<accessor2>,.. .More than one child can be specified using comma as a separator.Example: ?expand=Employee,Localization .Nested children can also be provided following the format " Child.NestedChild " (Example: ?expand=Employee.Manager ).If a nested child is provided (Example: Employee.Manager ), the missing children will be processed implicitly.For example, ?expand=Employee.Manager is the same as ?expand=Employee,Employee.Manager (which will expand Employee and Manager ).Content-Type none Payload none Response From Framework Version 1 or Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ {Chapter 4 Retrieving Business Objects 4-21 "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] } Payload 2 { "DepartmentId" : 50, "DepartmentName" : "Shipping", "Employee" : [ { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { "EmployeeId" : 121, "FirstName" : "Adam", "LastName" : "Fripp", "Email" : "AFRIPP", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8200, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/121", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { ... } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50",Chapter 4 Retrieving Business Objects 4-22 "name" : "Department", "kind" : "item" } ] } Payload 3 { "DepartmentId" : 80, "DepartmentName" : "Sales", "RelState" : null, "Employee" : [ ... { "EmployeeId" : 176, "FirstName" : "Jonathon", "LastName" : "Taylor", "Email" : "JTAYLOR", "JobId" : "SA_REP", "DepartmentId" : 80, "Salary" : 8600, "CommissionPct" : 0.2, "JobHistory" : [ { "EmployeeId" : 176, "StartDate" : "2011-03-24", "EndDate" : "2012-12-31", "JobId" : "SA_REP", "DepartmentId" : 80 }, { "EmployeeId" : 176, "StartDate" : "2013-01-01", "EndDate" : "2015-03-31", "JobId" : "SA_MAN", "DepartmentId" : 80 } ] }, ... ] } Fetching Data Only for a Business Object REST APIs support retrieving only the data of a resource collection.The following sample fetches the values of the Employee resource collection attributes.The query parameter onlyData ensures the resource is filtered to contain only data in the response payload and no links.Request URL <base_url>/Employee?onlyData=true HTTP Method GET Query ParameterChapter 4 Retrieving Business Objects 4-23onlyData This parameter filters the resource item payload to contain only data (no links section, for example).Content-Type none Payload none Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "items" : [ { "EmployeeId" : 101, "FirstName" : "Neena", "LastName" : "Smith", "Email" : "NSMITH", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 2000 }, { "EmployeeId" : 102, "FirstName" : "Lex", "LastName" : "De Haan", "Email" : "LDEHAAN", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 3000 }, { "EmployeeId" : 103, "FirstName" : "Alexander", "LastName" : "Hunold", "Email" : "AHUNOLD", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 4000 }, { "EmployeeId" : 104, "FirstName" : "Bruce", "LastName" : "Ernst", "Email" : "BERNST", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 5000 }, { "EmployeeId" : 105, "FirstName" : "David", "LastName" : "Austin", "Email" : "DAUSTIN", "JobId" : "IT_PROG", "DepartmentId" : 60,Chapter 4 Retrieving Business Objects 4-24 "Salary" : 6000 } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Employee", "name" : "Employee", "kind" : "collection" } ] } Filtering a Business Object with a Query Parameter REST APIs support fetching a resource collection using query expression syntax to filter resource items.The resource collection may be queried using expressions that differ in syntax depending on the REST API framework version that has been registered for the web application. |
The value of this query parameter is all or <accessor1>,<accessor2>,.. .More than one child can be specified using comma as a separator.Example: ?expand=Employee,Localization .Nested children can also be provided following the format " Child.NestedChild " (Example: ?expand=Employee.Manager ).If a nested child is provided (Example: Employee.Manager ), the missing children will be processed implicitly.For example, ?expand=Employee.Manager is the same as ?expand=Employee,Employee.Manager (which will expand Employee and Manager ).Content-Type none Payload none Response From Framework Version 1 or Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ {Chapter 4 Retrieving Business Objects 4-21 "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] } Payload 2 { "DepartmentId" : 50, "DepartmentName" : "Shipping", "Employee" : [ { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { "EmployeeId" : 121, "FirstName" : "Adam", "LastName" : "Fripp", "Email" : "AFRIPP", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8200, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/121", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { ... } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50",Chapter 4 Retrieving Business Objects 4-22 "name" : "Department", "kind" : "item" } ] } Payload 3 { "DepartmentId" : 80, "DepartmentName" : "Sales", "RelState" : null, "Employee" : [ ... { "EmployeeId" : 176, "FirstName" : "Jonathon", "LastName" : "Taylor", "Email" : "JTAYLOR", "JobId" : "SA_REP", "DepartmentId" : 80, "Salary" : 8600, "CommissionPct" : 0.2, "JobHistory" : [ { "EmployeeId" : 176, "StartDate" : "2011-03-24", "EndDate" : "2012-12-31", "JobId" : "SA_REP", "DepartmentId" : 80 }, { "EmployeeId" : 176, "StartDate" : "2013-01-01", "EndDate" : "2015-03-31", "JobId" : "SA_MAN", "DepartmentId" : 80 } ] }, ... ] } Fetching Data Only for a Business Object REST APIs support retrieving only the data of a resource collection.The following sample fetches the values of the Employee resource collection attributes.The query parameter onlyData ensures the resource is filtered to contain only data in the response payload and no links.Request URL <base_url>/Employee?onlyData=true HTTP Method GET Query ParameterChapter 4 Retrieving Business Objects 4-23onlyData This parameter filters the resource item payload to contain only data (no links section, for example).Content-Type none Payload none Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "items" : [ { "EmployeeId" : 101, "FirstName" : "Neena", "LastName" : "Smith", "Email" : "NSMITH", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 2000 }, { "EmployeeId" : 102, "FirstName" : "Lex", "LastName" : "De Haan", "Email" : "LDEHAAN", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 3000 }, { "EmployeeId" : 103, "FirstName" : "Alexander", "LastName" : "Hunold", "Email" : "AHUNOLD", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 4000 }, { "EmployeeId" : 104, "FirstName" : "Bruce", "LastName" : "Ernst", "Email" : "BERNST", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 5000 }, { "EmployeeId" : 105, "FirstName" : "David", "LastName" : "Austin", "Email" : "DAUSTIN", "JobId" : "IT_PROG", "DepartmentId" : 60,Chapter 4 Retrieving Business Objects 4-24 "Salary" : 6000 } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Employee", "name" : "Employee", "kind" : "collection" } ] } Filtering a Business Object with a Query Parameter REST APIs support fetching a resource collection using query expression syntax to filter resource items.The resource collection may be queried using expressions that differ in syntax depending on the REST API framework version that has been registered for the web application.For details about the REST API framework versions, see Understanding REST API Framework Version Support . |
More than one child can be specified using comma as a separator.Example: ?expand=Employee,Localization .Nested children can also be provided following the format " Child.NestedChild " (Example: ?expand=Employee.Manager ).If a nested child is provided (Example: Employee.Manager ), the missing children will be processed implicitly.For example, ?expand=Employee.Manager is the same as ?expand=Employee,Employee.Manager (which will expand Employee and Manager ).Content-Type none Payload none Response From Framework Version 1 or Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ {Chapter 4 Retrieving Business Objects 4-21 "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] } Payload 2 { "DepartmentId" : 50, "DepartmentName" : "Shipping", "Employee" : [ { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { "EmployeeId" : 121, "FirstName" : "Adam", "LastName" : "Fripp", "Email" : "AFRIPP", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8200, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/121", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { ... } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50",Chapter 4 Retrieving Business Objects 4-22 "name" : "Department", "kind" : "item" } ] } Payload 3 { "DepartmentId" : 80, "DepartmentName" : "Sales", "RelState" : null, "Employee" : [ ... { "EmployeeId" : 176, "FirstName" : "Jonathon", "LastName" : "Taylor", "Email" : "JTAYLOR", "JobId" : "SA_REP", "DepartmentId" : 80, "Salary" : 8600, "CommissionPct" : 0.2, "JobHistory" : [ { "EmployeeId" : 176, "StartDate" : "2011-03-24", "EndDate" : "2012-12-31", "JobId" : "SA_REP", "DepartmentId" : 80 }, { "EmployeeId" : 176, "StartDate" : "2013-01-01", "EndDate" : "2015-03-31", "JobId" : "SA_MAN", "DepartmentId" : 80 } ] }, ... ] } Fetching Data Only for a Business Object REST APIs support retrieving only the data of a resource collection.The following sample fetches the values of the Employee resource collection attributes.The query parameter onlyData ensures the resource is filtered to contain only data in the response payload and no links.Request URL <base_url>/Employee?onlyData=true HTTP Method GET Query ParameterChapter 4 Retrieving Business Objects 4-23onlyData This parameter filters the resource item payload to contain only data (no links section, for example).Content-Type none Payload none Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "items" : [ { "EmployeeId" : 101, "FirstName" : "Neena", "LastName" : "Smith", "Email" : "NSMITH", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 2000 }, { "EmployeeId" : 102, "FirstName" : "Lex", "LastName" : "De Haan", "Email" : "LDEHAAN", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 3000 }, { "EmployeeId" : 103, "FirstName" : "Alexander", "LastName" : "Hunold", "Email" : "AHUNOLD", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 4000 }, { "EmployeeId" : 104, "FirstName" : "Bruce", "LastName" : "Ernst", "Email" : "BERNST", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 5000 }, { "EmployeeId" : 105, "FirstName" : "David", "LastName" : "Austin", "Email" : "DAUSTIN", "JobId" : "IT_PROG", "DepartmentId" : 60,Chapter 4 Retrieving Business Objects 4-24 "Salary" : 6000 } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Employee", "name" : "Employee", "kind" : "collection" } ] } Filtering a Business Object with a Query Parameter REST APIs support fetching a resource collection using query expression syntax to filter resource items.The resource collection may be queried using expressions that differ in syntax depending on the REST API framework version that has been registered for the web application.For details about the REST API framework versions, see Understanding REST API Framework Version Support .The following samples are based on two different versions of the Department resource. |
Example: ?expand=Employee,Localization .Nested children can also be provided following the format " Child.NestedChild " (Example: ?expand=Employee.Manager ).If a nested child is provided (Example: Employee.Manager ), the missing children will be processed implicitly.For example, ?expand=Employee.Manager is the same as ?expand=Employee,Employee.Manager (which will expand Employee and Manager ).Content-Type none Payload none Response From Framework Version 1 or Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ {Chapter 4 Retrieving Business Objects 4-21 "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] } Payload 2 { "DepartmentId" : 50, "DepartmentName" : "Shipping", "Employee" : [ { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { "EmployeeId" : 121, "FirstName" : "Adam", "LastName" : "Fripp", "Email" : "AFRIPP", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8200, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/121", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { ... } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50",Chapter 4 Retrieving Business Objects 4-22 "name" : "Department", "kind" : "item" } ] } Payload 3 { "DepartmentId" : 80, "DepartmentName" : "Sales", "RelState" : null, "Employee" : [ ... { "EmployeeId" : 176, "FirstName" : "Jonathon", "LastName" : "Taylor", "Email" : "JTAYLOR", "JobId" : "SA_REP", "DepartmentId" : 80, "Salary" : 8600, "CommissionPct" : 0.2, "JobHistory" : [ { "EmployeeId" : 176, "StartDate" : "2011-03-24", "EndDate" : "2012-12-31", "JobId" : "SA_REP", "DepartmentId" : 80 }, { "EmployeeId" : 176, "StartDate" : "2013-01-01", "EndDate" : "2015-03-31", "JobId" : "SA_MAN", "DepartmentId" : 80 } ] }, ... ] } Fetching Data Only for a Business Object REST APIs support retrieving only the data of a resource collection.The following sample fetches the values of the Employee resource collection attributes.The query parameter onlyData ensures the resource is filtered to contain only data in the response payload and no links.Request URL <base_url>/Employee?onlyData=true HTTP Method GET Query ParameterChapter 4 Retrieving Business Objects 4-23onlyData This parameter filters the resource item payload to contain only data (no links section, for example).Content-Type none Payload none Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "items" : [ { "EmployeeId" : 101, "FirstName" : "Neena", "LastName" : "Smith", "Email" : "NSMITH", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 2000 }, { "EmployeeId" : 102, "FirstName" : "Lex", "LastName" : "De Haan", "Email" : "LDEHAAN", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 3000 }, { "EmployeeId" : 103, "FirstName" : "Alexander", "LastName" : "Hunold", "Email" : "AHUNOLD", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 4000 }, { "EmployeeId" : 104, "FirstName" : "Bruce", "LastName" : "Ernst", "Email" : "BERNST", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 5000 }, { "EmployeeId" : 105, "FirstName" : "David", "LastName" : "Austin", "Email" : "DAUSTIN", "JobId" : "IT_PROG", "DepartmentId" : 60,Chapter 4 Retrieving Business Objects 4-24 "Salary" : 6000 } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Employee", "name" : "Employee", "kind" : "collection" } ] } Filtering a Business Object with a Query Parameter REST APIs support fetching a resource collection using query expression syntax to filter resource items.The resource collection may be queried using expressions that differ in syntax depending on the REST API framework version that has been registered for the web application.For details about the REST API framework versions, see Understanding REST API Framework Version Support .The following samples are based on two different versions of the Department resource.The URL sample showing resource 1.0 reflects the query-by-example query parameter syntax supported only by version 1 of the REST API framework. |
Nested children can also be provided following the format " Child.NestedChild " (Example: ?expand=Employee.Manager ).If a nested child is provided (Example: Employee.Manager ), the missing children will be processed implicitly.For example, ?expand=Employee.Manager is the same as ?expand=Employee,Employee.Manager (which will expand Employee and Manager ).Content-Type none Payload none Response From Framework Version 1 or Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ {Chapter 4 Retrieving Business Objects 4-21 "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] } Payload 2 { "DepartmentId" : 50, "DepartmentName" : "Shipping", "Employee" : [ { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { "EmployeeId" : 121, "FirstName" : "Adam", "LastName" : "Fripp", "Email" : "AFRIPP", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8200, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/121", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { ... } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50",Chapter 4 Retrieving Business Objects 4-22 "name" : "Department", "kind" : "item" } ] } Payload 3 { "DepartmentId" : 80, "DepartmentName" : "Sales", "RelState" : null, "Employee" : [ ... { "EmployeeId" : 176, "FirstName" : "Jonathon", "LastName" : "Taylor", "Email" : "JTAYLOR", "JobId" : "SA_REP", "DepartmentId" : 80, "Salary" : 8600, "CommissionPct" : 0.2, "JobHistory" : [ { "EmployeeId" : 176, "StartDate" : "2011-03-24", "EndDate" : "2012-12-31", "JobId" : "SA_REP", "DepartmentId" : 80 }, { "EmployeeId" : 176, "StartDate" : "2013-01-01", "EndDate" : "2015-03-31", "JobId" : "SA_MAN", "DepartmentId" : 80 } ] }, ... ] } Fetching Data Only for a Business Object REST APIs support retrieving only the data of a resource collection.The following sample fetches the values of the Employee resource collection attributes.The query parameter onlyData ensures the resource is filtered to contain only data in the response payload and no links.Request URL <base_url>/Employee?onlyData=true HTTP Method GET Query ParameterChapter 4 Retrieving Business Objects 4-23onlyData This parameter filters the resource item payload to contain only data (no links section, for example).Content-Type none Payload none Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "items" : [ { "EmployeeId" : 101, "FirstName" : "Neena", "LastName" : "Smith", "Email" : "NSMITH", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 2000 }, { "EmployeeId" : 102, "FirstName" : "Lex", "LastName" : "De Haan", "Email" : "LDEHAAN", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 3000 }, { "EmployeeId" : 103, "FirstName" : "Alexander", "LastName" : "Hunold", "Email" : "AHUNOLD", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 4000 }, { "EmployeeId" : 104, "FirstName" : "Bruce", "LastName" : "Ernst", "Email" : "BERNST", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 5000 }, { "EmployeeId" : 105, "FirstName" : "David", "LastName" : "Austin", "Email" : "DAUSTIN", "JobId" : "IT_PROG", "DepartmentId" : 60,Chapter 4 Retrieving Business Objects 4-24 "Salary" : 6000 } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Employee", "name" : "Employee", "kind" : "collection" } ] } Filtering a Business Object with a Query Parameter REST APIs support fetching a resource collection using query expression syntax to filter resource items.The resource collection may be queried using expressions that differ in syntax depending on the REST API framework version that has been registered for the web application.For details about the REST API framework versions, see Understanding REST API Framework Version Support .The following samples are based on two different versions of the Department resource.The URL sample showing resource 1.0 reflects the query-by-example query parameter syntax supported only by version 1 of the REST API framework.While the URL sample showing resource 2.0, reflects the rowmatch query parameter syntax supported in REST API framework version 2 (and later). |
expand=Employee.Manager ).If a nested child is provided (Example: Employee.Manager ), the missing children will be processed implicitly.For example, ?expand=Employee.Manager is the same as ?expand=Employee,Employee.Manager (which will expand Employee and Manager ).Content-Type none Payload none Response From Framework Version 1 or Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ {Chapter 4 Retrieving Business Objects 4-21 "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] } Payload 2 { "DepartmentId" : 50, "DepartmentName" : "Shipping", "Employee" : [ { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { "EmployeeId" : 121, "FirstName" : "Adam", "LastName" : "Fripp", "Email" : "AFRIPP", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8200, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/121", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { ... } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50",Chapter 4 Retrieving Business Objects 4-22 "name" : "Department", "kind" : "item" } ] } Payload 3 { "DepartmentId" : 80, "DepartmentName" : "Sales", "RelState" : null, "Employee" : [ ... { "EmployeeId" : 176, "FirstName" : "Jonathon", "LastName" : "Taylor", "Email" : "JTAYLOR", "JobId" : "SA_REP", "DepartmentId" : 80, "Salary" : 8600, "CommissionPct" : 0.2, "JobHistory" : [ { "EmployeeId" : 176, "StartDate" : "2011-03-24", "EndDate" : "2012-12-31", "JobId" : "SA_REP", "DepartmentId" : 80 }, { "EmployeeId" : 176, "StartDate" : "2013-01-01", "EndDate" : "2015-03-31", "JobId" : "SA_MAN", "DepartmentId" : 80 } ] }, ... ] } Fetching Data Only for a Business Object REST APIs support retrieving only the data of a resource collection.The following sample fetches the values of the Employee resource collection attributes.The query parameter onlyData ensures the resource is filtered to contain only data in the response payload and no links.Request URL <base_url>/Employee?onlyData=true HTTP Method GET Query ParameterChapter 4 Retrieving Business Objects 4-23onlyData This parameter filters the resource item payload to contain only data (no links section, for example).Content-Type none Payload none Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "items" : [ { "EmployeeId" : 101, "FirstName" : "Neena", "LastName" : "Smith", "Email" : "NSMITH", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 2000 }, { "EmployeeId" : 102, "FirstName" : "Lex", "LastName" : "De Haan", "Email" : "LDEHAAN", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 3000 }, { "EmployeeId" : 103, "FirstName" : "Alexander", "LastName" : "Hunold", "Email" : "AHUNOLD", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 4000 }, { "EmployeeId" : 104, "FirstName" : "Bruce", "LastName" : "Ernst", "Email" : "BERNST", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 5000 }, { "EmployeeId" : 105, "FirstName" : "David", "LastName" : "Austin", "Email" : "DAUSTIN", "JobId" : "IT_PROG", "DepartmentId" : 60,Chapter 4 Retrieving Business Objects 4-24 "Salary" : 6000 } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Employee", "name" : "Employee", "kind" : "collection" } ] } Filtering a Business Object with a Query Parameter REST APIs support fetching a resource collection using query expression syntax to filter resource items.The resource collection may be queried using expressions that differ in syntax depending on the REST API framework version that has been registered for the web application.For details about the REST API framework versions, see Understanding REST API Framework Version Support .The following samples are based on two different versions of the Department resource.The URL sample showing resource 1.0 reflects the query-by-example query parameter syntax supported only by version 1 of the REST API framework.While the URL sample showing resource 2.0, reflects the rowmatch query parameter syntax supported in REST API framework version 2 (and later).In both framework scenarios, the samples fetch a filtered set of resource items of the Department resource. |
If a nested child is provided (Example: Employee.Manager ), the missing children will be processed implicitly.For example, ?expand=Employee.Manager is the same as ?expand=Employee,Employee.Manager (which will expand Employee and Manager ).Content-Type none Payload none Response From Framework Version 1 or Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ {Chapter 4 Retrieving Business Objects 4-21 "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] } Payload 2 { "DepartmentId" : 50, "DepartmentName" : "Shipping", "Employee" : [ { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { "EmployeeId" : 121, "FirstName" : "Adam", "LastName" : "Fripp", "Email" : "AFRIPP", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8200, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/121", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { ... } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50",Chapter 4 Retrieving Business Objects 4-22 "name" : "Department", "kind" : "item" } ] } Payload 3 { "DepartmentId" : 80, "DepartmentName" : "Sales", "RelState" : null, "Employee" : [ ... { "EmployeeId" : 176, "FirstName" : "Jonathon", "LastName" : "Taylor", "Email" : "JTAYLOR", "JobId" : "SA_REP", "DepartmentId" : 80, "Salary" : 8600, "CommissionPct" : 0.2, "JobHistory" : [ { "EmployeeId" : 176, "StartDate" : "2011-03-24", "EndDate" : "2012-12-31", "JobId" : "SA_REP", "DepartmentId" : 80 }, { "EmployeeId" : 176, "StartDate" : "2013-01-01", "EndDate" : "2015-03-31", "JobId" : "SA_MAN", "DepartmentId" : 80 } ] }, ... ] } Fetching Data Only for a Business Object REST APIs support retrieving only the data of a resource collection.The following sample fetches the values of the Employee resource collection attributes.The query parameter onlyData ensures the resource is filtered to contain only data in the response payload and no links.Request URL <base_url>/Employee?onlyData=true HTTP Method GET Query ParameterChapter 4 Retrieving Business Objects 4-23onlyData This parameter filters the resource item payload to contain only data (no links section, for example).Content-Type none Payload none Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "items" : [ { "EmployeeId" : 101, "FirstName" : "Neena", "LastName" : "Smith", "Email" : "NSMITH", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 2000 }, { "EmployeeId" : 102, "FirstName" : "Lex", "LastName" : "De Haan", "Email" : "LDEHAAN", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 3000 }, { "EmployeeId" : 103, "FirstName" : "Alexander", "LastName" : "Hunold", "Email" : "AHUNOLD", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 4000 }, { "EmployeeId" : 104, "FirstName" : "Bruce", "LastName" : "Ernst", "Email" : "BERNST", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 5000 }, { "EmployeeId" : 105, "FirstName" : "David", "LastName" : "Austin", "Email" : "DAUSTIN", "JobId" : "IT_PROG", "DepartmentId" : 60,Chapter 4 Retrieving Business Objects 4-24 "Salary" : 6000 } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Employee", "name" : "Employee", "kind" : "collection" } ] } Filtering a Business Object with a Query Parameter REST APIs support fetching a resource collection using query expression syntax to filter resource items.The resource collection may be queried using expressions that differ in syntax depending on the REST API framework version that has been registered for the web application.For details about the REST API framework versions, see Understanding REST API Framework Version Support .The following samples are based on two different versions of the Department resource.The URL sample showing resource 1.0 reflects the query-by-example query parameter syntax supported only by version 1 of the REST API framework.While the URL sample showing resource 2.0, reflects the rowmatch query parameter syntax supported in REST API framework version 2 (and later).In both framework scenarios, the samples fetch a filtered set of resource items of the Department resource.Note: For a REST API request, reserved characters that appear in a query parameter value should be encoded. |
For example, ?expand=Employee.Manager is the same as ?expand=Employee,Employee.Manager (which will expand Employee and Manager ).Content-Type none Payload none Response From Framework Version 1 or Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ {Chapter 4 Retrieving Business Objects 4-21 "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] } Payload 2 { "DepartmentId" : 50, "DepartmentName" : "Shipping", "Employee" : [ { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { "EmployeeId" : 121, "FirstName" : "Adam", "LastName" : "Fripp", "Email" : "AFRIPP", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8200, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/121", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { ... } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50",Chapter 4 Retrieving Business Objects 4-22 "name" : "Department", "kind" : "item" } ] } Payload 3 { "DepartmentId" : 80, "DepartmentName" : "Sales", "RelState" : null, "Employee" : [ ... { "EmployeeId" : 176, "FirstName" : "Jonathon", "LastName" : "Taylor", "Email" : "JTAYLOR", "JobId" : "SA_REP", "DepartmentId" : 80, "Salary" : 8600, "CommissionPct" : 0.2, "JobHistory" : [ { "EmployeeId" : 176, "StartDate" : "2011-03-24", "EndDate" : "2012-12-31", "JobId" : "SA_REP", "DepartmentId" : 80 }, { "EmployeeId" : 176, "StartDate" : "2013-01-01", "EndDate" : "2015-03-31", "JobId" : "SA_MAN", "DepartmentId" : 80 } ] }, ... ] } Fetching Data Only for a Business Object REST APIs support retrieving only the data of a resource collection.The following sample fetches the values of the Employee resource collection attributes.The query parameter onlyData ensures the resource is filtered to contain only data in the response payload and no links.Request URL <base_url>/Employee?onlyData=true HTTP Method GET Query ParameterChapter 4 Retrieving Business Objects 4-23onlyData This parameter filters the resource item payload to contain only data (no links section, for example).Content-Type none Payload none Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "items" : [ { "EmployeeId" : 101, "FirstName" : "Neena", "LastName" : "Smith", "Email" : "NSMITH", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 2000 }, { "EmployeeId" : 102, "FirstName" : "Lex", "LastName" : "De Haan", "Email" : "LDEHAAN", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 3000 }, { "EmployeeId" : 103, "FirstName" : "Alexander", "LastName" : "Hunold", "Email" : "AHUNOLD", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 4000 }, { "EmployeeId" : 104, "FirstName" : "Bruce", "LastName" : "Ernst", "Email" : "BERNST", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 5000 }, { "EmployeeId" : 105, "FirstName" : "David", "LastName" : "Austin", "Email" : "DAUSTIN", "JobId" : "IT_PROG", "DepartmentId" : 60,Chapter 4 Retrieving Business Objects 4-24 "Salary" : 6000 } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Employee", "name" : "Employee", "kind" : "collection" } ] } Filtering a Business Object with a Query Parameter REST APIs support fetching a resource collection using query expression syntax to filter resource items.The resource collection may be queried using expressions that differ in syntax depending on the REST API framework version that has been registered for the web application.For details about the REST API framework versions, see Understanding REST API Framework Version Support .The following samples are based on two different versions of the Department resource.The URL sample showing resource 1.0 reflects the query-by-example query parameter syntax supported only by version 1 of the REST API framework.While the URL sample showing resource 2.0, reflects the rowmatch query parameter syntax supported in REST API framework version 2 (and later).In both framework scenarios, the samples fetch a filtered set of resource items of the Department resource.Note: For a REST API request, reserved characters that appear in a query parameter value should be encoded.For example, the + character in a timestamp value must be encoded as %2B. |
expand=Employee.Manager is the same as ?expand=Employee,Employee.Manager (which will expand Employee and Manager ).Content-Type none Payload none Response From Framework Version 1 or Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ {Chapter 4 Retrieving Business Objects 4-21 "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] } Payload 2 { "DepartmentId" : 50, "DepartmentName" : "Shipping", "Employee" : [ { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { "EmployeeId" : 121, "FirstName" : "Adam", "LastName" : "Fripp", "Email" : "AFRIPP", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8200, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/121", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { ... } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50",Chapter 4 Retrieving Business Objects 4-22 "name" : "Department", "kind" : "item" } ] } Payload 3 { "DepartmentId" : 80, "DepartmentName" : "Sales", "RelState" : null, "Employee" : [ ... { "EmployeeId" : 176, "FirstName" : "Jonathon", "LastName" : "Taylor", "Email" : "JTAYLOR", "JobId" : "SA_REP", "DepartmentId" : 80, "Salary" : 8600, "CommissionPct" : 0.2, "JobHistory" : [ { "EmployeeId" : 176, "StartDate" : "2011-03-24", "EndDate" : "2012-12-31", "JobId" : "SA_REP", "DepartmentId" : 80 }, { "EmployeeId" : 176, "StartDate" : "2013-01-01", "EndDate" : "2015-03-31", "JobId" : "SA_MAN", "DepartmentId" : 80 } ] }, ... ] } Fetching Data Only for a Business Object REST APIs support retrieving only the data of a resource collection.The following sample fetches the values of the Employee resource collection attributes.The query parameter onlyData ensures the resource is filtered to contain only data in the response payload and no links.Request URL <base_url>/Employee?onlyData=true HTTP Method GET Query ParameterChapter 4 Retrieving Business Objects 4-23onlyData This parameter filters the resource item payload to contain only data (no links section, for example).Content-Type none Payload none Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "items" : [ { "EmployeeId" : 101, "FirstName" : "Neena", "LastName" : "Smith", "Email" : "NSMITH", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 2000 }, { "EmployeeId" : 102, "FirstName" : "Lex", "LastName" : "De Haan", "Email" : "LDEHAAN", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 3000 }, { "EmployeeId" : 103, "FirstName" : "Alexander", "LastName" : "Hunold", "Email" : "AHUNOLD", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 4000 }, { "EmployeeId" : 104, "FirstName" : "Bruce", "LastName" : "Ernst", "Email" : "BERNST", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 5000 }, { "EmployeeId" : 105, "FirstName" : "David", "LastName" : "Austin", "Email" : "DAUSTIN", "JobId" : "IT_PROG", "DepartmentId" : 60,Chapter 4 Retrieving Business Objects 4-24 "Salary" : 6000 } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Employee", "name" : "Employee", "kind" : "collection" } ] } Filtering a Business Object with a Query Parameter REST APIs support fetching a resource collection using query expression syntax to filter resource items.The resource collection may be queried using expressions that differ in syntax depending on the REST API framework version that has been registered for the web application.For details about the REST API framework versions, see Understanding REST API Framework Version Support .The following samples are based on two different versions of the Department resource.The URL sample showing resource 1.0 reflects the query-by-example query parameter syntax supported only by version 1 of the REST API framework.While the URL sample showing resource 2.0, reflects the rowmatch query parameter syntax supported in REST API framework version 2 (and later).In both framework scenarios, the samples fetch a filtered set of resource items of the Department resource.Note: For a REST API request, reserved characters that appear in a query parameter value should be encoded.For example, the + character in a timestamp value must be encoded as %2B.Additionally, resource and resource items names used in query parameter operations are case sensitive. |
Content-Type none Payload none Response From Framework Version 1 or Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ {Chapter 4 Retrieving Business Objects 4-21 "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] } Payload 2 { "DepartmentId" : 50, "DepartmentName" : "Shipping", "Employee" : [ { "EmployeeId" : 120, "FirstName" : "Matthew", "LastName" : "Weiss", "Email" : "MWEISS", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8000, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/120", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { "EmployeeId" : 121, "FirstName" : "Adam", "LastName" : "Fripp", "Email" : "AFRIPP", "JobId" : "ST_MAN", "DepartmentId" : 50, "Salary" : 8200, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50/child/Employee/121", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/50", "name" : "Department", "kind" : "item" } ] }, { ... } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/50",Chapter 4 Retrieving Business Objects 4-22 "name" : "Department", "kind" : "item" } ] } Payload 3 { "DepartmentId" : 80, "DepartmentName" : "Sales", "RelState" : null, "Employee" : [ ... { "EmployeeId" : 176, "FirstName" : "Jonathon", "LastName" : "Taylor", "Email" : "JTAYLOR", "JobId" : "SA_REP", "DepartmentId" : 80, "Salary" : 8600, "CommissionPct" : 0.2, "JobHistory" : [ { "EmployeeId" : 176, "StartDate" : "2011-03-24", "EndDate" : "2012-12-31", "JobId" : "SA_REP", "DepartmentId" : 80 }, { "EmployeeId" : 176, "StartDate" : "2013-01-01", "EndDate" : "2015-03-31", "JobId" : "SA_MAN", "DepartmentId" : 80 } ] }, ... ] } Fetching Data Only for a Business Object REST APIs support retrieving only the data of a resource collection.The following sample fetches the values of the Employee resource collection attributes.The query parameter onlyData ensures the resource is filtered to contain only data in the response payload and no links.Request URL <base_url>/Employee?onlyData=true HTTP Method GET Query ParameterChapter 4 Retrieving Business Objects 4-23onlyData This parameter filters the resource item payload to contain only data (no links section, for example).Content-Type none Payload none Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "items" : [ { "EmployeeId" : 101, "FirstName" : "Neena", "LastName" : "Smith", "Email" : "NSMITH", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 2000 }, { "EmployeeId" : 102, "FirstName" : "Lex", "LastName" : "De Haan", "Email" : "LDEHAAN", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 3000 }, { "EmployeeId" : 103, "FirstName" : "Alexander", "LastName" : "Hunold", "Email" : "AHUNOLD", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 4000 }, { "EmployeeId" : 104, "FirstName" : "Bruce", "LastName" : "Ernst", "Email" : "BERNST", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 5000 }, { "EmployeeId" : 105, "FirstName" : "David", "LastName" : "Austin", "Email" : "DAUSTIN", "JobId" : "IT_PROG", "DepartmentId" : 60,Chapter 4 Retrieving Business Objects 4-24 "Salary" : 6000 } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Employee", "name" : "Employee", "kind" : "collection" } ] } Filtering a Business Object with a Query Parameter REST APIs support fetching a resource collection using query expression syntax to filter resource items.The resource collection may be queried using expressions that differ in syntax depending on the REST API framework version that has been registered for the web application.For details about the REST API framework versions, see Understanding REST API Framework Version Support .The following samples are based on two different versions of the Department resource.The URL sample showing resource 1.0 reflects the query-by-example query parameter syntax supported only by version 1 of the REST API framework.While the URL sample showing resource 2.0, reflects the rowmatch query parameter syntax supported in REST API framework version 2 (and later).In both framework scenarios, the samples fetch a filtered set of resource items of the Department resource.Note: For a REST API request, reserved characters that appear in a query parameter value should be encoded.For example, the + character in a timestamp value must be encoded as %2B.Additionally, resource and resource items names used in query parameter operations are case sensitive.REST API Framework Version 2 (and later) Starting with version 2 of the REST API framework, web applications may use an advanced query syntax, also known as rowmatch expressions, to fetch resources. |
The following sample fetches the values of the Employee resource collection attributes.The query parameter onlyData ensures the resource is filtered to contain only data in the response payload and no links.Request URL <base_url>/Employee?onlyData=true HTTP Method GET Query ParameterChapter 4 Retrieving Business Objects 4-23onlyData This parameter filters the resource item payload to contain only data (no links section, for example).Content-Type none Payload none Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "items" : [ { "EmployeeId" : 101, "FirstName" : "Neena", "LastName" : "Smith", "Email" : "NSMITH", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 2000 }, { "EmployeeId" : 102, "FirstName" : "Lex", "LastName" : "De Haan", "Email" : "LDEHAAN", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 3000 }, { "EmployeeId" : 103, "FirstName" : "Alexander", "LastName" : "Hunold", "Email" : "AHUNOLD", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 4000 }, { "EmployeeId" : 104, "FirstName" : "Bruce", "LastName" : "Ernst", "Email" : "BERNST", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 5000 }, { "EmployeeId" : 105, "FirstName" : "David", "LastName" : "Austin", "Email" : "DAUSTIN", "JobId" : "IT_PROG", "DepartmentId" : 60,Chapter 4 Retrieving Business Objects 4-24 "Salary" : 6000 } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Employee", "name" : "Employee", "kind" : "collection" } ] } Filtering a Business Object with a Query Parameter REST APIs support fetching a resource collection using query expression syntax to filter resource items.The resource collection may be queried using expressions that differ in syntax depending on the REST API framework version that has been registered for the web application.For details about the REST API framework versions, see Understanding REST API Framework Version Support .The following samples are based on two different versions of the Department resource.The URL sample showing resource 1.0 reflects the query-by-example query parameter syntax supported only by version 1 of the REST API framework.While the URL sample showing resource 2.0, reflects the rowmatch query parameter syntax supported in REST API framework version 2 (and later).In both framework scenarios, the samples fetch a filtered set of resource items of the Department resource.Note: For a REST API request, reserved characters that appear in a query parameter value should be encoded.For example, the + character in a timestamp value must be encoded as %2B.Additionally, resource and resource items names used in query parameter operations are case sensitive.REST API Framework Version 2 (and later) Starting with version 2 of the REST API framework, web applications may use an advanced query syntax, also known as rowmatch expressions, to fetch resources.For a complete description of the query syntax available in version 2 (and later), Understanding Framework Support for Query Syntax . |
The query parameter onlyData ensures the resource is filtered to contain only data in the response payload and no links.Request URL <base_url>/Employee?onlyData=true HTTP Method GET Query ParameterChapter 4 Retrieving Business Objects 4-23onlyData This parameter filters the resource item payload to contain only data (no links section, for example).Content-Type none Payload none Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "items" : [ { "EmployeeId" : 101, "FirstName" : "Neena", "LastName" : "Smith", "Email" : "NSMITH", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 2000 }, { "EmployeeId" : 102, "FirstName" : "Lex", "LastName" : "De Haan", "Email" : "LDEHAAN", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 3000 }, { "EmployeeId" : 103, "FirstName" : "Alexander", "LastName" : "Hunold", "Email" : "AHUNOLD", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 4000 }, { "EmployeeId" : 104, "FirstName" : "Bruce", "LastName" : "Ernst", "Email" : "BERNST", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 5000 }, { "EmployeeId" : 105, "FirstName" : "David", "LastName" : "Austin", "Email" : "DAUSTIN", "JobId" : "IT_PROG", "DepartmentId" : 60,Chapter 4 Retrieving Business Objects 4-24 "Salary" : 6000 } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Employee", "name" : "Employee", "kind" : "collection" } ] } Filtering a Business Object with a Query Parameter REST APIs support fetching a resource collection using query expression syntax to filter resource items.The resource collection may be queried using expressions that differ in syntax depending on the REST API framework version that has been registered for the web application.For details about the REST API framework versions, see Understanding REST API Framework Version Support .The following samples are based on two different versions of the Department resource.The URL sample showing resource 1.0 reflects the query-by-example query parameter syntax supported only by version 1 of the REST API framework.While the URL sample showing resource 2.0, reflects the rowmatch query parameter syntax supported in REST API framework version 2 (and later).In both framework scenarios, the samples fetch a filtered set of resource items of the Department resource.Note: For a REST API request, reserved characters that appear in a query parameter value should be encoded.For example, the + character in a timestamp value must be encoded as %2B.Additionally, resource and resource items names used in query parameter operations are case sensitive.REST API Framework Version 2 (and later) Starting with version 2 of the REST API framework, web applications may use an advanced query syntax, also known as rowmatch expressions, to fetch resources.For a complete description of the query syntax available in version 2 (and later), Understanding Framework Support for Query Syntax .The following sample fetches all departments with at least one employee whose salary is equal to 10000. |
Request URL <base_url>/Employee?onlyData=true HTTP Method GET Query ParameterChapter 4 Retrieving Business Objects 4-23onlyData This parameter filters the resource item payload to contain only data (no links section, for example).Content-Type none Payload none Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "items" : [ { "EmployeeId" : 101, "FirstName" : "Neena", "LastName" : "Smith", "Email" : "NSMITH", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 2000 }, { "EmployeeId" : 102, "FirstName" : "Lex", "LastName" : "De Haan", "Email" : "LDEHAAN", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 3000 }, { "EmployeeId" : 103, "FirstName" : "Alexander", "LastName" : "Hunold", "Email" : "AHUNOLD", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 4000 }, { "EmployeeId" : 104, "FirstName" : "Bruce", "LastName" : "Ernst", "Email" : "BERNST", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 5000 }, { "EmployeeId" : 105, "FirstName" : "David", "LastName" : "Austin", "Email" : "DAUSTIN", "JobId" : "IT_PROG", "DepartmentId" : 60,Chapter 4 Retrieving Business Objects 4-24 "Salary" : 6000 } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Employee", "name" : "Employee", "kind" : "collection" } ] } Filtering a Business Object with a Query Parameter REST APIs support fetching a resource collection using query expression syntax to filter resource items.The resource collection may be queried using expressions that differ in syntax depending on the REST API framework version that has been registered for the web application.For details about the REST API framework versions, see Understanding REST API Framework Version Support .The following samples are based on two different versions of the Department resource.The URL sample showing resource 1.0 reflects the query-by-example query parameter syntax supported only by version 1 of the REST API framework.While the URL sample showing resource 2.0, reflects the rowmatch query parameter syntax supported in REST API framework version 2 (and later).In both framework scenarios, the samples fetch a filtered set of resource items of the Department resource.Note: For a REST API request, reserved characters that appear in a query parameter value should be encoded.For example, the + character in a timestamp value must be encoded as %2B.Additionally, resource and resource items names used in query parameter operations are case sensitive.REST API Framework Version 2 (and later) Starting with version 2 of the REST API framework, web applications may use an advanced query syntax, also known as rowmatch expressions, to fetch resources.For a complete description of the query syntax available in version 2 (and later), Understanding Framework Support for Query Syntax .The following sample fetches all departments with at least one employee whose salary is equal to 10000.This is an example of fetching a parent resource collection ( Department ) and filtering it by a child resource collection attribute ( Employee.Salary ). |
Content-Type none Payload none Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "items" : [ { "EmployeeId" : 101, "FirstName" : "Neena", "LastName" : "Smith", "Email" : "NSMITH", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 2000 }, { "EmployeeId" : 102, "FirstName" : "Lex", "LastName" : "De Haan", "Email" : "LDEHAAN", "JobId" : "AD_VP", "DepartmentId" : 90, "Salary" : 3000 }, { "EmployeeId" : 103, "FirstName" : "Alexander", "LastName" : "Hunold", "Email" : "AHUNOLD", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 4000 }, { "EmployeeId" : 104, "FirstName" : "Bruce", "LastName" : "Ernst", "Email" : "BERNST", "JobId" : "IT_PROG", "DepartmentId" : 60, "Salary" : 5000 }, { "EmployeeId" : 105, "FirstName" : "David", "LastName" : "Austin", "Email" : "DAUSTIN", "JobId" : "IT_PROG", "DepartmentId" : 60,Chapter 4 Retrieving Business Objects 4-24 "Salary" : 6000 } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Employee", "name" : "Employee", "kind" : "collection" } ] } Filtering a Business Object with a Query Parameter REST APIs support fetching a resource collection using query expression syntax to filter resource items.The resource collection may be queried using expressions that differ in syntax depending on the REST API framework version that has been registered for the web application.For details about the REST API framework versions, see Understanding REST API Framework Version Support .The following samples are based on two different versions of the Department resource.The URL sample showing resource 1.0 reflects the query-by-example query parameter syntax supported only by version 1 of the REST API framework.While the URL sample showing resource 2.0, reflects the rowmatch query parameter syntax supported in REST API framework version 2 (and later).In both framework scenarios, the samples fetch a filtered set of resource items of the Department resource.Note: For a REST API request, reserved characters that appear in a query parameter value should be encoded.For example, the + character in a timestamp value must be encoded as %2B.Additionally, resource and resource items names used in query parameter operations are case sensitive.REST API Framework Version 2 (and later) Starting with version 2 of the REST API framework, web applications may use an advanced query syntax, also known as rowmatch expressions, to fetch resources.For a complete description of the query syntax available in version 2 (and later), Understanding Framework Support for Query Syntax .The following sample fetches all departments with at least one employee whose salary is equal to 10000.This is an example of fetching a parent resource collection ( Department ) and filtering it by a child resource collection attribute ( Employee.Salary ).Request Example 1 Made With Framework Version 2 URL <base_url>/Department?q=Employee.Salary = 10000 HTTP MethodChapter 4 Retrieving Business Objects 4-25GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions. |
The resource collection may be queried using expressions that differ in syntax depending on the REST API framework version that has been registered for the web application.For details about the REST API framework versions, see Understanding REST API Framework Version Support .The following samples are based on two different versions of the Department resource.The URL sample showing resource 1.0 reflects the query-by-example query parameter syntax supported only by version 1 of the REST API framework.While the URL sample showing resource 2.0, reflects the rowmatch query parameter syntax supported in REST API framework version 2 (and later).In both framework scenarios, the samples fetch a filtered set of resource items of the Department resource.Note: For a REST API request, reserved characters that appear in a query parameter value should be encoded.For example, the + character in a timestamp value must be encoded as %2B.Additionally, resource and resource items names used in query parameter operations are case sensitive.REST API Framework Version 2 (and later) Starting with version 2 of the REST API framework, web applications may use an advanced query syntax, also known as rowmatch expressions, to fetch resources.For a complete description of the query syntax available in version 2 (and later), Understanding Framework Support for Query Syntax .The following sample fetches all departments with at least one employee whose salary is equal to 10000.This is an example of fetching a parent resource collection ( Department ) and filtering it by a child resource collection attribute ( Employee.Salary ).Request Example 1 Made With Framework Version 2 URL <base_url>/Department?q=Employee.Salary = 10000 HTTP MethodChapter 4 Retrieving Business Objects 4-25GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping. |
For details about the REST API framework versions, see Understanding REST API Framework Version Support .The following samples are based on two different versions of the Department resource.The URL sample showing resource 1.0 reflects the query-by-example query parameter syntax supported only by version 1 of the REST API framework.While the URL sample showing resource 2.0, reflects the rowmatch query parameter syntax supported in REST API framework version 2 (and later).In both framework scenarios, the samples fetch a filtered set of resource items of the Department resource.Note: For a REST API request, reserved characters that appear in a query parameter value should be encoded.For example, the + character in a timestamp value must be encoded as %2B.Additionally, resource and resource items names used in query parameter operations are case sensitive.REST API Framework Version 2 (and later) Starting with version 2 of the REST API framework, web applications may use an advanced query syntax, also known as rowmatch expressions, to fetch resources.For a complete description of the query syntax available in version 2 (and later), Understanding Framework Support for Query Syntax .The following sample fetches all departments with at least one employee whose salary is equal to 10000.This is an example of fetching a parent resource collection ( Department ) and filtering it by a child resource collection attribute ( Employee.Salary ).Request Example 1 Made With Framework Version 2 URL <base_url>/Department?q=Employee.Salary = 10000 HTTP MethodChapter 4 Retrieving Business Objects 4-25GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc! |
The following samples are based on two different versions of the Department resource.The URL sample showing resource 1.0 reflects the query-by-example query parameter syntax supported only by version 1 of the REST API framework.While the URL sample showing resource 2.0, reflects the rowmatch query parameter syntax supported in REST API framework version 2 (and later).In both framework scenarios, the samples fetch a filtered set of resource items of the Department resource.Note: For a REST API request, reserved characters that appear in a query parameter value should be encoded.For example, the + character in a timestamp value must be encoded as %2B.Additionally, resource and resource items names used in query parameter operations are case sensitive.REST API Framework Version 2 (and later) Starting with version 2 of the REST API framework, web applications may use an advanced query syntax, also known as rowmatch expressions, to fetch resources.For a complete description of the query syntax available in version 2 (and later), Understanding Framework Support for Query Syntax .The following sample fetches all departments with at least one employee whose salary is equal to 10000.This is an example of fetching a parent resource collection ( Department ) and filtering it by a child resource collection attribute ( Employee.Salary ).Request Example 1 Made With Framework Version 2 URL <base_url>/Department?q=Employee.Salary = 10000 HTTP MethodChapter 4 Retrieving Business Objects 4-25GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY). |
The URL sample showing resource 1.0 reflects the query-by-example query parameter syntax supported only by version 1 of the REST API framework.While the URL sample showing resource 2.0, reflects the rowmatch query parameter syntax supported in REST API framework version 2 (and later).In both framework scenarios, the samples fetch a filtered set of resource items of the Department resource.Note: For a REST API request, reserved characters that appear in a query parameter value should be encoded.For example, the + character in a timestamp value must be encoded as %2B.Additionally, resource and resource items names used in query parameter operations are case sensitive.REST API Framework Version 2 (and later) Starting with version 2 of the REST API framework, web applications may use an advanced query syntax, also known as rowmatch expressions, to fetch resources.For a complete description of the query syntax available in version 2 (and later), Understanding Framework Support for Query Syntax .The following sample fetches all departments with at least one employee whose salary is equal to 10000.This is an example of fetching a parent resource collection ( Department ) and filtering it by a child resource collection attribute ( Employee.Salary ).Request Example 1 Made With Framework Version 2 URL <base_url>/Department?q=Employee.Salary = 10000 HTTP MethodChapter 4 Retrieving Business Objects 4-25GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY).Content-Type none Payload none Response Example 1 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 70, "DepartmentName" : "Public Relations", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/70", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/70/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 80, "DepartmentName" : "Sales", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/820", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/80/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25,Chapter 4 Retrieving Business Objects 4-26 "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } The following sample fetches all departments with the numeric ID of 10 or a department name that begins with the letter "H". |
While the URL sample showing resource 2.0, reflects the rowmatch query parameter syntax supported in REST API framework version 2 (and later).In both framework scenarios, the samples fetch a filtered set of resource items of the Department resource.Note: For a REST API request, reserved characters that appear in a query parameter value should be encoded.For example, the + character in a timestamp value must be encoded as %2B.Additionally, resource and resource items names used in query parameter operations are case sensitive.REST API Framework Version 2 (and later) Starting with version 2 of the REST API framework, web applications may use an advanced query syntax, also known as rowmatch expressions, to fetch resources.For a complete description of the query syntax available in version 2 (and later), Understanding Framework Support for Query Syntax .The following sample fetches all departments with at least one employee whose salary is equal to 10000.This is an example of fetching a parent resource collection ( Department ) and filtering it by a child resource collection attribute ( Employee.Salary ).Request Example 1 Made With Framework Version 2 URL <base_url>/Department?q=Employee.Salary = 10000 HTTP MethodChapter 4 Retrieving Business Objects 4-25GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY).Content-Type none Payload none Response Example 1 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 70, "DepartmentName" : "Public Relations", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/70", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/70/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 80, "DepartmentName" : "Sales", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/820", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/80/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25,Chapter 4 Retrieving Business Objects 4-26 "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } The following sample fetches all departments with the numeric ID of 10 or a department name that begins with the letter "H".Request Example 2 Made With Framework Version 2 URL <base_url>/Department?q=DepartmentId = 10 or DepartmentName like 'H*' HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions. |
In both framework scenarios, the samples fetch a filtered set of resource items of the Department resource.Note: For a REST API request, reserved characters that appear in a query parameter value should be encoded.For example, the + character in a timestamp value must be encoded as %2B.Additionally, resource and resource items names used in query parameter operations are case sensitive.REST API Framework Version 2 (and later) Starting with version 2 of the REST API framework, web applications may use an advanced query syntax, also known as rowmatch expressions, to fetch resources.For a complete description of the query syntax available in version 2 (and later), Understanding Framework Support for Query Syntax .The following sample fetches all departments with at least one employee whose salary is equal to 10000.This is an example of fetching a parent resource collection ( Department ) and filtering it by a child resource collection attribute ( Employee.Salary ).Request Example 1 Made With Framework Version 2 URL <base_url>/Department?q=Employee.Salary = 10000 HTTP MethodChapter 4 Retrieving Business Objects 4-25GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY).Content-Type none Payload none Response Example 1 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 70, "DepartmentName" : "Public Relations", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/70", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/70/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 80, "DepartmentName" : "Sales", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/820", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/80/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25,Chapter 4 Retrieving Business Objects 4-26 "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } The following sample fetches all departments with the numeric ID of 10 or a department name that begins with the letter "H".Request Example 2 Made With Framework Version 2 URL <base_url>/Department?q=DepartmentId = 10 or DepartmentName like 'H*' HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping. |
Note: For a REST API request, reserved characters that appear in a query parameter value should be encoded.For example, the + character in a timestamp value must be encoded as %2B.Additionally, resource and resource items names used in query parameter operations are case sensitive.REST API Framework Version 2 (and later) Starting with version 2 of the REST API framework, web applications may use an advanced query syntax, also known as rowmatch expressions, to fetch resources.For a complete description of the query syntax available in version 2 (and later), Understanding Framework Support for Query Syntax .The following sample fetches all departments with at least one employee whose salary is equal to 10000.This is an example of fetching a parent resource collection ( Department ) and filtering it by a child resource collection attribute ( Employee.Salary ).Request Example 1 Made With Framework Version 2 URL <base_url>/Department?q=Employee.Salary = 10000 HTTP MethodChapter 4 Retrieving Business Objects 4-25GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY).Content-Type none Payload none Response Example 1 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 70, "DepartmentName" : "Public Relations", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/70", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/70/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 80, "DepartmentName" : "Sales", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/820", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/80/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25,Chapter 4 Retrieving Business Objects 4-26 "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } The following sample fetches all departments with the numeric ID of 10 or a department name that begins with the letter "H".Request Example 2 Made With Framework Version 2 URL <base_url>/Department?q=DepartmentId = 10 or DepartmentName like 'H*' HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY) . |
For example, the + character in a timestamp value must be encoded as %2B.Additionally, resource and resource items names used in query parameter operations are case sensitive.REST API Framework Version 2 (and later) Starting with version 2 of the REST API framework, web applications may use an advanced query syntax, also known as rowmatch expressions, to fetch resources.For a complete description of the query syntax available in version 2 (and later), Understanding Framework Support for Query Syntax .The following sample fetches all departments with at least one employee whose salary is equal to 10000.This is an example of fetching a parent resource collection ( Department ) and filtering it by a child resource collection attribute ( Employee.Salary ).Request Example 1 Made With Framework Version 2 URL <base_url>/Department?q=Employee.Salary = 10000 HTTP MethodChapter 4 Retrieving Business Objects 4-25GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY).Content-Type none Payload none Response Example 1 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 70, "DepartmentName" : "Public Relations", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/70", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/70/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 80, "DepartmentName" : "Sales", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/820", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/80/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25,Chapter 4 Retrieving Business Objects 4-26 "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } The following sample fetches all departments with the numeric ID of 10 or a department name that begins with the letter "H".Request Example 2 Made With Framework Version 2 URL <base_url>/Department?q=DepartmentId = 10 or DepartmentName like 'H*' HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY) .Content-Type none Payload none Response Example 2 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, {Chapter 4 Retrieving Business Objects 4-27 "DepartmentId" : 40, "DepartmentName" : "Human Resources", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/40", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/40/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } REST API Framework Version 1 Version 1 of the REST API framework supports a query-by-example syntax. |
Additionally, resource and resource items names used in query parameter operations are case sensitive.REST API Framework Version 2 (and later) Starting with version 2 of the REST API framework, web applications may use an advanced query syntax, also known as rowmatch expressions, to fetch resources.For a complete description of the query syntax available in version 2 (and later), Understanding Framework Support for Query Syntax .The following sample fetches all departments with at least one employee whose salary is equal to 10000.This is an example of fetching a parent resource collection ( Department ) and filtering it by a child resource collection attribute ( Employee.Salary ).Request Example 1 Made With Framework Version 2 URL <base_url>/Department?q=Employee.Salary = 10000 HTTP MethodChapter 4 Retrieving Business Objects 4-25GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY).Content-Type none Payload none Response Example 1 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 70, "DepartmentName" : "Public Relations", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/70", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/70/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 80, "DepartmentName" : "Sales", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/820", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/80/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25,Chapter 4 Retrieving Business Objects 4-26 "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } The following sample fetches all departments with the numeric ID of 10 or a department name that begins with the letter "H".Request Example 2 Made With Framework Version 2 URL <base_url>/Department?q=DepartmentId = 10 or DepartmentName like 'H*' HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY) .Content-Type none Payload none Response Example 2 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, {Chapter 4 Retrieving Business Objects 4-27 "DepartmentId" : 40, "DepartmentName" : "Human Resources", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/40", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/40/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } REST API Framework Version 1 Version 1 of the REST API framework supports a query-by-example syntax.No application configuration changes are required to use this syntax that is supported only in versions 1. |
REST API Framework Version 2 (and later) Starting with version 2 of the REST API framework, web applications may use an advanced query syntax, also known as rowmatch expressions, to fetch resources.For a complete description of the query syntax available in version 2 (and later), Understanding Framework Support for Query Syntax .The following sample fetches all departments with at least one employee whose salary is equal to 10000.This is an example of fetching a parent resource collection ( Department ) and filtering it by a child resource collection attribute ( Employee.Salary ).Request Example 1 Made With Framework Version 2 URL <base_url>/Department?q=Employee.Salary = 10000 HTTP MethodChapter 4 Retrieving Business Objects 4-25GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY).Content-Type none Payload none Response Example 1 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 70, "DepartmentName" : "Public Relations", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/70", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/70/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 80, "DepartmentName" : "Sales", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/820", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/80/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25,Chapter 4 Retrieving Business Objects 4-26 "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } The following sample fetches all departments with the numeric ID of 10 or a department name that begins with the letter "H".Request Example 2 Made With Framework Version 2 URL <base_url>/Department?q=DepartmentId = 10 or DepartmentName like 'H*' HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY) .Content-Type none Payload none Response Example 2 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, {Chapter 4 Retrieving Business Objects 4-27 "DepartmentId" : 40, "DepartmentName" : "Human Resources", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/40", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/40/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } REST API Framework Version 1 Version 1 of the REST API framework supports a query-by-example syntax.No application configuration changes are required to use this syntax that is supported only in versions 1.For a description of the query syntax available in version 1 of the REST API framework, see GET Method Endpoints . |
For a complete description of the query syntax available in version 2 (and later), Understanding Framework Support for Query Syntax .The following sample fetches all departments with at least one employee whose salary is equal to 10000.This is an example of fetching a parent resource collection ( Department ) and filtering it by a child resource collection attribute ( Employee.Salary ).Request Example 1 Made With Framework Version 2 URL <base_url>/Department?q=Employee.Salary = 10000 HTTP MethodChapter 4 Retrieving Business Objects 4-25GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY).Content-Type none Payload none Response Example 1 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 70, "DepartmentName" : "Public Relations", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/70", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/70/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 80, "DepartmentName" : "Sales", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/820", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/80/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25,Chapter 4 Retrieving Business Objects 4-26 "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } The following sample fetches all departments with the numeric ID of 10 or a department name that begins with the letter "H".Request Example 2 Made With Framework Version 2 URL <base_url>/Department?q=DepartmentId = 10 or DepartmentName like 'H*' HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY) .Content-Type none Payload none Response Example 2 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, {Chapter 4 Retrieving Business Objects 4-27 "DepartmentId" : 40, "DepartmentName" : "Human Resources", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/40", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/40/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } REST API Framework Version 1 Version 1 of the REST API framework supports a query-by-example syntax.No application configuration changes are required to use this syntax that is supported only in versions 1.For a description of the query syntax available in version 1 of the REST API framework, see GET Method Endpoints .Note: In version 1 of the ADF REST framework, when you create a query with a string matching filter parameter and the string to match contains a query syntax reserved word (such as AND or OR), then the quoted string must be delimited by a space character to separate it from other parameters in the query expression. |
The following sample fetches all departments with at least one employee whose salary is equal to 10000.This is an example of fetching a parent resource collection ( Department ) and filtering it by a child resource collection attribute ( Employee.Salary ).Request Example 1 Made With Framework Version 2 URL <base_url>/Department?q=Employee.Salary = 10000 HTTP MethodChapter 4 Retrieving Business Objects 4-25GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY).Content-Type none Payload none Response Example 1 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 70, "DepartmentName" : "Public Relations", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/70", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/70/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 80, "DepartmentName" : "Sales", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/820", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/80/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25,Chapter 4 Retrieving Business Objects 4-26 "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } The following sample fetches all departments with the numeric ID of 10 or a department name that begins with the letter "H".Request Example 2 Made With Framework Version 2 URL <base_url>/Department?q=DepartmentId = 10 or DepartmentName like 'H*' HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY) .Content-Type none Payload none Response Example 2 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, {Chapter 4 Retrieving Business Objects 4-27 "DepartmentId" : 40, "DepartmentName" : "Human Resources", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/40", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/40/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } REST API Framework Version 1 Version 1 of the REST API framework supports a query-by-example syntax.No application configuration changes are required to use this syntax that is supported only in versions 1.For a description of the query syntax available in version 1 of the REST API framework, see GET Method Endpoints .Note: In version 1 of the ADF REST framework, when you create a query with a string matching filter parameter and the string to match contains a query syntax reserved word (such as AND or OR), then the quoted string must be delimited by a space character to separate it from other parameters in the query expression.For example, the following query attempts to filter on the quoted string Accounting and Finance . |
This is an example of fetching a parent resource collection ( Department ) and filtering it by a child resource collection attribute ( Employee.Salary ).Request Example 1 Made With Framework Version 2 URL <base_url>/Department?q=Employee.Salary = 10000 HTTP MethodChapter 4 Retrieving Business Objects 4-25GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY).Content-Type none Payload none Response Example 1 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 70, "DepartmentName" : "Public Relations", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/70", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/70/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 80, "DepartmentName" : "Sales", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/820", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/80/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25,Chapter 4 Retrieving Business Objects 4-26 "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } The following sample fetches all departments with the numeric ID of 10 or a department name that begins with the letter "H".Request Example 2 Made With Framework Version 2 URL <base_url>/Department?q=DepartmentId = 10 or DepartmentName like 'H*' HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY) .Content-Type none Payload none Response Example 2 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, {Chapter 4 Retrieving Business Objects 4-27 "DepartmentId" : 40, "DepartmentName" : "Human Resources", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/40", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/40/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } REST API Framework Version 1 Version 1 of the REST API framework supports a query-by-example syntax.No application configuration changes are required to use this syntax that is supported only in versions 1.For a description of the query syntax available in version 1 of the REST API framework, see GET Method Endpoints .Note: In version 1 of the ADF REST framework, when you create a query with a string matching filter parameter and the string to match contains a query syntax reserved word (such as AND or OR), then the quoted string must be delimited by a space character to separate it from other parameters in the query expression.For example, the following query attempts to filter on the quoted string Accounting and Finance .Since the string contains the reserved word AND, the string matching filter parameter requires a space before and after the single quotes to be viable in version 1. |
Request Example 1 Made With Framework Version 2 URL <base_url>/Department?q=Employee.Salary = 10000 HTTP MethodChapter 4 Retrieving Business Objects 4-25GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY).Content-Type none Payload none Response Example 1 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 70, "DepartmentName" : "Public Relations", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/70", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/70/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 80, "DepartmentName" : "Sales", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/820", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/80/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25,Chapter 4 Retrieving Business Objects 4-26 "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } The following sample fetches all departments with the numeric ID of 10 or a department name that begins with the letter "H".Request Example 2 Made With Framework Version 2 URL <base_url>/Department?q=DepartmentId = 10 or DepartmentName like 'H*' HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY) .Content-Type none Payload none Response Example 2 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, {Chapter 4 Retrieving Business Objects 4-27 "DepartmentId" : 40, "DepartmentName" : "Human Resources", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/40", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/40/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } REST API Framework Version 1 Version 1 of the REST API framework supports a query-by-example syntax.No application configuration changes are required to use this syntax that is supported only in versions 1.For a description of the query syntax available in version 1 of the REST API framework, see GET Method Endpoints .Note: In version 1 of the ADF REST framework, when you create a query with a string matching filter parameter and the string to match contains a query syntax reserved word (such as AND or OR), then the quoted string must be delimited by a space character to separate it from other parameters in the query expression.For example, the following query attempts to filter on the quoted string Accounting and Finance .Since the string contains the reserved word AND, the string matching filter parameter requires a space before and after the single quotes to be viable in version 1.?q=DepartmentName= 'Accounting and Finance' &fields=DepartmentName,Location Note that starting in framework version 2, the use of a space character is no longer required to delimit a string matching filter that contains a reserved word. |
Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY).Content-Type none Payload none Response Example 1 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 70, "DepartmentName" : "Public Relations", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/70", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/70/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 80, "DepartmentName" : "Sales", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/820", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/80/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25,Chapter 4 Retrieving Business Objects 4-26 "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } The following sample fetches all departments with the numeric ID of 10 or a department name that begins with the letter "H".Request Example 2 Made With Framework Version 2 URL <base_url>/Department?q=DepartmentId = 10 or DepartmentName like 'H*' HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY) .Content-Type none Payload none Response Example 2 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, {Chapter 4 Retrieving Business Objects 4-27 "DepartmentId" : 40, "DepartmentName" : "Human Resources", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/40", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/40/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } REST API Framework Version 1 Version 1 of the REST API framework supports a query-by-example syntax.No application configuration changes are required to use this syntax that is supported only in versions 1.For a description of the query syntax available in version 1 of the REST API framework, see GET Method Endpoints .Note: In version 1 of the ADF REST framework, when you create a query with a string matching filter parameter and the string to match contains a query syntax reserved word (such as AND or OR), then the quoted string must be delimited by a space character to separate it from other parameters in the query expression.For example, the following query attempts to filter on the quoted string Accounting and Finance .Since the string contains the reserved word AND, the string matching filter parameter requires a space before and after the single quotes to be viable in version 1.?q=DepartmentName= 'Accounting and Finance' &fields=DepartmentName,Location Note that starting in framework version 2, the use of a space character is no longer required to delimit a string matching filter that contains a reserved word.The following sample fetches departments assigned a DepartmentId value less than 30. |
For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY).Content-Type none Payload none Response Example 1 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 70, "DepartmentName" : "Public Relations", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/70", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/70/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 80, "DepartmentName" : "Sales", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/820", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/80/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25,Chapter 4 Retrieving Business Objects 4-26 "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } The following sample fetches all departments with the numeric ID of 10 or a department name that begins with the letter "H".Request Example 2 Made With Framework Version 2 URL <base_url>/Department?q=DepartmentId = 10 or DepartmentName like 'H*' HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY) .Content-Type none Payload none Response Example 2 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, {Chapter 4 Retrieving Business Objects 4-27 "DepartmentId" : 40, "DepartmentName" : "Human Resources", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/40", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/40/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } REST API Framework Version 1 Version 1 of the REST API framework supports a query-by-example syntax.No application configuration changes are required to use this syntax that is supported only in versions 1.For a description of the query syntax available in version 1 of the REST API framework, see GET Method Endpoints .Note: In version 1 of the ADF REST framework, when you create a query with a string matching filter parameter and the string to match contains a query syntax reserved word (such as AND or OR), then the quoted string must be delimited by a space character to separate it from other parameters in the query expression.For example, the following query attempts to filter on the quoted string Accounting and Finance .Since the string contains the reserved word AND, the string matching filter parameter requires a space before and after the single quotes to be viable in version 1.?q=DepartmentName= 'Accounting and Finance' &fields=DepartmentName,Location Note that starting in framework version 2, the use of a space character is no longer required to delimit a string matching filter that contains a reserved word.The following sample fetches departments assigned a DepartmentId value less than 30.Request Made With Framework Version 1 URLChapter 4 Retrieving Business Objects 4-28<base_url>/Department?q=DepartmentId<30 HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions. |
=NY).Content-Type none Payload none Response Example 1 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 70, "DepartmentName" : "Public Relations", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/70", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/70/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 80, "DepartmentName" : "Sales", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/820", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/80/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25,Chapter 4 Retrieving Business Objects 4-26 "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } The following sample fetches all departments with the numeric ID of 10 or a department name that begins with the letter "H".Request Example 2 Made With Framework Version 2 URL <base_url>/Department?q=DepartmentId = 10 or DepartmentName like 'H*' HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY) .Content-Type none Payload none Response Example 2 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, {Chapter 4 Retrieving Business Objects 4-27 "DepartmentId" : 40, "DepartmentName" : "Human Resources", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/40", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/40/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } REST API Framework Version 1 Version 1 of the REST API framework supports a query-by-example syntax.No application configuration changes are required to use this syntax that is supported only in versions 1.For a description of the query syntax available in version 1 of the REST API framework, see GET Method Endpoints .Note: In version 1 of the ADF REST framework, when you create a query with a string matching filter parameter and the string to match contains a query syntax reserved word (such as AND or OR), then the quoted string must be delimited by a space character to separate it from other parameters in the query expression.For example, the following query attempts to filter on the quoted string Accounting and Finance .Since the string contains the reserved word AND, the string matching filter parameter requires a space before and after the single quotes to be viable in version 1.?q=DepartmentName= 'Accounting and Finance' &fields=DepartmentName,Location Note that starting in framework version 2, the use of a space character is no longer required to delimit a string matching filter that contains a reserved word.The following sample fetches departments assigned a DepartmentId value less than 30.Request Made With Framework Version 1 URLChapter 4 Retrieving Business Objects 4-28<base_url>/Department?q=DepartmentId<30 HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.In REST API framework version 1, the value of this query parameter is a list of semi-colon separated query-by-example expressions. |
Content-Type none Payload none Response Example 1 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 70, "DepartmentName" : "Public Relations", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/70", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/70/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 80, "DepartmentName" : "Sales", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/820", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/80/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25,Chapter 4 Retrieving Business Objects 4-26 "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } The following sample fetches all departments with the numeric ID of 10 or a department name that begins with the letter "H".Request Example 2 Made With Framework Version 2 URL <base_url>/Department?q=DepartmentId = 10 or DepartmentName like 'H*' HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY) .Content-Type none Payload none Response Example 2 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, {Chapter 4 Retrieving Business Objects 4-27 "DepartmentId" : 40, "DepartmentName" : "Human Resources", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/40", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/40/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } REST API Framework Version 1 Version 1 of the REST API framework supports a query-by-example syntax.No application configuration changes are required to use this syntax that is supported only in versions 1.For a description of the query syntax available in version 1 of the REST API framework, see GET Method Endpoints .Note: In version 1 of the ADF REST framework, when you create a query with a string matching filter parameter and the string to match contains a query syntax reserved word (such as AND or OR), then the quoted string must be delimited by a space character to separate it from other parameters in the query expression.For example, the following query attempts to filter on the quoted string Accounting and Finance .Since the string contains the reserved word AND, the string matching filter parameter requires a space before and after the single quotes to be viable in version 1.?q=DepartmentName= 'Accounting and Finance' &fields=DepartmentName,Location Note that starting in framework version 2, the use of a space character is no longer required to delimit a string matching filter that contains a reserved word.The following sample fetches departments assigned a DepartmentId value less than 30.Request Made With Framework Version 1 URLChapter 4 Retrieving Business Objects 4-28<base_url>/Department?q=DepartmentId<30 HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.In REST API framework version 1, the value of this query parameter is a list of semi-colon separated query-by-example expressions.For example, ?q=Deptno=10 and <=30;Loc!=NY . |
Request Example 2 Made With Framework Version 2 URL <base_url>/Department?q=DepartmentId = 10 or DepartmentName like 'H*' HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY) .Content-Type none Payload none Response Example 2 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, {Chapter 4 Retrieving Business Objects 4-27 "DepartmentId" : 40, "DepartmentName" : "Human Resources", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/40", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/40/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } REST API Framework Version 1 Version 1 of the REST API framework supports a query-by-example syntax.No application configuration changes are required to use this syntax that is supported only in versions 1.For a description of the query syntax available in version 1 of the REST API framework, see GET Method Endpoints .Note: In version 1 of the ADF REST framework, when you create a query with a string matching filter parameter and the string to match contains a query syntax reserved word (such as AND or OR), then the quoted string must be delimited by a space character to separate it from other parameters in the query expression.For example, the following query attempts to filter on the quoted string Accounting and Finance .Since the string contains the reserved word AND, the string matching filter parameter requires a space before and after the single quotes to be viable in version 1.?q=DepartmentName= 'Accounting and Finance' &fields=DepartmentName,Location Note that starting in framework version 2, the use of a space character is no longer required to delimit a string matching filter that contains a reserved word.The following sample fetches departments assigned a DepartmentId value less than 30.Request Made With Framework Version 1 URLChapter 4 Retrieving Business Objects 4-28<base_url>/Department?q=DepartmentId<30 HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.In REST API framework version 1, the value of this query parameter is a list of semi-colon separated query-by-example expressions.For example, ?q=Deptno=10 and <=30;Loc!=NY .Content-Type none Payload none Response From Framework Version 1 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 20, "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2,Chapter 4 Retrieving Business Objects 4-29 "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Creating Business Object Items REST APIs support the HTTP POST method to create a resource item. |
Starting with REST API framework version 2, complex filters may combine expressions using the and and or conjunctions with matching sets of parentheses for grouping.For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY) .Content-Type none Payload none Response Example 2 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, {Chapter 4 Retrieving Business Objects 4-27 "DepartmentId" : 40, "DepartmentName" : "Human Resources", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/40", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/40/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } REST API Framework Version 1 Version 1 of the REST API framework supports a query-by-example syntax.No application configuration changes are required to use this syntax that is supported only in versions 1.For a description of the query syntax available in version 1 of the REST API framework, see GET Method Endpoints .Note: In version 1 of the ADF REST framework, when you create a query with a string matching filter parameter and the string to match contains a query syntax reserved word (such as AND or OR), then the quoted string must be delimited by a space character to separate it from other parameters in the query expression.For example, the following query attempts to filter on the quoted string Accounting and Finance .Since the string contains the reserved word AND, the string matching filter parameter requires a space before and after the single quotes to be viable in version 1.?q=DepartmentName= 'Accounting and Finance' &fields=DepartmentName,Location Note that starting in framework version 2, the use of a space character is no longer required to delimit a string matching filter that contains a reserved word.The following sample fetches departments assigned a DepartmentId value less than 30.Request Made With Framework Version 1 URLChapter 4 Retrieving Business Objects 4-28<base_url>/Department?q=DepartmentId<30 HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.In REST API framework version 1, the value of this query parameter is a list of semi-colon separated query-by-example expressions.For example, ?q=Deptno=10 and <=30;Loc!=NY .Content-Type none Payload none Response From Framework Version 1 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 20, "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2,Chapter 4 Retrieving Business Objects 4-29 "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Creating Business Object Items REST APIs support the HTTP POST method to create a resource item.REST APIs support the following creation use cases: Creating a resource item in an existing resource collection. |
For example, ?q=(Deptno>=10 and <= 30) and (Loc!=NY) .Content-Type none Payload none Response Example 2 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, {Chapter 4 Retrieving Business Objects 4-27 "DepartmentId" : 40, "DepartmentName" : "Human Resources", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/40", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/40/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } REST API Framework Version 1 Version 1 of the REST API framework supports a query-by-example syntax.No application configuration changes are required to use this syntax that is supported only in versions 1.For a description of the query syntax available in version 1 of the REST API framework, see GET Method Endpoints .Note: In version 1 of the ADF REST framework, when you create a query with a string matching filter parameter and the string to match contains a query syntax reserved word (such as AND or OR), then the quoted string must be delimited by a space character to separate it from other parameters in the query expression.For example, the following query attempts to filter on the quoted string Accounting and Finance .Since the string contains the reserved word AND, the string matching filter parameter requires a space before and after the single quotes to be viable in version 1.?q=DepartmentName= 'Accounting and Finance' &fields=DepartmentName,Location Note that starting in framework version 2, the use of a space character is no longer required to delimit a string matching filter that contains a reserved word.The following sample fetches departments assigned a DepartmentId value less than 30.Request Made With Framework Version 1 URLChapter 4 Retrieving Business Objects 4-28<base_url>/Department?q=DepartmentId<30 HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.In REST API framework version 1, the value of this query parameter is a list of semi-colon separated query-by-example expressions.For example, ?q=Deptno=10 and <=30;Loc!=NY .Content-Type none Payload none Response From Framework Version 1 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 20, "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2,Chapter 4 Retrieving Business Objects 4-29 "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Creating Business Object Items REST APIs support the HTTP POST method to create a resource item.REST APIs support the following creation use cases: Creating a resource item in an existing resource collection.Creating a child item and parent resource item (where the resource collection of each item form a child-parent relationship) in one roundtrip. |
Content-Type none Payload none Response Example 2 From Framework Version 2 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, {Chapter 4 Retrieving Business Objects 4-27 "DepartmentId" : 40, "DepartmentName" : "Human Resources", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/40", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/40/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2, "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } REST API Framework Version 1 Version 1 of the REST API framework supports a query-by-example syntax.No application configuration changes are required to use this syntax that is supported only in versions 1.For a description of the query syntax available in version 1 of the REST API framework, see GET Method Endpoints .Note: In version 1 of the ADF REST framework, when you create a query with a string matching filter parameter and the string to match contains a query syntax reserved word (such as AND or OR), then the quoted string must be delimited by a space character to separate it from other parameters in the query expression.For example, the following query attempts to filter on the quoted string Accounting and Finance .Since the string contains the reserved word AND, the string matching filter parameter requires a space before and after the single quotes to be viable in version 1.?q=DepartmentName= 'Accounting and Finance' &fields=DepartmentName,Location Note that starting in framework version 2, the use of a space character is no longer required to delimit a string matching filter that contains a reserved word.The following sample fetches departments assigned a DepartmentId value less than 30.Request Made With Framework Version 1 URLChapter 4 Retrieving Business Objects 4-28<base_url>/Department?q=DepartmentId<30 HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.In REST API framework version 1, the value of this query parameter is a list of semi-colon separated query-by-example expressions.For example, ?q=Deptno=10 and <=30;Loc!=NY .Content-Type none Payload none Response From Framework Version 1 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 20, "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2,Chapter 4 Retrieving Business Objects 4-29 "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Creating Business Object Items REST APIs support the HTTP POST method to create a resource item.REST APIs support the following creation use cases: Creating a resource item in an existing resource collection.Creating a child item and parent resource item (where the resource collection of each item form a child-parent relationship) in one roundtrip.Creating a Business Object Item REST APIs support using the HTTP POST method to create a resource item in an existing resource collection. |
No application configuration changes are required to use this syntax that is supported only in versions 1.For a description of the query syntax available in version 1 of the REST API framework, see GET Method Endpoints .Note: In version 1 of the ADF REST framework, when you create a query with a string matching filter parameter and the string to match contains a query syntax reserved word (such as AND or OR), then the quoted string must be delimited by a space character to separate it from other parameters in the query expression.For example, the following query attempts to filter on the quoted string Accounting and Finance .Since the string contains the reserved word AND, the string matching filter parameter requires a space before and after the single quotes to be viable in version 1.?q=DepartmentName= 'Accounting and Finance' &fields=DepartmentName,Location Note that starting in framework version 2, the use of a space character is no longer required to delimit a string matching filter that contains a reserved word.The following sample fetches departments assigned a DepartmentId value less than 30.Request Made With Framework Version 1 URLChapter 4 Retrieving Business Objects 4-28<base_url>/Department?q=DepartmentId<30 HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.In REST API framework version 1, the value of this query parameter is a list of semi-colon separated query-by-example expressions.For example, ?q=Deptno=10 and <=30;Loc!=NY .Content-Type none Payload none Response From Framework Version 1 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 20, "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2,Chapter 4 Retrieving Business Objects 4-29 "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Creating Business Object Items REST APIs support the HTTP POST method to create a resource item.REST APIs support the following creation use cases: Creating a resource item in an existing resource collection.Creating a child item and parent resource item (where the resource collection of each item form a child-parent relationship) in one roundtrip.Creating a Business Object Item REST APIs support using the HTTP POST method to create a resource item in an existing resource collection.The following sample creates a new resource item in the existing Department resource collection. |
For a description of the query syntax available in version 1 of the REST API framework, see GET Method Endpoints .Note: In version 1 of the ADF REST framework, when you create a query with a string matching filter parameter and the string to match contains a query syntax reserved word (such as AND or OR), then the quoted string must be delimited by a space character to separate it from other parameters in the query expression.For example, the following query attempts to filter on the quoted string Accounting and Finance .Since the string contains the reserved word AND, the string matching filter parameter requires a space before and after the single quotes to be viable in version 1.?q=DepartmentName= 'Accounting and Finance' &fields=DepartmentName,Location Note that starting in framework version 2, the use of a space character is no longer required to delimit a string matching filter that contains a reserved word.The following sample fetches departments assigned a DepartmentId value less than 30.Request Made With Framework Version 1 URLChapter 4 Retrieving Business Objects 4-28<base_url>/Department?q=DepartmentId<30 HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.In REST API framework version 1, the value of this query parameter is a list of semi-colon separated query-by-example expressions.For example, ?q=Deptno=10 and <=30;Loc!=NY .Content-Type none Payload none Response From Framework Version 1 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 20, "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2,Chapter 4 Retrieving Business Objects 4-29 "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Creating Business Object Items REST APIs support the HTTP POST method to create a resource item.REST APIs support the following creation use cases: Creating a resource item in an existing resource collection.Creating a child item and parent resource item (where the resource collection of each item form a child-parent relationship) in one roundtrip.Creating a Business Object Item REST APIs support using the HTTP POST method to create a resource item in an existing resource collection.The following sample creates a new resource item in the existing Department resource collection.Request URL <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept" } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15Chapter 4 Creating Business Object Items 4-30Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Creating an Item of a Child Business Object REST APIs support creating a resource item in the child resource collection of an existing parent resource collection. |
Note: In version 1 of the ADF REST framework, when you create a query with a string matching filter parameter and the string to match contains a query syntax reserved word (such as AND or OR), then the quoted string must be delimited by a space character to separate it from other parameters in the query expression.For example, the following query attempts to filter on the quoted string Accounting and Finance .Since the string contains the reserved word AND, the string matching filter parameter requires a space before and after the single quotes to be viable in version 1.?q=DepartmentName= 'Accounting and Finance' &fields=DepartmentName,Location Note that starting in framework version 2, the use of a space character is no longer required to delimit a string matching filter that contains a reserved word.The following sample fetches departments assigned a DepartmentId value less than 30.Request Made With Framework Version 1 URLChapter 4 Retrieving Business Objects 4-28<base_url>/Department?q=DepartmentId<30 HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.In REST API framework version 1, the value of this query parameter is a list of semi-colon separated query-by-example expressions.For example, ?q=Deptno=10 and <=30;Loc!=NY .Content-Type none Payload none Response From Framework Version 1 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 20, "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2,Chapter 4 Retrieving Business Objects 4-29 "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Creating Business Object Items REST APIs support the HTTP POST method to create a resource item.REST APIs support the following creation use cases: Creating a resource item in an existing resource collection.Creating a child item and parent resource item (where the resource collection of each item form a child-parent relationship) in one roundtrip.Creating a Business Object Item REST APIs support using the HTTP POST method to create a resource item in an existing resource collection.The following sample creates a new resource item in the existing Department resource collection.Request URL <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept" } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15Chapter 4 Creating Business Object Items 4-30Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Creating an Item of a Child Business Object REST APIs support creating a resource item in the child resource collection of an existing parent resource collection.Alternatively, REST APIs support creating a child item and the parent item in one roundtrip. |
For example, the following query attempts to filter on the quoted string Accounting and Finance .Since the string contains the reserved word AND, the string matching filter parameter requires a space before and after the single quotes to be viable in version 1.?q=DepartmentName= 'Accounting and Finance' &fields=DepartmentName,Location Note that starting in framework version 2, the use of a space character is no longer required to delimit a string matching filter that contains a reserved word.The following sample fetches departments assigned a DepartmentId value less than 30.Request Made With Framework Version 1 URLChapter 4 Retrieving Business Objects 4-28<base_url>/Department?q=DepartmentId<30 HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.In REST API framework version 1, the value of this query parameter is a list of semi-colon separated query-by-example expressions.For example, ?q=Deptno=10 and <=30;Loc!=NY .Content-Type none Payload none Response From Framework Version 1 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 20, "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2,Chapter 4 Retrieving Business Objects 4-29 "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Creating Business Object Items REST APIs support the HTTP POST method to create a resource item.REST APIs support the following creation use cases: Creating a resource item in an existing resource collection.Creating a child item and parent resource item (where the resource collection of each item form a child-parent relationship) in one roundtrip.Creating a Business Object Item REST APIs support using the HTTP POST method to create a resource item in an existing resource collection.The following sample creates a new resource item in the existing Department resource collection.Request URL <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept" } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15Chapter 4 Creating Business Object Items 4-30Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Creating an Item of a Child Business Object REST APIs support creating a resource item in the child resource collection of an existing parent resource collection.Alternatively, REST APIs support creating a child item and the parent item in one roundtrip.Creating a child resource item and its parent resource item will only succeed when both the child resource item and parent resource item do not exist. |
Since the string contains the reserved word AND, the string matching filter parameter requires a space before and after the single quotes to be viable in version 1.?q=DepartmentName= 'Accounting and Finance' &fields=DepartmentName,Location Note that starting in framework version 2, the use of a space character is no longer required to delimit a string matching filter that contains a reserved word.The following sample fetches departments assigned a DepartmentId value less than 30.Request Made With Framework Version 1 URLChapter 4 Retrieving Business Objects 4-28<base_url>/Department?q=DepartmentId<30 HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.In REST API framework version 1, the value of this query parameter is a list of semi-colon separated query-by-example expressions.For example, ?q=Deptno=10 and <=30;Loc!=NY .Content-Type none Payload none Response From Framework Version 1 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 20, "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2,Chapter 4 Retrieving Business Objects 4-29 "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Creating Business Object Items REST APIs support the HTTP POST method to create a resource item.REST APIs support the following creation use cases: Creating a resource item in an existing resource collection.Creating a child item and parent resource item (where the resource collection of each item form a child-parent relationship) in one roundtrip.Creating a Business Object Item REST APIs support using the HTTP POST method to create a resource item in an existing resource collection.The following sample creates a new resource item in the existing Department resource collection.Request URL <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept" } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15Chapter 4 Creating Business Object Items 4-30Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Creating an Item of a Child Business Object REST APIs support creating a resource item in the child resource collection of an existing parent resource collection.Alternatively, REST APIs support creating a child item and the parent item in one roundtrip.Creating a child resource item and its parent resource item will only succeed when both the child resource item and parent resource item do not exist.The following samples create resource items using a POST method. |
?q=DepartmentName= 'Accounting and Finance' &fields=DepartmentName,Location Note that starting in framework version 2, the use of a space character is no longer required to delimit a string matching filter that contains a reserved word.The following sample fetches departments assigned a DepartmentId value less than 30.Request Made With Framework Version 1 URLChapter 4 Retrieving Business Objects 4-28<base_url>/Department?q=DepartmentId<30 HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.In REST API framework version 1, the value of this query parameter is a list of semi-colon separated query-by-example expressions.For example, ?q=Deptno=10 and <=30;Loc!=NY .Content-Type none Payload none Response From Framework Version 1 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 20, "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2,Chapter 4 Retrieving Business Objects 4-29 "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Creating Business Object Items REST APIs support the HTTP POST method to create a resource item.REST APIs support the following creation use cases: Creating a resource item in an existing resource collection.Creating a child item and parent resource item (where the resource collection of each item form a child-parent relationship) in one roundtrip.Creating a Business Object Item REST APIs support using the HTTP POST method to create a resource item in an existing resource collection.The following sample creates a new resource item in the existing Department resource collection.Request URL <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept" } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15Chapter 4 Creating Business Object Items 4-30Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Creating an Item of a Child Business Object REST APIs support creating a resource item in the child resource collection of an existing parent resource collection.Alternatively, REST APIs support creating a child item and the parent item in one roundtrip.Creating a child resource item and its parent resource item will only succeed when both the child resource item and parent resource item do not exist.The following samples create resource items using a POST method.The first request sample (URL1) creates a child resource item identified by employee 999 in the Employee resource collection nested in existing parent resource item 15 of the Department collection. |
The following sample fetches departments assigned a DepartmentId value less than 30.Request Made With Framework Version 1 URLChapter 4 Retrieving Business Objects 4-28<base_url>/Department?q=DepartmentId<30 HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.In REST API framework version 1, the value of this query parameter is a list of semi-colon separated query-by-example expressions.For example, ?q=Deptno=10 and <=30;Loc!=NY .Content-Type none Payload none Response From Framework Version 1 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 20, "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2,Chapter 4 Retrieving Business Objects 4-29 "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Creating Business Object Items REST APIs support the HTTP POST method to create a resource item.REST APIs support the following creation use cases: Creating a resource item in an existing resource collection.Creating a child item and parent resource item (where the resource collection of each item form a child-parent relationship) in one roundtrip.Creating a Business Object Item REST APIs support using the HTTP POST method to create a resource item in an existing resource collection.The following sample creates a new resource item in the existing Department resource collection.Request URL <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept" } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15Chapter 4 Creating Business Object Items 4-30Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Creating an Item of a Child Business Object REST APIs support creating a resource item in the child resource collection of an existing parent resource collection.Alternatively, REST APIs support creating a child item and the parent item in one roundtrip.Creating a child resource item and its parent resource item will only succeed when both the child resource item and parent resource item do not exist.The following samples create resource items using a POST method.The first request sample (URL1) creates a child resource item identified by employee 999 in the Employee resource collection nested in existing parent resource item 15 of the Department collection.The second request (URL2) creates a child resource item identified by employee 99999 in the Employee resource collection and also creates the parent resource item 17 of the Department collection in one roundtrip. |
Request Made With Framework Version 1 URLChapter 4 Retrieving Business Objects 4-28<base_url>/Department?q=DepartmentId<30 HTTP Method GET Query Parameter q This parameter filters the resource collection based on one or more attribute value expressions.In REST API framework version 1, the value of this query parameter is a list of semi-colon separated query-by-example expressions.For example, ?q=Deptno=10 and <=30;Loc!=NY .Content-Type none Payload none Response From Framework Version 1 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 20, "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2,Chapter 4 Retrieving Business Objects 4-29 "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Creating Business Object Items REST APIs support the HTTP POST method to create a resource item.REST APIs support the following creation use cases: Creating a resource item in an existing resource collection.Creating a child item and parent resource item (where the resource collection of each item form a child-parent relationship) in one roundtrip.Creating a Business Object Item REST APIs support using the HTTP POST method to create a resource item in an existing resource collection.The following sample creates a new resource item in the existing Department resource collection.Request URL <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept" } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15Chapter 4 Creating Business Object Items 4-30Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Creating an Item of a Child Business Object REST APIs support creating a resource item in the child resource collection of an existing parent resource collection.Alternatively, REST APIs support creating a child item and the parent item in one roundtrip.Creating a child resource item and its parent resource item will only succeed when both the child resource item and parent resource item do not exist.The following samples create resource items using a POST method.The first request sample (URL1) creates a child resource item identified by employee 999 in the Employee resource collection nested in existing parent resource item 15 of the Department collection.The second request (URL2) creates a child resource item identified by employee 99999 in the Employee resource collection and also creates the parent resource item 17 of the Department collection in one roundtrip.Request URL 1 <base_url>/Department/15/child/Employee URL 2 <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId": 999, "FirstName": "New", "LastName": "Guy", "Email": "NGUY", "JobId": "SA_REP", "DepartmentId": 15, "Salary": 9999 } Payload 2Chapter 4 Creating Business Object Items 4-31{ "DepartmentId": 17, "DepartmentName": "NewerDept", "Employee": [ { "EmployeeId": 99999, "FirstName": "Newer", "LastName": "Guy", "Email": "NRGUY", "JobId": "SA_MAN", "DepartmentId": 17, "Salary": 10001 } ] } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15/child/Employee/999 Payload 1 { "EmployeeId" : 999, "FirstName" : "New", "LastName" : "Guy", "Email" : "NGUY", "JobId" : "SA_REP", "DepartmentId" : 15, "Salary" : 9999, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15/child/Employee/999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" } ] } Location <base_url>/Department/17 Payload 2 { "DepartmentId" : 17, "DepartmentName" : "NewerDept", "Employee" : [ { "EmployeeId" : 99999, "FirstName" : "Newer",Chapter 4 Creating Business Object Items 4-32 "LastName" : "Guy", "Email" : "NRGUY", "JobId" : "SA_MAN", "DepartmentId" : 17, "Salary" : 10001, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17/child/Employee/99999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/17", "name" : "Department", "kind" : "item" } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17", "name" : "Department, "kind" : "item" } ] } Updating a Business Object Item REST APIs support the HTTP PATCH method to update the resource item. |
In REST API framework version 1, the value of this query parameter is a list of semi-colon separated query-by-example expressions.For example, ?q=Deptno=10 and <=30;Loc!=NY .Content-Type none Payload none Response From Framework Version 1 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 20, "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2,Chapter 4 Retrieving Business Objects 4-29 "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Creating Business Object Items REST APIs support the HTTP POST method to create a resource item.REST APIs support the following creation use cases: Creating a resource item in an existing resource collection.Creating a child item and parent resource item (where the resource collection of each item form a child-parent relationship) in one roundtrip.Creating a Business Object Item REST APIs support using the HTTP POST method to create a resource item in an existing resource collection.The following sample creates a new resource item in the existing Department resource collection.Request URL <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept" } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15Chapter 4 Creating Business Object Items 4-30Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Creating an Item of a Child Business Object REST APIs support creating a resource item in the child resource collection of an existing parent resource collection.Alternatively, REST APIs support creating a child item and the parent item in one roundtrip.Creating a child resource item and its parent resource item will only succeed when both the child resource item and parent resource item do not exist.The following samples create resource items using a POST method.The first request sample (URL1) creates a child resource item identified by employee 999 in the Employee resource collection nested in existing parent resource item 15 of the Department collection.The second request (URL2) creates a child resource item identified by employee 99999 in the Employee resource collection and also creates the parent resource item 17 of the Department collection in one roundtrip.Request URL 1 <base_url>/Department/15/child/Employee URL 2 <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId": 999, "FirstName": "New", "LastName": "Guy", "Email": "NGUY", "JobId": "SA_REP", "DepartmentId": 15, "Salary": 9999 } Payload 2Chapter 4 Creating Business Object Items 4-31{ "DepartmentId": 17, "DepartmentName": "NewerDept", "Employee": [ { "EmployeeId": 99999, "FirstName": "Newer", "LastName": "Guy", "Email": "NRGUY", "JobId": "SA_MAN", "DepartmentId": 17, "Salary": 10001 } ] } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15/child/Employee/999 Payload 1 { "EmployeeId" : 999, "FirstName" : "New", "LastName" : "Guy", "Email" : "NGUY", "JobId" : "SA_REP", "DepartmentId" : 15, "Salary" : 9999, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15/child/Employee/999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" } ] } Location <base_url>/Department/17 Payload 2 { "DepartmentId" : 17, "DepartmentName" : "NewerDept", "Employee" : [ { "EmployeeId" : 99999, "FirstName" : "Newer",Chapter 4 Creating Business Object Items 4-32 "LastName" : "Guy", "Email" : "NRGUY", "JobId" : "SA_MAN", "DepartmentId" : 17, "Salary" : 10001, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17/child/Employee/99999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/17", "name" : "Department", "kind" : "item" } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17", "name" : "Department, "kind" : "item" } ] } Updating a Business Object Item REST APIs support the HTTP PATCH method to update the resource item.Update will only succeed when the row already exists. |
For example, ?q=Deptno=10 and <=30;Loc!=NY .Content-Type none Payload none Response From Framework Version 1 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 20, "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2,Chapter 4 Retrieving Business Objects 4-29 "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Creating Business Object Items REST APIs support the HTTP POST method to create a resource item.REST APIs support the following creation use cases: Creating a resource item in an existing resource collection.Creating a child item and parent resource item (where the resource collection of each item form a child-parent relationship) in one roundtrip.Creating a Business Object Item REST APIs support using the HTTP POST method to create a resource item in an existing resource collection.The following sample creates a new resource item in the existing Department resource collection.Request URL <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept" } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15Chapter 4 Creating Business Object Items 4-30Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Creating an Item of a Child Business Object REST APIs support creating a resource item in the child resource collection of an existing parent resource collection.Alternatively, REST APIs support creating a child item and the parent item in one roundtrip.Creating a child resource item and its parent resource item will only succeed when both the child resource item and parent resource item do not exist.The following samples create resource items using a POST method.The first request sample (URL1) creates a child resource item identified by employee 999 in the Employee resource collection nested in existing parent resource item 15 of the Department collection.The second request (URL2) creates a child resource item identified by employee 99999 in the Employee resource collection and also creates the parent resource item 17 of the Department collection in one roundtrip.Request URL 1 <base_url>/Department/15/child/Employee URL 2 <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId": 999, "FirstName": "New", "LastName": "Guy", "Email": "NGUY", "JobId": "SA_REP", "DepartmentId": 15, "Salary": 9999 } Payload 2Chapter 4 Creating Business Object Items 4-31{ "DepartmentId": 17, "DepartmentName": "NewerDept", "Employee": [ { "EmployeeId": 99999, "FirstName": "Newer", "LastName": "Guy", "Email": "NRGUY", "JobId": "SA_MAN", "DepartmentId": 17, "Salary": 10001 } ] } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15/child/Employee/999 Payload 1 { "EmployeeId" : 999, "FirstName" : "New", "LastName" : "Guy", "Email" : "NGUY", "JobId" : "SA_REP", "DepartmentId" : 15, "Salary" : 9999, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15/child/Employee/999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" } ] } Location <base_url>/Department/17 Payload 2 { "DepartmentId" : 17, "DepartmentName" : "NewerDept", "Employee" : [ { "EmployeeId" : 99999, "FirstName" : "Newer",Chapter 4 Creating Business Object Items 4-32 "LastName" : "Guy", "Email" : "NRGUY", "JobId" : "SA_MAN", "DepartmentId" : 17, "Salary" : 10001, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17/child/Employee/99999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/17", "name" : "Department", "kind" : "item" } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17", "name" : "Department, "kind" : "item" } ] } Updating a Business Object Item REST APIs support the HTTP PATCH method to update the resource item.Update will only succeed when the row already exists.The following sample updates department 15, where DepartmentName is changed in the request payload. |
Content-Type none Payload none Response From Framework Version 1 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourcecollection+json Payload { "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { "DepartmentId" : 20, "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] } ], "count" : 2,Chapter 4 Retrieving Business Objects 4-29 "hasMore" : false, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Creating Business Object Items REST APIs support the HTTP POST method to create a resource item.REST APIs support the following creation use cases: Creating a resource item in an existing resource collection.Creating a child item and parent resource item (where the resource collection of each item form a child-parent relationship) in one roundtrip.Creating a Business Object Item REST APIs support using the HTTP POST method to create a resource item in an existing resource collection.The following sample creates a new resource item in the existing Department resource collection.Request URL <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept" } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15Chapter 4 Creating Business Object Items 4-30Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Creating an Item of a Child Business Object REST APIs support creating a resource item in the child resource collection of an existing parent resource collection.Alternatively, REST APIs support creating a child item and the parent item in one roundtrip.Creating a child resource item and its parent resource item will only succeed when both the child resource item and parent resource item do not exist.The following samples create resource items using a POST method.The first request sample (URL1) creates a child resource item identified by employee 999 in the Employee resource collection nested in existing parent resource item 15 of the Department collection.The second request (URL2) creates a child resource item identified by employee 99999 in the Employee resource collection and also creates the parent resource item 17 of the Department collection in one roundtrip.Request URL 1 <base_url>/Department/15/child/Employee URL 2 <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId": 999, "FirstName": "New", "LastName": "Guy", "Email": "NGUY", "JobId": "SA_REP", "DepartmentId": 15, "Salary": 9999 } Payload 2Chapter 4 Creating Business Object Items 4-31{ "DepartmentId": 17, "DepartmentName": "NewerDept", "Employee": [ { "EmployeeId": 99999, "FirstName": "Newer", "LastName": "Guy", "Email": "NRGUY", "JobId": "SA_MAN", "DepartmentId": 17, "Salary": 10001 } ] } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15/child/Employee/999 Payload 1 { "EmployeeId" : 999, "FirstName" : "New", "LastName" : "Guy", "Email" : "NGUY", "JobId" : "SA_REP", "DepartmentId" : 15, "Salary" : 9999, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15/child/Employee/999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" } ] } Location <base_url>/Department/17 Payload 2 { "DepartmentId" : 17, "DepartmentName" : "NewerDept", "Employee" : [ { "EmployeeId" : 99999, "FirstName" : "Newer",Chapter 4 Creating Business Object Items 4-32 "LastName" : "Guy", "Email" : "NRGUY", "JobId" : "SA_MAN", "DepartmentId" : 17, "Salary" : 10001, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17/child/Employee/99999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/17", "name" : "Department", "kind" : "item" } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17", "name" : "Department, "kind" : "item" } ] } Updating a Business Object Item REST APIs support the HTTP PATCH method to update the resource item.Update will only succeed when the row already exists.The following sample updates department 15, where DepartmentName is changed in the request payload.Request URL <base_url>/Department/15 HTTP Method PATCH Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName" } Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+jsonChapter 4 Updating a Business Object Item 4-33Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Deleting a Business Object Item REST APIs support the HTTP DELETE method to delete a resource item. |
REST APIs support the following creation use cases: Creating a resource item in an existing resource collection.Creating a child item and parent resource item (where the resource collection of each item form a child-parent relationship) in one roundtrip.Creating a Business Object Item REST APIs support using the HTTP POST method to create a resource item in an existing resource collection.The following sample creates a new resource item in the existing Department resource collection.Request URL <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept" } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15Chapter 4 Creating Business Object Items 4-30Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Creating an Item of a Child Business Object REST APIs support creating a resource item in the child resource collection of an existing parent resource collection.Alternatively, REST APIs support creating a child item and the parent item in one roundtrip.Creating a child resource item and its parent resource item will only succeed when both the child resource item and parent resource item do not exist.The following samples create resource items using a POST method.The first request sample (URL1) creates a child resource item identified by employee 999 in the Employee resource collection nested in existing parent resource item 15 of the Department collection.The second request (URL2) creates a child resource item identified by employee 99999 in the Employee resource collection and also creates the parent resource item 17 of the Department collection in one roundtrip.Request URL 1 <base_url>/Department/15/child/Employee URL 2 <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId": 999, "FirstName": "New", "LastName": "Guy", "Email": "NGUY", "JobId": "SA_REP", "DepartmentId": 15, "Salary": 9999 } Payload 2Chapter 4 Creating Business Object Items 4-31{ "DepartmentId": 17, "DepartmentName": "NewerDept", "Employee": [ { "EmployeeId": 99999, "FirstName": "Newer", "LastName": "Guy", "Email": "NRGUY", "JobId": "SA_MAN", "DepartmentId": 17, "Salary": 10001 } ] } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15/child/Employee/999 Payload 1 { "EmployeeId" : 999, "FirstName" : "New", "LastName" : "Guy", "Email" : "NGUY", "JobId" : "SA_REP", "DepartmentId" : 15, "Salary" : 9999, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15/child/Employee/999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" } ] } Location <base_url>/Department/17 Payload 2 { "DepartmentId" : 17, "DepartmentName" : "NewerDept", "Employee" : [ { "EmployeeId" : 99999, "FirstName" : "Newer",Chapter 4 Creating Business Object Items 4-32 "LastName" : "Guy", "Email" : "NRGUY", "JobId" : "SA_MAN", "DepartmentId" : 17, "Salary" : 10001, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17/child/Employee/99999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/17", "name" : "Department", "kind" : "item" } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17", "name" : "Department, "kind" : "item" } ] } Updating a Business Object Item REST APIs support the HTTP PATCH method to update the resource item.Update will only succeed when the row already exists.The following sample updates department 15, where DepartmentName is changed in the request payload.Request URL <base_url>/Department/15 HTTP Method PATCH Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName" } Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+jsonChapter 4 Updating a Business Object Item 4-33Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Deleting a Business Object Item REST APIs support the HTTP DELETE method to delete a resource item.REST APIs do not currently support deleting the resource collection. |
Creating a child item and parent resource item (where the resource collection of each item form a child-parent relationship) in one roundtrip.Creating a Business Object Item REST APIs support using the HTTP POST method to create a resource item in an existing resource collection.The following sample creates a new resource item in the existing Department resource collection.Request URL <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept" } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15Chapter 4 Creating Business Object Items 4-30Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Creating an Item of a Child Business Object REST APIs support creating a resource item in the child resource collection of an existing parent resource collection.Alternatively, REST APIs support creating a child item and the parent item in one roundtrip.Creating a child resource item and its parent resource item will only succeed when both the child resource item and parent resource item do not exist.The following samples create resource items using a POST method.The first request sample (URL1) creates a child resource item identified by employee 999 in the Employee resource collection nested in existing parent resource item 15 of the Department collection.The second request (URL2) creates a child resource item identified by employee 99999 in the Employee resource collection and also creates the parent resource item 17 of the Department collection in one roundtrip.Request URL 1 <base_url>/Department/15/child/Employee URL 2 <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId": 999, "FirstName": "New", "LastName": "Guy", "Email": "NGUY", "JobId": "SA_REP", "DepartmentId": 15, "Salary": 9999 } Payload 2Chapter 4 Creating Business Object Items 4-31{ "DepartmentId": 17, "DepartmentName": "NewerDept", "Employee": [ { "EmployeeId": 99999, "FirstName": "Newer", "LastName": "Guy", "Email": "NRGUY", "JobId": "SA_MAN", "DepartmentId": 17, "Salary": 10001 } ] } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15/child/Employee/999 Payload 1 { "EmployeeId" : 999, "FirstName" : "New", "LastName" : "Guy", "Email" : "NGUY", "JobId" : "SA_REP", "DepartmentId" : 15, "Salary" : 9999, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15/child/Employee/999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" } ] } Location <base_url>/Department/17 Payload 2 { "DepartmentId" : 17, "DepartmentName" : "NewerDept", "Employee" : [ { "EmployeeId" : 99999, "FirstName" : "Newer",Chapter 4 Creating Business Object Items 4-32 "LastName" : "Guy", "Email" : "NRGUY", "JobId" : "SA_MAN", "DepartmentId" : 17, "Salary" : 10001, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17/child/Employee/99999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/17", "name" : "Department", "kind" : "item" } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17", "name" : "Department, "kind" : "item" } ] } Updating a Business Object Item REST APIs support the HTTP PATCH method to update the resource item.Update will only succeed when the row already exists.The following sample updates department 15, where DepartmentName is changed in the request payload.Request URL <base_url>/Department/15 HTTP Method PATCH Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName" } Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+jsonChapter 4 Updating a Business Object Item 4-33Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Deleting a Business Object Item REST APIs support the HTTP DELETE method to delete a resource item.REST APIs do not currently support deleting the resource collection.The following sample (URL1) deletes the resource item, employee 99999 in department 17. |
Creating a Business Object Item REST APIs support using the HTTP POST method to create a resource item in an existing resource collection.The following sample creates a new resource item in the existing Department resource collection.Request URL <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept" } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15Chapter 4 Creating Business Object Items 4-30Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Creating an Item of a Child Business Object REST APIs support creating a resource item in the child resource collection of an existing parent resource collection.Alternatively, REST APIs support creating a child item and the parent item in one roundtrip.Creating a child resource item and its parent resource item will only succeed when both the child resource item and parent resource item do not exist.The following samples create resource items using a POST method.The first request sample (URL1) creates a child resource item identified by employee 999 in the Employee resource collection nested in existing parent resource item 15 of the Department collection.The second request (URL2) creates a child resource item identified by employee 99999 in the Employee resource collection and also creates the parent resource item 17 of the Department collection in one roundtrip.Request URL 1 <base_url>/Department/15/child/Employee URL 2 <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId": 999, "FirstName": "New", "LastName": "Guy", "Email": "NGUY", "JobId": "SA_REP", "DepartmentId": 15, "Salary": 9999 } Payload 2Chapter 4 Creating Business Object Items 4-31{ "DepartmentId": 17, "DepartmentName": "NewerDept", "Employee": [ { "EmployeeId": 99999, "FirstName": "Newer", "LastName": "Guy", "Email": "NRGUY", "JobId": "SA_MAN", "DepartmentId": 17, "Salary": 10001 } ] } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15/child/Employee/999 Payload 1 { "EmployeeId" : 999, "FirstName" : "New", "LastName" : "Guy", "Email" : "NGUY", "JobId" : "SA_REP", "DepartmentId" : 15, "Salary" : 9999, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15/child/Employee/999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" } ] } Location <base_url>/Department/17 Payload 2 { "DepartmentId" : 17, "DepartmentName" : "NewerDept", "Employee" : [ { "EmployeeId" : 99999, "FirstName" : "Newer",Chapter 4 Creating Business Object Items 4-32 "LastName" : "Guy", "Email" : "NRGUY", "JobId" : "SA_MAN", "DepartmentId" : 17, "Salary" : 10001, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17/child/Employee/99999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/17", "name" : "Department", "kind" : "item" } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17", "name" : "Department, "kind" : "item" } ] } Updating a Business Object Item REST APIs support the HTTP PATCH method to update the resource item.Update will only succeed when the row already exists.The following sample updates department 15, where DepartmentName is changed in the request payload.Request URL <base_url>/Department/15 HTTP Method PATCH Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName" } Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+jsonChapter 4 Updating a Business Object Item 4-33Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Deleting a Business Object Item REST APIs support the HTTP DELETE method to delete a resource item.REST APIs do not currently support deleting the resource collection.The following sample (URL1) deletes the resource item, employee 99999 in department 17.The second request URL deletes the resource item, department 17. |
The following sample creates a new resource item in the existing Department resource collection.Request URL <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept" } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15Chapter 4 Creating Business Object Items 4-30Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Creating an Item of a Child Business Object REST APIs support creating a resource item in the child resource collection of an existing parent resource collection.Alternatively, REST APIs support creating a child item and the parent item in one roundtrip.Creating a child resource item and its parent resource item will only succeed when both the child resource item and parent resource item do not exist.The following samples create resource items using a POST method.The first request sample (URL1) creates a child resource item identified by employee 999 in the Employee resource collection nested in existing parent resource item 15 of the Department collection.The second request (URL2) creates a child resource item identified by employee 99999 in the Employee resource collection and also creates the parent resource item 17 of the Department collection in one roundtrip.Request URL 1 <base_url>/Department/15/child/Employee URL 2 <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId": 999, "FirstName": "New", "LastName": "Guy", "Email": "NGUY", "JobId": "SA_REP", "DepartmentId": 15, "Salary": 9999 } Payload 2Chapter 4 Creating Business Object Items 4-31{ "DepartmentId": 17, "DepartmentName": "NewerDept", "Employee": [ { "EmployeeId": 99999, "FirstName": "Newer", "LastName": "Guy", "Email": "NRGUY", "JobId": "SA_MAN", "DepartmentId": 17, "Salary": 10001 } ] } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15/child/Employee/999 Payload 1 { "EmployeeId" : 999, "FirstName" : "New", "LastName" : "Guy", "Email" : "NGUY", "JobId" : "SA_REP", "DepartmentId" : 15, "Salary" : 9999, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15/child/Employee/999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" } ] } Location <base_url>/Department/17 Payload 2 { "DepartmentId" : 17, "DepartmentName" : "NewerDept", "Employee" : [ { "EmployeeId" : 99999, "FirstName" : "Newer",Chapter 4 Creating Business Object Items 4-32 "LastName" : "Guy", "Email" : "NRGUY", "JobId" : "SA_MAN", "DepartmentId" : 17, "Salary" : 10001, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17/child/Employee/99999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/17", "name" : "Department", "kind" : "item" } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17", "name" : "Department, "kind" : "item" } ] } Updating a Business Object Item REST APIs support the HTTP PATCH method to update the resource item.Update will only succeed when the row already exists.The following sample updates department 15, where DepartmentName is changed in the request payload.Request URL <base_url>/Department/15 HTTP Method PATCH Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName" } Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+jsonChapter 4 Updating a Business Object Item 4-33Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Deleting a Business Object Item REST APIs support the HTTP DELETE method to delete a resource item.REST APIs do not currently support deleting the resource collection.The following sample (URL1) deletes the resource item, employee 99999 in department 17.The second request URL deletes the resource item, department 17.Request URL 1 <base_url>/Department/17/child/Employee/99999 URL 2 <base_url>/Department/17 HTTP Method DELETE Content-Type none Payload none Response HTTP Code 204 Content-Type none Payload noneChapter 4 Deleting a Business Object Item 4-345 Data Consistency Tasks You can perform data consistency checks while making REST API calls. |
Request URL <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept" } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15Chapter 4 Creating Business Object Items 4-30Payload { "DepartmentId" : 15, "DepartmentName" : "NewDept", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Creating an Item of a Child Business Object REST APIs support creating a resource item in the child resource collection of an existing parent resource collection.Alternatively, REST APIs support creating a child item and the parent item in one roundtrip.Creating a child resource item and its parent resource item will only succeed when both the child resource item and parent resource item do not exist.The following samples create resource items using a POST method.The first request sample (URL1) creates a child resource item identified by employee 999 in the Employee resource collection nested in existing parent resource item 15 of the Department collection.The second request (URL2) creates a child resource item identified by employee 99999 in the Employee resource collection and also creates the parent resource item 17 of the Department collection in one roundtrip.Request URL 1 <base_url>/Department/15/child/Employee URL 2 <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId": 999, "FirstName": "New", "LastName": "Guy", "Email": "NGUY", "JobId": "SA_REP", "DepartmentId": 15, "Salary": 9999 } Payload 2Chapter 4 Creating Business Object Items 4-31{ "DepartmentId": 17, "DepartmentName": "NewerDept", "Employee": [ { "EmployeeId": 99999, "FirstName": "Newer", "LastName": "Guy", "Email": "NRGUY", "JobId": "SA_MAN", "DepartmentId": 17, "Salary": 10001 } ] } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15/child/Employee/999 Payload 1 { "EmployeeId" : 999, "FirstName" : "New", "LastName" : "Guy", "Email" : "NGUY", "JobId" : "SA_REP", "DepartmentId" : 15, "Salary" : 9999, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15/child/Employee/999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" } ] } Location <base_url>/Department/17 Payload 2 { "DepartmentId" : 17, "DepartmentName" : "NewerDept", "Employee" : [ { "EmployeeId" : 99999, "FirstName" : "Newer",Chapter 4 Creating Business Object Items 4-32 "LastName" : "Guy", "Email" : "NRGUY", "JobId" : "SA_MAN", "DepartmentId" : 17, "Salary" : 10001, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17/child/Employee/99999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/17", "name" : "Department", "kind" : "item" } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17", "name" : "Department, "kind" : "item" } ] } Updating a Business Object Item REST APIs support the HTTP PATCH method to update the resource item.Update will only succeed when the row already exists.The following sample updates department 15, where DepartmentName is changed in the request payload.Request URL <base_url>/Department/15 HTTP Method PATCH Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName" } Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+jsonChapter 4 Updating a Business Object Item 4-33Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Deleting a Business Object Item REST APIs support the HTTP DELETE method to delete a resource item.REST APIs do not currently support deleting the resource collection.The following sample (URL1) deletes the resource item, employee 99999 in department 17.The second request URL deletes the resource item, department 17.Request URL 1 <base_url>/Department/17/child/Employee/99999 URL 2 <base_url>/Department/17 HTTP Method DELETE Content-Type none Payload none Response HTTP Code 204 Content-Type none Payload noneChapter 4 Deleting a Business Object Item 4-345 Data Consistency Tasks You can perform data consistency checks while making REST API calls.This capability uses version history in the database to enable you to manage HTTP payloads according to updates in the resource itself. |
Alternatively, REST APIs support creating a child item and the parent item in one roundtrip.Creating a child resource item and its parent resource item will only succeed when both the child resource item and parent resource item do not exist.The following samples create resource items using a POST method.The first request sample (URL1) creates a child resource item identified by employee 999 in the Employee resource collection nested in existing parent resource item 15 of the Department collection.The second request (URL2) creates a child resource item identified by employee 99999 in the Employee resource collection and also creates the parent resource item 17 of the Department collection in one roundtrip.Request URL 1 <base_url>/Department/15/child/Employee URL 2 <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId": 999, "FirstName": "New", "LastName": "Guy", "Email": "NGUY", "JobId": "SA_REP", "DepartmentId": 15, "Salary": 9999 } Payload 2Chapter 4 Creating Business Object Items 4-31{ "DepartmentId": 17, "DepartmentName": "NewerDept", "Employee": [ { "EmployeeId": 99999, "FirstName": "Newer", "LastName": "Guy", "Email": "NRGUY", "JobId": "SA_MAN", "DepartmentId": 17, "Salary": 10001 } ] } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15/child/Employee/999 Payload 1 { "EmployeeId" : 999, "FirstName" : "New", "LastName" : "Guy", "Email" : "NGUY", "JobId" : "SA_REP", "DepartmentId" : 15, "Salary" : 9999, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15/child/Employee/999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" } ] } Location <base_url>/Department/17 Payload 2 { "DepartmentId" : 17, "DepartmentName" : "NewerDept", "Employee" : [ { "EmployeeId" : 99999, "FirstName" : "Newer",Chapter 4 Creating Business Object Items 4-32 "LastName" : "Guy", "Email" : "NRGUY", "JobId" : "SA_MAN", "DepartmentId" : 17, "Salary" : 10001, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17/child/Employee/99999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/17", "name" : "Department", "kind" : "item" } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17", "name" : "Department, "kind" : "item" } ] } Updating a Business Object Item REST APIs support the HTTP PATCH method to update the resource item.Update will only succeed when the row already exists.The following sample updates department 15, where DepartmentName is changed in the request payload.Request URL <base_url>/Department/15 HTTP Method PATCH Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName" } Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+jsonChapter 4 Updating a Business Object Item 4-33Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Deleting a Business Object Item REST APIs support the HTTP DELETE method to delete a resource item.REST APIs do not currently support deleting the resource collection.The following sample (URL1) deletes the resource item, employee 99999 in department 17.The second request URL deletes the resource item, department 17.Request URL 1 <base_url>/Department/17/child/Employee/99999 URL 2 <base_url>/Department/17 HTTP Method DELETE Content-Type none Payload none Response HTTP Code 204 Content-Type none Payload noneChapter 4 Deleting a Business Object Item 4-345 Data Consistency Tasks You can perform data consistency checks while making REST API calls.This capability uses version history in the database to enable you to manage HTTP payloads according to updates in the resource itself.Topics About Data Consistency Checking for Data Consistency When Retrieving Business Object Items Checking for Data Consistency When Updating Business Object Items About Data Consistency REST APIs support checking for data consistency when updating or retrieving a resource item. |
Creating a child resource item and its parent resource item will only succeed when both the child resource item and parent resource item do not exist.The following samples create resource items using a POST method.The first request sample (URL1) creates a child resource item identified by employee 999 in the Employee resource collection nested in existing parent resource item 15 of the Department collection.The second request (URL2) creates a child resource item identified by employee 99999 in the Employee resource collection and also creates the parent resource item 17 of the Department collection in one roundtrip.Request URL 1 <base_url>/Department/15/child/Employee URL 2 <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId": 999, "FirstName": "New", "LastName": "Guy", "Email": "NGUY", "JobId": "SA_REP", "DepartmentId": 15, "Salary": 9999 } Payload 2Chapter 4 Creating Business Object Items 4-31{ "DepartmentId": 17, "DepartmentName": "NewerDept", "Employee": [ { "EmployeeId": 99999, "FirstName": "Newer", "LastName": "Guy", "Email": "NRGUY", "JobId": "SA_MAN", "DepartmentId": 17, "Salary": 10001 } ] } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15/child/Employee/999 Payload 1 { "EmployeeId" : 999, "FirstName" : "New", "LastName" : "Guy", "Email" : "NGUY", "JobId" : "SA_REP", "DepartmentId" : 15, "Salary" : 9999, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15/child/Employee/999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" } ] } Location <base_url>/Department/17 Payload 2 { "DepartmentId" : 17, "DepartmentName" : "NewerDept", "Employee" : [ { "EmployeeId" : 99999, "FirstName" : "Newer",Chapter 4 Creating Business Object Items 4-32 "LastName" : "Guy", "Email" : "NRGUY", "JobId" : "SA_MAN", "DepartmentId" : 17, "Salary" : 10001, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17/child/Employee/99999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/17", "name" : "Department", "kind" : "item" } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17", "name" : "Department, "kind" : "item" } ] } Updating a Business Object Item REST APIs support the HTTP PATCH method to update the resource item.Update will only succeed when the row already exists.The following sample updates department 15, where DepartmentName is changed in the request payload.Request URL <base_url>/Department/15 HTTP Method PATCH Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName" } Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+jsonChapter 4 Updating a Business Object Item 4-33Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Deleting a Business Object Item REST APIs support the HTTP DELETE method to delete a resource item.REST APIs do not currently support deleting the resource collection.The following sample (URL1) deletes the resource item, employee 99999 in department 17.The second request URL deletes the resource item, department 17.Request URL 1 <base_url>/Department/17/child/Employee/99999 URL 2 <base_url>/Department/17 HTTP Method DELETE Content-Type none Payload none Response HTTP Code 204 Content-Type none Payload noneChapter 4 Deleting a Business Object Item 4-345 Data Consistency Tasks You can perform data consistency checks while making REST API calls.This capability uses version history in the database to enable you to manage HTTP payloads according to updates in the resource itself.Topics About Data Consistency Checking for Data Consistency When Retrieving Business Object Items Checking for Data Consistency When Updating Business Object Items About Data Consistency REST APIs support checking for data consistency when updating or retrieving a resource item.Data consistency is enforced by the REST API by generating an entity tag (ETag) with precondition headers so that the resource item matches the server side resource state before updating or retrieving. |
The following samples create resource items using a POST method.The first request sample (URL1) creates a child resource item identified by employee 999 in the Employee resource collection nested in existing parent resource item 15 of the Department collection.The second request (URL2) creates a child resource item identified by employee 99999 in the Employee resource collection and also creates the parent resource item 17 of the Department collection in one roundtrip.Request URL 1 <base_url>/Department/15/child/Employee URL 2 <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId": 999, "FirstName": "New", "LastName": "Guy", "Email": "NGUY", "JobId": "SA_REP", "DepartmentId": 15, "Salary": 9999 } Payload 2Chapter 4 Creating Business Object Items 4-31{ "DepartmentId": 17, "DepartmentName": "NewerDept", "Employee": [ { "EmployeeId": 99999, "FirstName": "Newer", "LastName": "Guy", "Email": "NRGUY", "JobId": "SA_MAN", "DepartmentId": 17, "Salary": 10001 } ] } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15/child/Employee/999 Payload 1 { "EmployeeId" : 999, "FirstName" : "New", "LastName" : "Guy", "Email" : "NGUY", "JobId" : "SA_REP", "DepartmentId" : 15, "Salary" : 9999, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15/child/Employee/999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" } ] } Location <base_url>/Department/17 Payload 2 { "DepartmentId" : 17, "DepartmentName" : "NewerDept", "Employee" : [ { "EmployeeId" : 99999, "FirstName" : "Newer",Chapter 4 Creating Business Object Items 4-32 "LastName" : "Guy", "Email" : "NRGUY", "JobId" : "SA_MAN", "DepartmentId" : 17, "Salary" : 10001, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17/child/Employee/99999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/17", "name" : "Department", "kind" : "item" } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17", "name" : "Department, "kind" : "item" } ] } Updating a Business Object Item REST APIs support the HTTP PATCH method to update the resource item.Update will only succeed when the row already exists.The following sample updates department 15, where DepartmentName is changed in the request payload.Request URL <base_url>/Department/15 HTTP Method PATCH Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName" } Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+jsonChapter 4 Updating a Business Object Item 4-33Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Deleting a Business Object Item REST APIs support the HTTP DELETE method to delete a resource item.REST APIs do not currently support deleting the resource collection.The following sample (URL1) deletes the resource item, employee 99999 in department 17.The second request URL deletes the resource item, department 17.Request URL 1 <base_url>/Department/17/child/Employee/99999 URL 2 <base_url>/Department/17 HTTP Method DELETE Content-Type none Payload none Response HTTP Code 204 Content-Type none Payload noneChapter 4 Deleting a Business Object Item 4-345 Data Consistency Tasks You can perform data consistency checks while making REST API calls.This capability uses version history in the database to enable you to manage HTTP payloads according to updates in the resource itself.Topics About Data Consistency Checking for Data Consistency When Retrieving Business Object Items Checking for Data Consistency When Updating Business Object Items About Data Consistency REST APIs support checking for data consistency when updating or retrieving a resource item.Data consistency is enforced by the REST API by generating an entity tag (ETag) with precondition headers so that the resource item matches the server side resource state before updating or retrieving.REST APIs support generating an entity tag (ETag) in the response header when the requested resource item has data consistency check enabled. |
The first request sample (URL1) creates a child resource item identified by employee 999 in the Employee resource collection nested in existing parent resource item 15 of the Department collection.The second request (URL2) creates a child resource item identified by employee 99999 in the Employee resource collection and also creates the parent resource item 17 of the Department collection in one roundtrip.Request URL 1 <base_url>/Department/15/child/Employee URL 2 <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId": 999, "FirstName": "New", "LastName": "Guy", "Email": "NGUY", "JobId": "SA_REP", "DepartmentId": 15, "Salary": 9999 } Payload 2Chapter 4 Creating Business Object Items 4-31{ "DepartmentId": 17, "DepartmentName": "NewerDept", "Employee": [ { "EmployeeId": 99999, "FirstName": "Newer", "LastName": "Guy", "Email": "NRGUY", "JobId": "SA_MAN", "DepartmentId": 17, "Salary": 10001 } ] } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15/child/Employee/999 Payload 1 { "EmployeeId" : 999, "FirstName" : "New", "LastName" : "Guy", "Email" : "NGUY", "JobId" : "SA_REP", "DepartmentId" : 15, "Salary" : 9999, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15/child/Employee/999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" } ] } Location <base_url>/Department/17 Payload 2 { "DepartmentId" : 17, "DepartmentName" : "NewerDept", "Employee" : [ { "EmployeeId" : 99999, "FirstName" : "Newer",Chapter 4 Creating Business Object Items 4-32 "LastName" : "Guy", "Email" : "NRGUY", "JobId" : "SA_MAN", "DepartmentId" : 17, "Salary" : 10001, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17/child/Employee/99999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/17", "name" : "Department", "kind" : "item" } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17", "name" : "Department, "kind" : "item" } ] } Updating a Business Object Item REST APIs support the HTTP PATCH method to update the resource item.Update will only succeed when the row already exists.The following sample updates department 15, where DepartmentName is changed in the request payload.Request URL <base_url>/Department/15 HTTP Method PATCH Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName" } Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+jsonChapter 4 Updating a Business Object Item 4-33Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Deleting a Business Object Item REST APIs support the HTTP DELETE method to delete a resource item.REST APIs do not currently support deleting the resource collection.The following sample (URL1) deletes the resource item, employee 99999 in department 17.The second request URL deletes the resource item, department 17.Request URL 1 <base_url>/Department/17/child/Employee/99999 URL 2 <base_url>/Department/17 HTTP Method DELETE Content-Type none Payload none Response HTTP Code 204 Content-Type none Payload noneChapter 4 Deleting a Business Object Item 4-345 Data Consistency Tasks You can perform data consistency checks while making REST API calls.This capability uses version history in the database to enable you to manage HTTP payloads according to updates in the resource itself.Topics About Data Consistency Checking for Data Consistency When Retrieving Business Object Items Checking for Data Consistency When Updating Business Object Items About Data Consistency REST APIs support checking for data consistency when updating or retrieving a resource item.Data consistency is enforced by the REST API by generating an entity tag (ETag) with precondition headers so that the resource item matches the server side resource state before updating or retrieving.REST APIs support generating an entity tag (ETag) in the response header when the requested resource item has data consistency check enabled.When your visual development tool supports entity change indicators (as it is, for example, in Oracle Visual Builder), the REST API will assign a unique value to indicate the state of each resource item on the server side. |
The second request (URL2) creates a child resource item identified by employee 99999 in the Employee resource collection and also creates the parent resource item 17 of the Department collection in one roundtrip.Request URL 1 <base_url>/Department/15/child/Employee URL 2 <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId": 999, "FirstName": "New", "LastName": "Guy", "Email": "NGUY", "JobId": "SA_REP", "DepartmentId": 15, "Salary": 9999 } Payload 2Chapter 4 Creating Business Object Items 4-31{ "DepartmentId": 17, "DepartmentName": "NewerDept", "Employee": [ { "EmployeeId": 99999, "FirstName": "Newer", "LastName": "Guy", "Email": "NRGUY", "JobId": "SA_MAN", "DepartmentId": 17, "Salary": 10001 } ] } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15/child/Employee/999 Payload 1 { "EmployeeId" : 999, "FirstName" : "New", "LastName" : "Guy", "Email" : "NGUY", "JobId" : "SA_REP", "DepartmentId" : 15, "Salary" : 9999, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15/child/Employee/999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" } ] } Location <base_url>/Department/17 Payload 2 { "DepartmentId" : 17, "DepartmentName" : "NewerDept", "Employee" : [ { "EmployeeId" : 99999, "FirstName" : "Newer",Chapter 4 Creating Business Object Items 4-32 "LastName" : "Guy", "Email" : "NRGUY", "JobId" : "SA_MAN", "DepartmentId" : 17, "Salary" : 10001, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17/child/Employee/99999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/17", "name" : "Department", "kind" : "item" } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17", "name" : "Department, "kind" : "item" } ] } Updating a Business Object Item REST APIs support the HTTP PATCH method to update the resource item.Update will only succeed when the row already exists.The following sample updates department 15, where DepartmentName is changed in the request payload.Request URL <base_url>/Department/15 HTTP Method PATCH Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName" } Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+jsonChapter 4 Updating a Business Object Item 4-33Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Deleting a Business Object Item REST APIs support the HTTP DELETE method to delete a resource item.REST APIs do not currently support deleting the resource collection.The following sample (URL1) deletes the resource item, employee 99999 in department 17.The second request URL deletes the resource item, department 17.Request URL 1 <base_url>/Department/17/child/Employee/99999 URL 2 <base_url>/Department/17 HTTP Method DELETE Content-Type none Payload none Response HTTP Code 204 Content-Type none Payload noneChapter 4 Deleting a Business Object Item 4-345 Data Consistency Tasks You can perform data consistency checks while making REST API calls.This capability uses version history in the database to enable you to manage HTTP payloads according to updates in the resource itself.Topics About Data Consistency Checking for Data Consistency When Retrieving Business Object Items Checking for Data Consistency When Updating Business Object Items About Data Consistency REST APIs support checking for data consistency when updating or retrieving a resource item.Data consistency is enforced by the REST API by generating an entity tag (ETag) with precondition headers so that the resource item matches the server side resource state before updating or retrieving.REST APIs support generating an entity tag (ETag) in the response header when the requested resource item has data consistency check enabled.When your visual development tool supports entity change indicators (as it is, for example, in Oracle Visual Builder), the REST API will assign a unique value to indicate the state of each resource item on the server side.At runtime, when the business object item underlying the server side resource item changes, the REST API assigns a new state value to the ETag. |
Request URL 1 <base_url>/Department/15/child/Employee URL 2 <base_url>/Department HTTP Method POST Content-Type application/vnd.oracle.adf.resourceitem+json Payload 1 { "EmployeeId": 999, "FirstName": "New", "LastName": "Guy", "Email": "NGUY", "JobId": "SA_REP", "DepartmentId": 15, "Salary": 9999 } Payload 2Chapter 4 Creating Business Object Items 4-31{ "DepartmentId": 17, "DepartmentName": "NewerDept", "Employee": [ { "EmployeeId": 99999, "FirstName": "Newer", "LastName": "Guy", "Email": "NRGUY", "JobId": "SA_MAN", "DepartmentId": 17, "Salary": 10001 } ] } Response HTTP Code 201 Content-Type application/vnd.oracle.adf.resourceitem+json Location <base_url>/Department/15/child/Employee/999 Payload 1 { "EmployeeId" : 999, "FirstName" : "New", "LastName" : "Guy", "Email" : "NGUY", "JobId" : "SA_REP", "DepartmentId" : 15, "Salary" : 9999, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15/child/Employee/999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" } ] } Location <base_url>/Department/17 Payload 2 { "DepartmentId" : 17, "DepartmentName" : "NewerDept", "Employee" : [ { "EmployeeId" : 99999, "FirstName" : "Newer",Chapter 4 Creating Business Object Items 4-32 "LastName" : "Guy", "Email" : "NRGUY", "JobId" : "SA_MAN", "DepartmentId" : 17, "Salary" : 10001, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17/child/Employee/99999", "name" : "Employee", "kind" : "item" }, { "rel" : "parent", "href" : "<base_url>/Department/17", "name" : "Department", "kind" : "item" } ] } ], "links" : [ { "rel" : "self", "href" : "<base_url>/Department/17", "name" : "Department, "kind" : "item" } ] } Updating a Business Object Item REST APIs support the HTTP PATCH method to update the resource item.Update will only succeed when the row already exists.The following sample updates department 15, where DepartmentName is changed in the request payload.Request URL <base_url>/Department/15 HTTP Method PATCH Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName" } Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+jsonChapter 4 Updating a Business Object Item 4-33Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Deleting a Business Object Item REST APIs support the HTTP DELETE method to delete a resource item.REST APIs do not currently support deleting the resource collection.The following sample (URL1) deletes the resource item, employee 99999 in department 17.The second request URL deletes the resource item, department 17.Request URL 1 <base_url>/Department/17/child/Employee/99999 URL 2 <base_url>/Department/17 HTTP Method DELETE Content-Type none Payload none Response HTTP Code 204 Content-Type none Payload noneChapter 4 Deleting a Business Object Item 4-345 Data Consistency Tasks You can perform data consistency checks while making REST API calls.This capability uses version history in the database to enable you to manage HTTP payloads according to updates in the resource itself.Topics About Data Consistency Checking for Data Consistency When Retrieving Business Object Items Checking for Data Consistency When Updating Business Object Items About Data Consistency REST APIs support checking for data consistency when updating or retrieving a resource item.Data consistency is enforced by the REST API by generating an entity tag (ETag) with precondition headers so that the resource item matches the server side resource state before updating or retrieving.REST APIs support generating an entity tag (ETag) in the response header when the requested resource item has data consistency check enabled.When your visual development tool supports entity change indicators (as it is, for example, in Oracle Visual Builder), the REST API will assign a unique value to indicate the state of each resource item on the server side.At runtime, when the business object item underlying the server side resource item changes, the REST API assigns a new state value to the ETag.The following header shows the ETag returned with a request to retrieve a Department resource item. |
Update will only succeed when the row already exists.The following sample updates department 15, where DepartmentName is changed in the request payload.Request URL <base_url>/Department/15 HTTP Method PATCH Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName" } Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+jsonChapter 4 Updating a Business Object Item 4-33Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Deleting a Business Object Item REST APIs support the HTTP DELETE method to delete a resource item.REST APIs do not currently support deleting the resource collection.The following sample (URL1) deletes the resource item, employee 99999 in department 17.The second request URL deletes the resource item, department 17.Request URL 1 <base_url>/Department/17/child/Employee/99999 URL 2 <base_url>/Department/17 HTTP Method DELETE Content-Type none Payload none Response HTTP Code 204 Content-Type none Payload noneChapter 4 Deleting a Business Object Item 4-345 Data Consistency Tasks You can perform data consistency checks while making REST API calls.This capability uses version history in the database to enable you to manage HTTP payloads according to updates in the resource itself.Topics About Data Consistency Checking for Data Consistency When Retrieving Business Object Items Checking for Data Consistency When Updating Business Object Items About Data Consistency REST APIs support checking for data consistency when updating or retrieving a resource item.Data consistency is enforced by the REST API by generating an entity tag (ETag) with precondition headers so that the resource item matches the server side resource state before updating or retrieving.REST APIs support generating an entity tag (ETag) in the response header when the requested resource item has data consistency check enabled.When your visual development tool supports entity change indicators (as it is, for example, in Oracle Visual Builder), the REST API will assign a unique value to indicate the state of each resource item on the server side.At runtime, when the business object item underlying the server side resource item changes, the REST API assigns a new state value to the ETag.The following header shows the ETag returned with a request to retrieve a Department resource item.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 1069 Content-Type: application/json ETag: "ACED00057372037200136261636C6520136261636C65237200136261636C652" Link: <base_url>/Department/10>;rel="self";kind="item";name="Department" The web application request can use the ETag value returned in the header response of each resource item to create subsequent requests that contain precondition headers ( If-Match / If-None-Match ). |
The following sample updates department 15, where DepartmentName is changed in the request payload.Request URL <base_url>/Department/15 HTTP Method PATCH Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName" } Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+jsonChapter 4 Updating a Business Object Item 4-33Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Deleting a Business Object Item REST APIs support the HTTP DELETE method to delete a resource item.REST APIs do not currently support deleting the resource collection.The following sample (URL1) deletes the resource item, employee 99999 in department 17.The second request URL deletes the resource item, department 17.Request URL 1 <base_url>/Department/17/child/Employee/99999 URL 2 <base_url>/Department/17 HTTP Method DELETE Content-Type none Payload none Response HTTP Code 204 Content-Type none Payload noneChapter 4 Deleting a Business Object Item 4-345 Data Consistency Tasks You can perform data consistency checks while making REST API calls.This capability uses version history in the database to enable you to manage HTTP payloads according to updates in the resource itself.Topics About Data Consistency Checking for Data Consistency When Retrieving Business Object Items Checking for Data Consistency When Updating Business Object Items About Data Consistency REST APIs support checking for data consistency when updating or retrieving a resource item.Data consistency is enforced by the REST API by generating an entity tag (ETag) with precondition headers so that the resource item matches the server side resource state before updating or retrieving.REST APIs support generating an entity tag (ETag) in the response header when the requested resource item has data consistency check enabled.When your visual development tool supports entity change indicators (as it is, for example, in Oracle Visual Builder), the REST API will assign a unique value to indicate the state of each resource item on the server side.At runtime, when the business object item underlying the server side resource item changes, the REST API assigns a new state value to the ETag.The following header shows the ETag returned with a request to retrieve a Department resource item.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 1069 Content-Type: application/json ETag: "ACED00057372037200136261636C6520136261636C65237200136261636C652" Link: <base_url>/Department/10>;rel="self";kind="item";name="Department" The web application request can use the ETag value returned in the header response of each resource item to create subsequent requests that contain precondition headers ( If-Match / If-None-Match ).Based on the specified ETag and the precondition, the server will evaluate the current resource item state and match against the provided ETag. |
Request URL <base_url>/Department/15 HTTP Method PATCH Content-Type application/vnd.oracle.adf.resourceitem+json Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName" } Response HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+jsonChapter 4 Updating a Business Object Item 4-33Payload { "DepartmentId" : 15, "DepartmentName" : "UpdatedDeptName", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/15", "name" : "Department", "kind" : "item" }, { "rel" : "child", "href" : "<base_url>/Department/15/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Deleting a Business Object Item REST APIs support the HTTP DELETE method to delete a resource item.REST APIs do not currently support deleting the resource collection.The following sample (URL1) deletes the resource item, employee 99999 in department 17.The second request URL deletes the resource item, department 17.Request URL 1 <base_url>/Department/17/child/Employee/99999 URL 2 <base_url>/Department/17 HTTP Method DELETE Content-Type none Payload none Response HTTP Code 204 Content-Type none Payload noneChapter 4 Deleting a Business Object Item 4-345 Data Consistency Tasks You can perform data consistency checks while making REST API calls.This capability uses version history in the database to enable you to manage HTTP payloads according to updates in the resource itself.Topics About Data Consistency Checking for Data Consistency When Retrieving Business Object Items Checking for Data Consistency When Updating Business Object Items About Data Consistency REST APIs support checking for data consistency when updating or retrieving a resource item.Data consistency is enforced by the REST API by generating an entity tag (ETag) with precondition headers so that the resource item matches the server side resource state before updating or retrieving.REST APIs support generating an entity tag (ETag) in the response header when the requested resource item has data consistency check enabled.When your visual development tool supports entity change indicators (as it is, for example, in Oracle Visual Builder), the REST API will assign a unique value to indicate the state of each resource item on the server side.At runtime, when the business object item underlying the server side resource item changes, the REST API assigns a new state value to the ETag.The following header shows the ETag returned with a request to retrieve a Department resource item.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 1069 Content-Type: application/json ETag: "ACED00057372037200136261636C6520136261636C65237200136261636C652" Link: <base_url>/Department/10>;rel="self";kind="item";name="Department" The web application request can use the ETag value returned in the header response of each resource item to create subsequent requests that contain precondition headers ( If-Match / If-None-Match ).Based on the specified ETag and the precondition, the server will evaluate the current resource item state and match against the provided ETag.If the precondition is satisfied, the requested operation is executed; otherwise, a 412 error is returned. |
REST APIs do not currently support deleting the resource collection.The following sample (URL1) deletes the resource item, employee 99999 in department 17.The second request URL deletes the resource item, department 17.Request URL 1 <base_url>/Department/17/child/Employee/99999 URL 2 <base_url>/Department/17 HTTP Method DELETE Content-Type none Payload none Response HTTP Code 204 Content-Type none Payload noneChapter 4 Deleting a Business Object Item 4-345 Data Consistency Tasks You can perform data consistency checks while making REST API calls.This capability uses version history in the database to enable you to manage HTTP payloads according to updates in the resource itself.Topics About Data Consistency Checking for Data Consistency When Retrieving Business Object Items Checking for Data Consistency When Updating Business Object Items About Data Consistency REST APIs support checking for data consistency when updating or retrieving a resource item.Data consistency is enforced by the REST API by generating an entity tag (ETag) with precondition headers so that the resource item matches the server side resource state before updating or retrieving.REST APIs support generating an entity tag (ETag) in the response header when the requested resource item has data consistency check enabled.When your visual development tool supports entity change indicators (as it is, for example, in Oracle Visual Builder), the REST API will assign a unique value to indicate the state of each resource item on the server side.At runtime, when the business object item underlying the server side resource item changes, the REST API assigns a new state value to the ETag.The following header shows the ETag returned with a request to retrieve a Department resource item.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 1069 Content-Type: application/json ETag: "ACED00057372037200136261636C6520136261636C65237200136261636C652" Link: <base_url>/Department/10>;rel="self";kind="item";name="Department" The web application request can use the ETag value returned in the header response of each resource item to create subsequent requests that contain precondition headers ( If-Match / If-None-Match ).Based on the specified ETag and the precondition, the server will evaluate the current resource item state and match against the provided ETag.If the precondition is satisfied, the requested operation is executed; otherwise, a 412 error is returned.The error payload will contain the current resource item in the server side and the header will also reflect the current ETag value. |
The following sample (URL1) deletes the resource item, employee 99999 in department 17.The second request URL deletes the resource item, department 17.Request URL 1 <base_url>/Department/17/child/Employee/99999 URL 2 <base_url>/Department/17 HTTP Method DELETE Content-Type none Payload none Response HTTP Code 204 Content-Type none Payload noneChapter 4 Deleting a Business Object Item 4-345 Data Consistency Tasks You can perform data consistency checks while making REST API calls.This capability uses version history in the database to enable you to manage HTTP payloads according to updates in the resource itself.Topics About Data Consistency Checking for Data Consistency When Retrieving Business Object Items Checking for Data Consistency When Updating Business Object Items About Data Consistency REST APIs support checking for data consistency when updating or retrieving a resource item.Data consistency is enforced by the REST API by generating an entity tag (ETag) with precondition headers so that the resource item matches the server side resource state before updating or retrieving.REST APIs support generating an entity tag (ETag) in the response header when the requested resource item has data consistency check enabled.When your visual development tool supports entity change indicators (as it is, for example, in Oracle Visual Builder), the REST API will assign a unique value to indicate the state of each resource item on the server side.At runtime, when the business object item underlying the server side resource item changes, the REST API assigns a new state value to the ETag.The following header shows the ETag returned with a request to retrieve a Department resource item.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 1069 Content-Type: application/json ETag: "ACED00057372037200136261636C6520136261636C65237200136261636C652" Link: <base_url>/Department/10>;rel="self";kind="item";name="Department" The web application request can use the ETag value returned in the header response of each resource item to create subsequent requests that contain precondition headers ( If-Match / If-None-Match ).Based on the specified ETag and the precondition, the server will evaluate the current resource item state and match against the provided ETag.If the precondition is satisfied, the requested operation is executed; otherwise, a 412 error is returned.The error payload will contain the current resource item in the server side and the header will also reflect the current ETag value.To support testing ETag values, the REST API provides the following precondition header fields. |
The second request URL deletes the resource item, department 17.Request URL 1 <base_url>/Department/17/child/Employee/99999 URL 2 <base_url>/Department/17 HTTP Method DELETE Content-Type none Payload none Response HTTP Code 204 Content-Type none Payload noneChapter 4 Deleting a Business Object Item 4-345 Data Consistency Tasks You can perform data consistency checks while making REST API calls.This capability uses version history in the database to enable you to manage HTTP payloads according to updates in the resource itself.Topics About Data Consistency Checking for Data Consistency When Retrieving Business Object Items Checking for Data Consistency When Updating Business Object Items About Data Consistency REST APIs support checking for data consistency when updating or retrieving a resource item.Data consistency is enforced by the REST API by generating an entity tag (ETag) with precondition headers so that the resource item matches the server side resource state before updating or retrieving.REST APIs support generating an entity tag (ETag) in the response header when the requested resource item has data consistency check enabled.When your visual development tool supports entity change indicators (as it is, for example, in Oracle Visual Builder), the REST API will assign a unique value to indicate the state of each resource item on the server side.At runtime, when the business object item underlying the server side resource item changes, the REST API assigns a new state value to the ETag.The following header shows the ETag returned with a request to retrieve a Department resource item.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 1069 Content-Type: application/json ETag: "ACED00057372037200136261636C6520136261636C65237200136261636C652" Link: <base_url>/Department/10>;rel="self";kind="item";name="Department" The web application request can use the ETag value returned in the header response of each resource item to create subsequent requests that contain precondition headers ( If-Match / If-None-Match ).Based on the specified ETag and the precondition, the server will evaluate the current resource item state and match against the provided ETag.If the precondition is satisfied, the requested operation is executed; otherwise, a 412 error is returned.The error payload will contain the current resource item in the server side and the header will also reflect the current ETag value.To support testing ETag values, the REST API provides the following precondition header fields.Usage of these precondition fields forces the REST API to compare a supplied ETag value against the ETag values of previously requested items. |
Request URL 1 <base_url>/Department/17/child/Employee/99999 URL 2 <base_url>/Department/17 HTTP Method DELETE Content-Type none Payload none Response HTTP Code 204 Content-Type none Payload noneChapter 4 Deleting a Business Object Item 4-345 Data Consistency Tasks You can perform data consistency checks while making REST API calls.This capability uses version history in the database to enable you to manage HTTP payloads according to updates in the resource itself.Topics About Data Consistency Checking for Data Consistency When Retrieving Business Object Items Checking for Data Consistency When Updating Business Object Items About Data Consistency REST APIs support checking for data consistency when updating or retrieving a resource item.Data consistency is enforced by the REST API by generating an entity tag (ETag) with precondition headers so that the resource item matches the server side resource state before updating or retrieving.REST APIs support generating an entity tag (ETag) in the response header when the requested resource item has data consistency check enabled.When your visual development tool supports entity change indicators (as it is, for example, in Oracle Visual Builder), the REST API will assign a unique value to indicate the state of each resource item on the server side.At runtime, when the business object item underlying the server side resource item changes, the REST API assigns a new state value to the ETag.The following header shows the ETag returned with a request to retrieve a Department resource item.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 1069 Content-Type: application/json ETag: "ACED00057372037200136261636C6520136261636C65237200136261636C652" Link: <base_url>/Department/10>;rel="self";kind="item";name="Department" The web application request can use the ETag value returned in the header response of each resource item to create subsequent requests that contain precondition headers ( If-Match / If-None-Match ).Based on the specified ETag and the precondition, the server will evaluate the current resource item state and match against the provided ETag.If the precondition is satisfied, the requested operation is executed; otherwise, a 412 error is returned.The error payload will contain the current resource item in the server side and the header will also reflect the current ETag value.To support testing ETag values, the REST API provides the following precondition header fields.Usage of these precondition fields forces the REST API to compare a supplied ETag value against the ETag values of previously requested items.5-1Verify that the client is providing a state (obtained from a previous resource item response) that matches the current state on the server: If-Match: " <ETag value from resource item response> " Verify that the client is providing a state (obtained from a previous resource item response) that does not match the current state on the server. |
This capability uses version history in the database to enable you to manage HTTP payloads according to updates in the resource itself.Topics About Data Consistency Checking for Data Consistency When Retrieving Business Object Items Checking for Data Consistency When Updating Business Object Items About Data Consistency REST APIs support checking for data consistency when updating or retrieving a resource item.Data consistency is enforced by the REST API by generating an entity tag (ETag) with precondition headers so that the resource item matches the server side resource state before updating or retrieving.REST APIs support generating an entity tag (ETag) in the response header when the requested resource item has data consistency check enabled.When your visual development tool supports entity change indicators (as it is, for example, in Oracle Visual Builder), the REST API will assign a unique value to indicate the state of each resource item on the server side.At runtime, when the business object item underlying the server side resource item changes, the REST API assigns a new state value to the ETag.The following header shows the ETag returned with a request to retrieve a Department resource item.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 1069 Content-Type: application/json ETag: "ACED00057372037200136261636C6520136261636C65237200136261636C652" Link: <base_url>/Department/10>;rel="self";kind="item";name="Department" The web application request can use the ETag value returned in the header response of each resource item to create subsequent requests that contain precondition headers ( If-Match / If-None-Match ).Based on the specified ETag and the precondition, the server will evaluate the current resource item state and match against the provided ETag.If the precondition is satisfied, the requested operation is executed; otherwise, a 412 error is returned.The error payload will contain the current resource item in the server side and the header will also reflect the current ETag value.To support testing ETag values, the REST API provides the following precondition header fields.Usage of these precondition fields forces the REST API to compare a supplied ETag value against the ETag values of previously requested items.5-1Verify that the client is providing a state (obtained from a previous resource item response) that matches the current state on the server: If-Match: " <ETag value from resource item response> " Verify that the client is providing a state (obtained from a previous resource item response) that does not match the current state on the server.If-None-Match: " <ETag value from resource item response> " The following are typical use cases when checking for data consistency: Check that the business object item matches the server side resource item state before updating Retrieve the business object item using the server side resource item state when none of the requested items match any previously requested items While these use cases involve GET and PATCH methods, the precondition header and ETag value can be used to check that any HTTP method operation will be applied to the current state of the business object item. |
Topics About Data Consistency Checking for Data Consistency When Retrieving Business Object Items Checking for Data Consistency When Updating Business Object Items About Data Consistency REST APIs support checking for data consistency when updating or retrieving a resource item.Data consistency is enforced by the REST API by generating an entity tag (ETag) with precondition headers so that the resource item matches the server side resource state before updating or retrieving.REST APIs support generating an entity tag (ETag) in the response header when the requested resource item has data consistency check enabled.When your visual development tool supports entity change indicators (as it is, for example, in Oracle Visual Builder), the REST API will assign a unique value to indicate the state of each resource item on the server side.At runtime, when the business object item underlying the server side resource item changes, the REST API assigns a new state value to the ETag.The following header shows the ETag returned with a request to retrieve a Department resource item.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 1069 Content-Type: application/json ETag: "ACED00057372037200136261636C6520136261636C65237200136261636C652" Link: <base_url>/Department/10>;rel="self";kind="item";name="Department" The web application request can use the ETag value returned in the header response of each resource item to create subsequent requests that contain precondition headers ( If-Match / If-None-Match ).Based on the specified ETag and the precondition, the server will evaluate the current resource item state and match against the provided ETag.If the precondition is satisfied, the requested operation is executed; otherwise, a 412 error is returned.The error payload will contain the current resource item in the server side and the header will also reflect the current ETag value.To support testing ETag values, the REST API provides the following precondition header fields.Usage of these precondition fields forces the REST API to compare a supplied ETag value against the ETag values of previously requested items.5-1Verify that the client is providing a state (obtained from a previous resource item response) that matches the current state on the server: If-Match: " <ETag value from resource item response> " Verify that the client is providing a state (obtained from a previous resource item response) that does not match the current state on the server.If-None-Match: " <ETag value from resource item response> " The following are typical use cases when checking for data consistency: Check that the business object item matches the server side resource item state before updating Retrieve the business object item using the server side resource item state when none of the requested items match any previously requested items While these use cases involve GET and PATCH methods, the precondition header and ETag value can be used to check that any HTTP method operation will be applied to the current state of the business object item.When retrieving a resource collection, an additional custom property changeIndicator will appear in the response payload of resource with data consistency enabled. |
Data consistency is enforced by the REST API by generating an entity tag (ETag) with precondition headers so that the resource item matches the server side resource state before updating or retrieving.REST APIs support generating an entity tag (ETag) in the response header when the requested resource item has data consistency check enabled.When your visual development tool supports entity change indicators (as it is, for example, in Oracle Visual Builder), the REST API will assign a unique value to indicate the state of each resource item on the server side.At runtime, when the business object item underlying the server side resource item changes, the REST API assigns a new state value to the ETag.The following header shows the ETag returned with a request to retrieve a Department resource item.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 1069 Content-Type: application/json ETag: "ACED00057372037200136261636C6520136261636C65237200136261636C652" Link: <base_url>/Department/10>;rel="self";kind="item";name="Department" The web application request can use the ETag value returned in the header response of each resource item to create subsequent requests that contain precondition headers ( If-Match / If-None-Match ).Based on the specified ETag and the precondition, the server will evaluate the current resource item state and match against the provided ETag.If the precondition is satisfied, the requested operation is executed; otherwise, a 412 error is returned.The error payload will contain the current resource item in the server side and the header will also reflect the current ETag value.To support testing ETag values, the REST API provides the following precondition header fields.Usage of these precondition fields forces the REST API to compare a supplied ETag value against the ETag values of previously requested items.5-1Verify that the client is providing a state (obtained from a previous resource item response) that matches the current state on the server: If-Match: " <ETag value from resource item response> " Verify that the client is providing a state (obtained from a previous resource item response) that does not match the current state on the server.If-None-Match: " <ETag value from resource item response> " The following are typical use cases when checking for data consistency: Check that the business object item matches the server side resource item state before updating Retrieve the business object item using the server side resource item state when none of the requested items match any previously requested items While these use cases involve GET and PATCH methods, the precondition header and ETag value can be used to check that any HTTP method operation will be applied to the current state of the business object item.When retrieving a resource collection, an additional custom property changeIndicator will appear in the response payload of resource with data consistency enabled.This property contains the current ETag value of each resource item in the requested collection. |
REST APIs support generating an entity tag (ETag) in the response header when the requested resource item has data consistency check enabled.When your visual development tool supports entity change indicators (as it is, for example, in Oracle Visual Builder), the REST API will assign a unique value to indicate the state of each resource item on the server side.At runtime, when the business object item underlying the server side resource item changes, the REST API assigns a new state value to the ETag.The following header shows the ETag returned with a request to retrieve a Department resource item.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 1069 Content-Type: application/json ETag: "ACED00057372037200136261636C6520136261636C65237200136261636C652" Link: <base_url>/Department/10>;rel="self";kind="item";name="Department" The web application request can use the ETag value returned in the header response of each resource item to create subsequent requests that contain precondition headers ( If-Match / If-None-Match ).Based on the specified ETag and the precondition, the server will evaluate the current resource item state and match against the provided ETag.If the precondition is satisfied, the requested operation is executed; otherwise, a 412 error is returned.The error payload will contain the current resource item in the server side and the header will also reflect the current ETag value.To support testing ETag values, the REST API provides the following precondition header fields.Usage of these precondition fields forces the REST API to compare a supplied ETag value against the ETag values of previously requested items.5-1Verify that the client is providing a state (obtained from a previous resource item response) that matches the current state on the server: If-Match: " <ETag value from resource item response> " Verify that the client is providing a state (obtained from a previous resource item response) that does not match the current state on the server.If-None-Match: " <ETag value from resource item response> " The following are typical use cases when checking for data consistency: Check that the business object item matches the server side resource item state before updating Retrieve the business object item using the server side resource item state when none of the requested items match any previously requested items While these use cases involve GET and PATCH methods, the precondition header and ETag value can be used to check that any HTTP method operation will be applied to the current state of the business object item.When retrieving a resource collection, an additional custom property changeIndicator will appear in the response payload of resource with data consistency enabled.This property contains the current ETag value of each resource item in the requested collection.The following sample illustrates the changeIndicator property in the links section of a Department resource collection. |
When your visual development tool supports entity change indicators (as it is, for example, in Oracle Visual Builder), the REST API will assign a unique value to indicate the state of each resource item on the server side.At runtime, when the business object item underlying the server side resource item changes, the REST API assigns a new state value to the ETag.The following header shows the ETag returned with a request to retrieve a Department resource item.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 1069 Content-Type: application/json ETag: "ACED00057372037200136261636C6520136261636C65237200136261636C652" Link: <base_url>/Department/10>;rel="self";kind="item";name="Department" The web application request can use the ETag value returned in the header response of each resource item to create subsequent requests that contain precondition headers ( If-Match / If-None-Match ).Based on the specified ETag and the precondition, the server will evaluate the current resource item state and match against the provided ETag.If the precondition is satisfied, the requested operation is executed; otherwise, a 412 error is returned.The error payload will contain the current resource item in the server side and the header will also reflect the current ETag value.To support testing ETag values, the REST API provides the following precondition header fields.Usage of these precondition fields forces the REST API to compare a supplied ETag value against the ETag values of previously requested items.5-1Verify that the client is providing a state (obtained from a previous resource item response) that matches the current state on the server: If-Match: " <ETag value from resource item response> " Verify that the client is providing a state (obtained from a previous resource item response) that does not match the current state on the server.If-None-Match: " <ETag value from resource item response> " The following are typical use cases when checking for data consistency: Check that the business object item matches the server side resource item state before updating Retrieve the business object item using the server side resource item state when none of the requested items match any previously requested items While these use cases involve GET and PATCH methods, the precondition header and ETag value can be used to check that any HTTP method operation will be applied to the current state of the business object item.When retrieving a resource collection, an additional custom property changeIndicator will appear in the response payload of resource with data consistency enabled.This property contains the current ETag value of each resource item in the requested collection.The following sample illustrates the changeIndicator property in the links section of a Department resource collection.The presence of ETag values in the resource collection payload is a convenience for the web application that can reduce the number of requests to obtain the ETag from individual resource items. |
At runtime, when the business object item underlying the server side resource item changes, the REST API assigns a new state value to the ETag.The following header shows the ETag returned with a request to retrieve a Department resource item.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 1069 Content-Type: application/json ETag: "ACED00057372037200136261636C6520136261636C65237200136261636C652" Link: <base_url>/Department/10>;rel="self";kind="item";name="Department" The web application request can use the ETag value returned in the header response of each resource item to create subsequent requests that contain precondition headers ( If-Match / If-None-Match ).Based on the specified ETag and the precondition, the server will evaluate the current resource item state and match against the provided ETag.If the precondition is satisfied, the requested operation is executed; otherwise, a 412 error is returned.The error payload will contain the current resource item in the server side and the header will also reflect the current ETag value.To support testing ETag values, the REST API provides the following precondition header fields.Usage of these precondition fields forces the REST API to compare a supplied ETag value against the ETag values of previously requested items.5-1Verify that the client is providing a state (obtained from a previous resource item response) that matches the current state on the server: If-Match: " <ETag value from resource item response> " Verify that the client is providing a state (obtained from a previous resource item response) that does not match the current state on the server.If-None-Match: " <ETag value from resource item response> " The following are typical use cases when checking for data consistency: Check that the business object item matches the server side resource item state before updating Retrieve the business object item using the server side resource item state when none of the requested items match any previously requested items While these use cases involve GET and PATCH methods, the precondition header and ETag value can be used to check that any HTTP method operation will be applied to the current state of the business object item.When retrieving a resource collection, an additional custom property changeIndicator will appear in the response payload of resource with data consistency enabled.This property contains the current ETag value of each resource item in the requested collection.The following sample illustrates the changeIndicator property in the links section of a Department resource collection.The presence of ETag values in the resource collection payload is a convenience for the web application that can reduce the number of requests to obtain the ETag from individual resource items.{ "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "RelState" : 1, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C69737 47881D21D99C7619D03000149000473697A65787000000001770400000001737200186F721 636C652E6A626F2E646F6D61696E2E4E7564A362286F0200015B0004646174617400025B45 27870757200025B42ACF317F8060854E00200007870" } "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection", } ] }, { "DepartmentId" : 20,Chapter 5 About Data Consistency 5-2 "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D0300014900047369 7A65787000000001770400000001737200186F7261636C652E6A626F2E646F6D61696E2E4E756D626572A5B 1371914E0BFDA0200014900096D48617368436F6465787200116F7261636C652E73716C2E4E554D424552E9 0466EE632BE1D5020000787200106F7261636C652E73716C2E446174756D4078F514A362286F0200015B000 4646174617400025B427870757200025B42ACF317F8060854E0020000787000000002C10A0000000078" } }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { ... } ] } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Checking for Data Consistency When Updating Business Object Items REST APIs support checking for data consistency when updating resource items. |
The following header shows the ETag returned with a request to retrieve a Department resource item.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 1069 Content-Type: application/json ETag: "ACED00057372037200136261636C6520136261636C65237200136261636C652" Link: <base_url>/Department/10>;rel="self";kind="item";name="Department" The web application request can use the ETag value returned in the header response of each resource item to create subsequent requests that contain precondition headers ( If-Match / If-None-Match ).Based on the specified ETag and the precondition, the server will evaluate the current resource item state and match against the provided ETag.If the precondition is satisfied, the requested operation is executed; otherwise, a 412 error is returned.The error payload will contain the current resource item in the server side and the header will also reflect the current ETag value.To support testing ETag values, the REST API provides the following precondition header fields.Usage of these precondition fields forces the REST API to compare a supplied ETag value against the ETag values of previously requested items.5-1Verify that the client is providing a state (obtained from a previous resource item response) that matches the current state on the server: If-Match: " <ETag value from resource item response> " Verify that the client is providing a state (obtained from a previous resource item response) that does not match the current state on the server.If-None-Match: " <ETag value from resource item response> " The following are typical use cases when checking for data consistency: Check that the business object item matches the server side resource item state before updating Retrieve the business object item using the server side resource item state when none of the requested items match any previously requested items While these use cases involve GET and PATCH methods, the precondition header and ETag value can be used to check that any HTTP method operation will be applied to the current state of the business object item.When retrieving a resource collection, an additional custom property changeIndicator will appear in the response payload of resource with data consistency enabled.This property contains the current ETag value of each resource item in the requested collection.The following sample illustrates the changeIndicator property in the links section of a Department resource collection.The presence of ETag values in the resource collection payload is a convenience for the web application that can reduce the number of requests to obtain the ETag from individual resource items.{ "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "RelState" : 1, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C69737 47881D21D99C7619D03000149000473697A65787000000001770400000001737200186F721 636C652E6A626F2E646F6D61696E2E4E7564A362286F0200015B0004646174617400025B45 27870757200025B42ACF317F8060854E00200007870" } "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection", } ] }, { "DepartmentId" : 20,Chapter 5 About Data Consistency 5-2 "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D0300014900047369 7A65787000000001770400000001737200186F7261636C652E6A626F2E646F6D61696E2E4E756D626572A5B 1371914E0BFDA0200014900096D48617368436F6465787200116F7261636C652E73716C2E4E554D424552E9 0466EE632BE1D5020000787200106F7261636C652E73716C2E446174756D4078F514A362286F0200015B000 4646174617400025B427870757200025B42ACF317F8060854E0020000787000000002C10A0000000078" } }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { ... } ] } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Checking for Data Consistency When Updating Business Object Items REST APIs support checking for data consistency when updating resource items.To check for data consistency using the ETag header and conditional header fields: 1.Query one or more business object items and, for each returned resource item, obtain the ETag value from the changeIndicator property in the properties section of the response. |
HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 1069 Content-Type: application/json ETag: "ACED00057372037200136261636C6520136261636C65237200136261636C652" Link: <base_url>/Department/10>;rel="self";kind="item";name="Department" The web application request can use the ETag value returned in the header response of each resource item to create subsequent requests that contain precondition headers ( If-Match / If-None-Match ).Based on the specified ETag and the precondition, the server will evaluate the current resource item state and match against the provided ETag.If the precondition is satisfied, the requested operation is executed; otherwise, a 412 error is returned.The error payload will contain the current resource item in the server side and the header will also reflect the current ETag value.To support testing ETag values, the REST API provides the following precondition header fields.Usage of these precondition fields forces the REST API to compare a supplied ETag value against the ETag values of previously requested items.5-1Verify that the client is providing a state (obtained from a previous resource item response) that matches the current state on the server: If-Match: " <ETag value from resource item response> " Verify that the client is providing a state (obtained from a previous resource item response) that does not match the current state on the server.If-None-Match: " <ETag value from resource item response> " The following are typical use cases when checking for data consistency: Check that the business object item matches the server side resource item state before updating Retrieve the business object item using the server side resource item state when none of the requested items match any previously requested items While these use cases involve GET and PATCH methods, the precondition header and ETag value can be used to check that any HTTP method operation will be applied to the current state of the business object item.When retrieving a resource collection, an additional custom property changeIndicator will appear in the response payload of resource with data consistency enabled.This property contains the current ETag value of each resource item in the requested collection.The following sample illustrates the changeIndicator property in the links section of a Department resource collection.The presence of ETag values in the resource collection payload is a convenience for the web application that can reduce the number of requests to obtain the ETag from individual resource items.{ "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "RelState" : 1, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C69737 47881D21D99C7619D03000149000473697A65787000000001770400000001737200186F721 636C652E6A626F2E646F6D61696E2E4E7564A362286F0200015B0004646174617400025B45 27870757200025B42ACF317F8060854E00200007870" } "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection", } ] }, { "DepartmentId" : 20,Chapter 5 About Data Consistency 5-2 "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D0300014900047369 7A65787000000001770400000001737200186F7261636C652E6A626F2E646F6D61696E2E4E756D626572A5B 1371914E0BFDA0200014900096D48617368436F6465787200116F7261636C652E73716C2E4E554D424552E9 0466EE632BE1D5020000787200106F7261636C652E73716C2E446174756D4078F514A362286F0200015B000 4646174617400025B427870757200025B42ACF317F8060854E0020000787000000002C10A0000000078" } }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { ... } ] } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Checking for Data Consistency When Updating Business Object Items REST APIs support checking for data consistency when updating resource items.To check for data consistency using the ETag header and conditional header fields: 1.Query one or more business object items and, for each returned resource item, obtain the ETag value from the changeIndicator property in the properties section of the response.When querying multiple business object items, there will not be a single ETag response header. |
Based on the specified ETag and the precondition, the server will evaluate the current resource item state and match against the provided ETag.If the precondition is satisfied, the requested operation is executed; otherwise, a 412 error is returned.The error payload will contain the current resource item in the server side and the header will also reflect the current ETag value.To support testing ETag values, the REST API provides the following precondition header fields.Usage of these precondition fields forces the REST API to compare a supplied ETag value against the ETag values of previously requested items.5-1Verify that the client is providing a state (obtained from a previous resource item response) that matches the current state on the server: If-Match: " <ETag value from resource item response> " Verify that the client is providing a state (obtained from a previous resource item response) that does not match the current state on the server.If-None-Match: " <ETag value from resource item response> " The following are typical use cases when checking for data consistency: Check that the business object item matches the server side resource item state before updating Retrieve the business object item using the server side resource item state when none of the requested items match any previously requested items While these use cases involve GET and PATCH methods, the precondition header and ETag value can be used to check that any HTTP method operation will be applied to the current state of the business object item.When retrieving a resource collection, an additional custom property changeIndicator will appear in the response payload of resource with data consistency enabled.This property contains the current ETag value of each resource item in the requested collection.The following sample illustrates the changeIndicator property in the links section of a Department resource collection.The presence of ETag values in the resource collection payload is a convenience for the web application that can reduce the number of requests to obtain the ETag from individual resource items.{ "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "RelState" : 1, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C69737 47881D21D99C7619D03000149000473697A65787000000001770400000001737200186F721 636C652E6A626F2E646F6D61696E2E4E7564A362286F0200015B0004646174617400025B45 27870757200025B42ACF317F8060854E00200007870" } "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection", } ] }, { "DepartmentId" : 20,Chapter 5 About Data Consistency 5-2 "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D0300014900047369 7A65787000000001770400000001737200186F7261636C652E6A626F2E646F6D61696E2E4E756D626572A5B 1371914E0BFDA0200014900096D48617368436F6465787200116F7261636C652E73716C2E4E554D424552E9 0466EE632BE1D5020000787200106F7261636C652E73716C2E446174756D4078F514A362286F0200015B000 4646174617400025B427870757200025B42ACF317F8060854E0020000787000000002C10A0000000078" } }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { ... } ] } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Checking for Data Consistency When Updating Business Object Items REST APIs support checking for data consistency when updating resource items.To check for data consistency using the ETag header and conditional header fields: 1.Query one or more business object items and, for each returned resource item, obtain the ETag value from the changeIndicator property in the properties section of the response.When querying multiple business object items, there will not be a single ETag response header.Instead, the ETag for each of the items in the response will be in the properties section. |
If the precondition is satisfied, the requested operation is executed; otherwise, a 412 error is returned.The error payload will contain the current resource item in the server side and the header will also reflect the current ETag value.To support testing ETag values, the REST API provides the following precondition header fields.Usage of these precondition fields forces the REST API to compare a supplied ETag value against the ETag values of previously requested items.5-1Verify that the client is providing a state (obtained from a previous resource item response) that matches the current state on the server: If-Match: " <ETag value from resource item response> " Verify that the client is providing a state (obtained from a previous resource item response) that does not match the current state on the server.If-None-Match: " <ETag value from resource item response> " The following are typical use cases when checking for data consistency: Check that the business object item matches the server side resource item state before updating Retrieve the business object item using the server side resource item state when none of the requested items match any previously requested items While these use cases involve GET and PATCH methods, the precondition header and ETag value can be used to check that any HTTP method operation will be applied to the current state of the business object item.When retrieving a resource collection, an additional custom property changeIndicator will appear in the response payload of resource with data consistency enabled.This property contains the current ETag value of each resource item in the requested collection.The following sample illustrates the changeIndicator property in the links section of a Department resource collection.The presence of ETag values in the resource collection payload is a convenience for the web application that can reduce the number of requests to obtain the ETag from individual resource items.{ "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "RelState" : 1, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C69737 47881D21D99C7619D03000149000473697A65787000000001770400000001737200186F721 636C652E6A626F2E646F6D61696E2E4E7564A362286F0200015B0004646174617400025B45 27870757200025B42ACF317F8060854E00200007870" } "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection", } ] }, { "DepartmentId" : 20,Chapter 5 About Data Consistency 5-2 "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D0300014900047369 7A65787000000001770400000001737200186F7261636C652E6A626F2E646F6D61696E2E4E756D626572A5B 1371914E0BFDA0200014900096D48617368436F6465787200116F7261636C652E73716C2E4E554D424552E9 0466EE632BE1D5020000787200106F7261636C652E73716C2E446174756D4078F514A362286F0200015B000 4646174617400025B427870757200025B42ACF317F8060854E0020000787000000002C10A0000000078" } }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { ... } ] } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Checking for Data Consistency When Updating Business Object Items REST APIs support checking for data consistency when updating resource items.To check for data consistency using the ETag header and conditional header fields: 1.Query one or more business object items and, for each returned resource item, obtain the ETag value from the changeIndicator property in the properties section of the response.When querying multiple business object items, there will not be a single ETag response header.Instead, the ETag for each of the items in the response will be in the properties section.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 861 Content-Type: application/json ETag: "responseETag123" Link: <<base_url>/Department/10>;rel="self";kind="item";name="Department" Set-Cookie: JSESSIONID=jXvsJ1GpdkFJV5Jh0yk7D72vPZ42t8tLYDg74NRKFQzXdnsjG9vv! |
The error payload will contain the current resource item in the server side and the header will also reflect the current ETag value.To support testing ETag values, the REST API provides the following precondition header fields.Usage of these precondition fields forces the REST API to compare a supplied ETag value against the ETag values of previously requested items.5-1Verify that the client is providing a state (obtained from a previous resource item response) that matches the current state on the server: If-Match: " <ETag value from resource item response> " Verify that the client is providing a state (obtained from a previous resource item response) that does not match the current state on the server.If-None-Match: " <ETag value from resource item response> " The following are typical use cases when checking for data consistency: Check that the business object item matches the server side resource item state before updating Retrieve the business object item using the server side resource item state when none of the requested items match any previously requested items While these use cases involve GET and PATCH methods, the precondition header and ETag value can be used to check that any HTTP method operation will be applied to the current state of the business object item.When retrieving a resource collection, an additional custom property changeIndicator will appear in the response payload of resource with data consistency enabled.This property contains the current ETag value of each resource item in the requested collection.The following sample illustrates the changeIndicator property in the links section of a Department resource collection.The presence of ETag values in the resource collection payload is a convenience for the web application that can reduce the number of requests to obtain the ETag from individual resource items.{ "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "RelState" : 1, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C69737 47881D21D99C7619D03000149000473697A65787000000001770400000001737200186F721 636C652E6A626F2E646F6D61696E2E4E7564A362286F0200015B0004646174617400025B45 27870757200025B42ACF317F8060854E00200007870" } "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection", } ] }, { "DepartmentId" : 20,Chapter 5 About Data Consistency 5-2 "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D0300014900047369 7A65787000000001770400000001737200186F7261636C652E6A626F2E646F6D61696E2E4E756D626572A5B 1371914E0BFDA0200014900096D48617368436F6465787200116F7261636C652E73716C2E4E554D424552E9 0466EE632BE1D5020000787200106F7261636C652E73716C2E446174756D4078F514A362286F0200015B000 4646174617400025B427870757200025B42ACF317F8060854E0020000787000000002C10A0000000078" } }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { ... } ] } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Checking for Data Consistency When Updating Business Object Items REST APIs support checking for data consistency when updating resource items.To check for data consistency using the ETag header and conditional header fields: 1.Query one or more business object items and, for each returned resource item, obtain the ETag value from the changeIndicator property in the properties section of the response.When querying multiple business object items, there will not be a single ETag response header.Instead, the ETag for each of the items in the response will be in the properties section.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 861 Content-Type: application/json ETag: "responseETag123" Link: <<base_url>/Department/10>;rel="self";kind="item";name="Department" Set-Cookie: JSESSIONID=jXvsJ1GpdkFJV5Jh0yk7D72vPZ42t8tLYDg74NRKFQzXdnsjG9vv!1113104013; path=/; HttpOnly X-ORACLE-DMS-ECID: 51f1ff4535af720c:-7e156247:148ec9eeb3b:-8000-00000000000001adChapter 5 Checking for Data Consistency When Updating Business Object Items 5-3X-Powered-By: Servlet/2.5 JSP/2.1 { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "responseETag123" } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } 2.Update the business object item, using a PATCH request and check for data consistency by supplying the following conditional header field: If-Match: " <ETag value from resource item response> " to verify that the state of a requested resource item is current with the previous resource item response. |
To support testing ETag values, the REST API provides the following precondition header fields.Usage of these precondition fields forces the REST API to compare a supplied ETag value against the ETag values of previously requested items.5-1Verify that the client is providing a state (obtained from a previous resource item response) that matches the current state on the server: If-Match: " <ETag value from resource item response> " Verify that the client is providing a state (obtained from a previous resource item response) that does not match the current state on the server.If-None-Match: " <ETag value from resource item response> " The following are typical use cases when checking for data consistency: Check that the business object item matches the server side resource item state before updating Retrieve the business object item using the server side resource item state when none of the requested items match any previously requested items While these use cases involve GET and PATCH methods, the precondition header and ETag value can be used to check that any HTTP method operation will be applied to the current state of the business object item.When retrieving a resource collection, an additional custom property changeIndicator will appear in the response payload of resource with data consistency enabled.This property contains the current ETag value of each resource item in the requested collection.The following sample illustrates the changeIndicator property in the links section of a Department resource collection.The presence of ETag values in the resource collection payload is a convenience for the web application that can reduce the number of requests to obtain the ETag from individual resource items.{ "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "RelState" : 1, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C69737 47881D21D99C7619D03000149000473697A65787000000001770400000001737200186F721 636C652E6A626F2E646F6D61696E2E4E7564A362286F0200015B0004646174617400025B45 27870757200025B42ACF317F8060854E00200007870" } "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection", } ] }, { "DepartmentId" : 20,Chapter 5 About Data Consistency 5-2 "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D0300014900047369 7A65787000000001770400000001737200186F7261636C652E6A626F2E646F6D61696E2E4E756D626572A5B 1371914E0BFDA0200014900096D48617368436F6465787200116F7261636C652E73716C2E4E554D424552E9 0466EE632BE1D5020000787200106F7261636C652E73716C2E446174756D4078F514A362286F0200015B000 4646174617400025B427870757200025B42ACF317F8060854E0020000787000000002C10A0000000078" } }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { ... } ] } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Checking for Data Consistency When Updating Business Object Items REST APIs support checking for data consistency when updating resource items.To check for data consistency using the ETag header and conditional header fields: 1.Query one or more business object items and, for each returned resource item, obtain the ETag value from the changeIndicator property in the properties section of the response.When querying multiple business object items, there will not be a single ETag response header.Instead, the ETag for each of the items in the response will be in the properties section.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 861 Content-Type: application/json ETag: "responseETag123" Link: <<base_url>/Department/10>;rel="self";kind="item";name="Department" Set-Cookie: JSESSIONID=jXvsJ1GpdkFJV5Jh0yk7D72vPZ42t8tLYDg74NRKFQzXdnsjG9vv!1113104013; path=/; HttpOnly X-ORACLE-DMS-ECID: 51f1ff4535af720c:-7e156247:148ec9eeb3b:-8000-00000000000001adChapter 5 Checking for Data Consistency When Updating Business Object Items 5-3X-Powered-By: Servlet/2.5 JSP/2.1 { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "responseETag123" } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } 2.Update the business object item, using a PATCH request and check for data consistency by supplying the following conditional header field: If-Match: " <ETag value from resource item response> " to verify that the state of a requested resource item is current with the previous resource item response.The following sample updates the DepartmentName field of department 10 when the If-Match precondition test is satisfied. |
Usage of these precondition fields forces the REST API to compare a supplied ETag value against the ETag values of previously requested items.5-1Verify that the client is providing a state (obtained from a previous resource item response) that matches the current state on the server: If-Match: " <ETag value from resource item response> " Verify that the client is providing a state (obtained from a previous resource item response) that does not match the current state on the server.If-None-Match: " <ETag value from resource item response> " The following are typical use cases when checking for data consistency: Check that the business object item matches the server side resource item state before updating Retrieve the business object item using the server side resource item state when none of the requested items match any previously requested items While these use cases involve GET and PATCH methods, the precondition header and ETag value can be used to check that any HTTP method operation will be applied to the current state of the business object item.When retrieving a resource collection, an additional custom property changeIndicator will appear in the response payload of resource with data consistency enabled.This property contains the current ETag value of each resource item in the requested collection.The following sample illustrates the changeIndicator property in the links section of a Department resource collection.The presence of ETag values in the resource collection payload is a convenience for the web application that can reduce the number of requests to obtain the ETag from individual resource items.{ "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "RelState" : 1, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C69737 47881D21D99C7619D03000149000473697A65787000000001770400000001737200186F721 636C652E6A626F2E646F6D61696E2E4E7564A362286F0200015B0004646174617400025B45 27870757200025B42ACF317F8060854E00200007870" } "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection", } ] }, { "DepartmentId" : 20,Chapter 5 About Data Consistency 5-2 "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D0300014900047369 7A65787000000001770400000001737200186F7261636C652E6A626F2E646F6D61696E2E4E756D626572A5B 1371914E0BFDA0200014900096D48617368436F6465787200116F7261636C652E73716C2E4E554D424552E9 0466EE632BE1D5020000787200106F7261636C652E73716C2E446174756D4078F514A362286F0200015B000 4646174617400025B427870757200025B42ACF317F8060854E0020000787000000002C10A0000000078" } }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { ... } ] } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Checking for Data Consistency When Updating Business Object Items REST APIs support checking for data consistency when updating resource items.To check for data consistency using the ETag header and conditional header fields: 1.Query one or more business object items and, for each returned resource item, obtain the ETag value from the changeIndicator property in the properties section of the response.When querying multiple business object items, there will not be a single ETag response header.Instead, the ETag for each of the items in the response will be in the properties section.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 861 Content-Type: application/json ETag: "responseETag123" Link: <<base_url>/Department/10>;rel="self";kind="item";name="Department" Set-Cookie: JSESSIONID=jXvsJ1GpdkFJV5Jh0yk7D72vPZ42t8tLYDg74NRKFQzXdnsjG9vv!1113104013; path=/; HttpOnly X-ORACLE-DMS-ECID: 51f1ff4535af720c:-7e156247:148ec9eeb3b:-8000-00000000000001adChapter 5 Checking for Data Consistency When Updating Business Object Items 5-3X-Powered-By: Servlet/2.5 JSP/2.1 { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "responseETag123" } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } 2.Update the business object item, using a PATCH request and check for data consistency by supplying the following conditional header field: If-Match: " <ETag value from resource item response> " to verify that the state of a requested resource item is current with the previous resource item response.The following sample updates the DepartmentName field of department 10 when the If-Match precondition test is satisfied.In the first request (Request 1), the ETag value responseETag123 is identical to the ETag of the current department 10 on the server side, indicating that the state of the resource item is consistent with the server side. |
5-1Verify that the client is providing a state (obtained from a previous resource item response) that matches the current state on the server: If-Match: " <ETag value from resource item response> " Verify that the client is providing a state (obtained from a previous resource item response) that does not match the current state on the server.If-None-Match: " <ETag value from resource item response> " The following are typical use cases when checking for data consistency: Check that the business object item matches the server side resource item state before updating Retrieve the business object item using the server side resource item state when none of the requested items match any previously requested items While these use cases involve GET and PATCH methods, the precondition header and ETag value can be used to check that any HTTP method operation will be applied to the current state of the business object item.When retrieving a resource collection, an additional custom property changeIndicator will appear in the response payload of resource with data consistency enabled.This property contains the current ETag value of each resource item in the requested collection.The following sample illustrates the changeIndicator property in the links section of a Department resource collection.The presence of ETag values in the resource collection payload is a convenience for the web application that can reduce the number of requests to obtain the ETag from individual resource items.{ "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "RelState" : 1, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C69737 47881D21D99C7619D03000149000473697A65787000000001770400000001737200186F721 636C652E6A626F2E646F6D61696E2E4E7564A362286F0200015B0004646174617400025B45 27870757200025B42ACF317F8060854E00200007870" } "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection", } ] }, { "DepartmentId" : 20,Chapter 5 About Data Consistency 5-2 "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D0300014900047369 7A65787000000001770400000001737200186F7261636C652E6A626F2E646F6D61696E2E4E756D626572A5B 1371914E0BFDA0200014900096D48617368436F6465787200116F7261636C652E73716C2E4E554D424552E9 0466EE632BE1D5020000787200106F7261636C652E73716C2E446174756D4078F514A362286F0200015B000 4646174617400025B427870757200025B42ACF317F8060854E0020000787000000002C10A0000000078" } }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { ... } ] } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Checking for Data Consistency When Updating Business Object Items REST APIs support checking for data consistency when updating resource items.To check for data consistency using the ETag header and conditional header fields: 1.Query one or more business object items and, for each returned resource item, obtain the ETag value from the changeIndicator property in the properties section of the response.When querying multiple business object items, there will not be a single ETag response header.Instead, the ETag for each of the items in the response will be in the properties section.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 861 Content-Type: application/json ETag: "responseETag123" Link: <<base_url>/Department/10>;rel="self";kind="item";name="Department" Set-Cookie: JSESSIONID=jXvsJ1GpdkFJV5Jh0yk7D72vPZ42t8tLYDg74NRKFQzXdnsjG9vv!1113104013; path=/; HttpOnly X-ORACLE-DMS-ECID: 51f1ff4535af720c:-7e156247:148ec9eeb3b:-8000-00000000000001adChapter 5 Checking for Data Consistency When Updating Business Object Items 5-3X-Powered-By: Servlet/2.5 JSP/2.1 { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "responseETag123" } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } 2.Update the business object item, using a PATCH request and check for data consistency by supplying the following conditional header field: If-Match: " <ETag value from resource item response> " to verify that the state of a requested resource item is current with the previous resource item response.The following sample updates the DepartmentName field of department 10 when the If-Match precondition test is satisfied.In the first request (Request 1), the ETag value responseETag123 is identical to the ETag of the current department 10 on the server side, indicating that the state of the resource item is consistent with the server side.Consequently, the update to DepartmentName is allowed. |
If-None-Match: " <ETag value from resource item response> " The following are typical use cases when checking for data consistency: Check that the business object item matches the server side resource item state before updating Retrieve the business object item using the server side resource item state when none of the requested items match any previously requested items While these use cases involve GET and PATCH methods, the precondition header and ETag value can be used to check that any HTTP method operation will be applied to the current state of the business object item.When retrieving a resource collection, an additional custom property changeIndicator will appear in the response payload of resource with data consistency enabled.This property contains the current ETag value of each resource item in the requested collection.The following sample illustrates the changeIndicator property in the links section of a Department resource collection.The presence of ETag values in the resource collection payload is a convenience for the web application that can reduce the number of requests to obtain the ETag from individual resource items.{ "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "RelState" : 1, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C69737 47881D21D99C7619D03000149000473697A65787000000001770400000001737200186F721 636C652E6A626F2E646F6D61696E2E4E7564A362286F0200015B0004646174617400025B45 27870757200025B42ACF317F8060854E00200007870" } "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection", } ] }, { "DepartmentId" : 20,Chapter 5 About Data Consistency 5-2 "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D0300014900047369 7A65787000000001770400000001737200186F7261636C652E6A626F2E646F6D61696E2E4E756D626572A5B 1371914E0BFDA0200014900096D48617368436F6465787200116F7261636C652E73716C2E4E554D424552E9 0466EE632BE1D5020000787200106F7261636C652E73716C2E446174756D4078F514A362286F0200015B000 4646174617400025B427870757200025B42ACF317F8060854E0020000787000000002C10A0000000078" } }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { ... } ] } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Checking for Data Consistency When Updating Business Object Items REST APIs support checking for data consistency when updating resource items.To check for data consistency using the ETag header and conditional header fields: 1.Query one or more business object items and, for each returned resource item, obtain the ETag value from the changeIndicator property in the properties section of the response.When querying multiple business object items, there will not be a single ETag response header.Instead, the ETag for each of the items in the response will be in the properties section.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 861 Content-Type: application/json ETag: "responseETag123" Link: <<base_url>/Department/10>;rel="self";kind="item";name="Department" Set-Cookie: JSESSIONID=jXvsJ1GpdkFJV5Jh0yk7D72vPZ42t8tLYDg74NRKFQzXdnsjG9vv!1113104013; path=/; HttpOnly X-ORACLE-DMS-ECID: 51f1ff4535af720c:-7e156247:148ec9eeb3b:-8000-00000000000001adChapter 5 Checking for Data Consistency When Updating Business Object Items 5-3X-Powered-By: Servlet/2.5 JSP/2.1 { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "responseETag123" } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } 2.Update the business object item, using a PATCH request and check for data consistency by supplying the following conditional header field: If-Match: " <ETag value from resource item response> " to verify that the state of a requested resource item is current with the previous resource item response.The following sample updates the DepartmentName field of department 10 when the If-Match precondition test is satisfied.In the first request (Request 1), the ETag value responseETag123 is identical to the ETag of the current department 10 on the server side, indicating that the state of the resource item is consistent with the server side.Consequently, the update to DepartmentName is allowed.In the subsequent request (Request 2), however, the ETag supplied in the If-Match precondition is unchanged and no longer matches the new ETag value the server has for department 10 resource item. |
When retrieving a resource collection, an additional custom property changeIndicator will appear in the response payload of resource with data consistency enabled.This property contains the current ETag value of each resource item in the requested collection.The following sample illustrates the changeIndicator property in the links section of a Department resource collection.The presence of ETag values in the resource collection payload is a convenience for the web application that can reduce the number of requests to obtain the ETag from individual resource items.{ "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "RelState" : 1, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C69737 47881D21D99C7619D03000149000473697A65787000000001770400000001737200186F721 636C652E6A626F2E646F6D61696E2E4E7564A362286F0200015B0004646174617400025B45 27870757200025B42ACF317F8060854E00200007870" } "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection", } ] }, { "DepartmentId" : 20,Chapter 5 About Data Consistency 5-2 "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D0300014900047369 7A65787000000001770400000001737200186F7261636C652E6A626F2E646F6D61696E2E4E756D626572A5B 1371914E0BFDA0200014900096D48617368436F6465787200116F7261636C652E73716C2E4E554D424552E9 0466EE632BE1D5020000787200106F7261636C652E73716C2E446174756D4078F514A362286F0200015B000 4646174617400025B427870757200025B42ACF317F8060854E0020000787000000002C10A0000000078" } }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { ... } ] } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Checking for Data Consistency When Updating Business Object Items REST APIs support checking for data consistency when updating resource items.To check for data consistency using the ETag header and conditional header fields: 1.Query one or more business object items and, for each returned resource item, obtain the ETag value from the changeIndicator property in the properties section of the response.When querying multiple business object items, there will not be a single ETag response header.Instead, the ETag for each of the items in the response will be in the properties section.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 861 Content-Type: application/json ETag: "responseETag123" Link: <<base_url>/Department/10>;rel="self";kind="item";name="Department" Set-Cookie: JSESSIONID=jXvsJ1GpdkFJV5Jh0yk7D72vPZ42t8tLYDg74NRKFQzXdnsjG9vv!1113104013; path=/; HttpOnly X-ORACLE-DMS-ECID: 51f1ff4535af720c:-7e156247:148ec9eeb3b:-8000-00000000000001adChapter 5 Checking for Data Consistency When Updating Business Object Items 5-3X-Powered-By: Servlet/2.5 JSP/2.1 { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "responseETag123" } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } 2.Update the business object item, using a PATCH request and check for data consistency by supplying the following conditional header field: If-Match: " <ETag value from resource item response> " to verify that the state of a requested resource item is current with the previous resource item response.The following sample updates the DepartmentName field of department 10 when the If-Match precondition test is satisfied.In the first request (Request 1), the ETag value responseETag123 is identical to the ETag of the current department 10 on the server side, indicating that the state of the resource item is consistent with the server side.Consequently, the update to DepartmentName is allowed.In the subsequent request (Request 2), however, the ETag supplied in the If-Match precondition is unchanged and no longer matches the new ETag value the server has for department 10 resource item.As a consequence of the stale ETag value used in the second request, the update fails with an HTTP code 412, indicating the precondition test failed, and the current ETag value responseETag567 is returned in the response header. |
This property contains the current ETag value of each resource item in the requested collection.The following sample illustrates the changeIndicator property in the links section of a Department resource collection.The presence of ETag values in the resource collection payload is a convenience for the web application that can reduce the number of requests to obtain the ETag from individual resource items.{ "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "RelState" : 1, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C69737 47881D21D99C7619D03000149000473697A65787000000001770400000001737200186F721 636C652E6A626F2E646F6D61696E2E4E7564A362286F0200015B0004646174617400025B45 27870757200025B42ACF317F8060854E00200007870" } "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection", } ] }, { "DepartmentId" : 20,Chapter 5 About Data Consistency 5-2 "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D0300014900047369 7A65787000000001770400000001737200186F7261636C652E6A626F2E646F6D61696E2E4E756D626572A5B 1371914E0BFDA0200014900096D48617368436F6465787200116F7261636C652E73716C2E4E554D424552E9 0466EE632BE1D5020000787200106F7261636C652E73716C2E446174756D4078F514A362286F0200015B000 4646174617400025B427870757200025B42ACF317F8060854E0020000787000000002C10A0000000078" } }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { ... } ] } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Checking for Data Consistency When Updating Business Object Items REST APIs support checking for data consistency when updating resource items.To check for data consistency using the ETag header and conditional header fields: 1.Query one or more business object items and, for each returned resource item, obtain the ETag value from the changeIndicator property in the properties section of the response.When querying multiple business object items, there will not be a single ETag response header.Instead, the ETag for each of the items in the response will be in the properties section.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 861 Content-Type: application/json ETag: "responseETag123" Link: <<base_url>/Department/10>;rel="self";kind="item";name="Department" Set-Cookie: JSESSIONID=jXvsJ1GpdkFJV5Jh0yk7D72vPZ42t8tLYDg74NRKFQzXdnsjG9vv!1113104013; path=/; HttpOnly X-ORACLE-DMS-ECID: 51f1ff4535af720c:-7e156247:148ec9eeb3b:-8000-00000000000001adChapter 5 Checking for Data Consistency When Updating Business Object Items 5-3X-Powered-By: Servlet/2.5 JSP/2.1 { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "responseETag123" } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } 2.Update the business object item, using a PATCH request and check for data consistency by supplying the following conditional header field: If-Match: " <ETag value from resource item response> " to verify that the state of a requested resource item is current with the previous resource item response.The following sample updates the DepartmentName field of department 10 when the If-Match precondition test is satisfied.In the first request (Request 1), the ETag value responseETag123 is identical to the ETag of the current department 10 on the server side, indicating that the state of the resource item is consistent with the server side.Consequently, the update to DepartmentName is allowed.In the subsequent request (Request 2), however, the ETag supplied in the If-Match precondition is unchanged and no longer matches the new ETag value the server has for department 10 resource item.As a consequence of the stale ETag value used in the second request, the update fails with an HTTP code 412, indicating the precondition test failed, and the current ETag value responseETag567 is returned in the response header.This occurs in production web applications when multiple users simultaneously access the same business object item. |
The following sample illustrates the changeIndicator property in the links section of a Department resource collection.The presence of ETag values in the resource collection payload is a convenience for the web application that can reduce the number of requests to obtain the ETag from individual resource items.{ "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "RelState" : 1, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C69737 47881D21D99C7619D03000149000473697A65787000000001770400000001737200186F721 636C652E6A626F2E646F6D61696E2E4E7564A362286F0200015B0004646174617400025B45 27870757200025B42ACF317F8060854E00200007870" } "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection", } ] }, { "DepartmentId" : 20,Chapter 5 About Data Consistency 5-2 "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D0300014900047369 7A65787000000001770400000001737200186F7261636C652E6A626F2E646F6D61696E2E4E756D626572A5B 1371914E0BFDA0200014900096D48617368436F6465787200116F7261636C652E73716C2E4E554D424552E9 0466EE632BE1D5020000787200106F7261636C652E73716C2E446174756D4078F514A362286F0200015B000 4646174617400025B427870757200025B42ACF317F8060854E0020000787000000002C10A0000000078" } }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { ... } ] } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Checking for Data Consistency When Updating Business Object Items REST APIs support checking for data consistency when updating resource items.To check for data consistency using the ETag header and conditional header fields: 1.Query one or more business object items and, for each returned resource item, obtain the ETag value from the changeIndicator property in the properties section of the response.When querying multiple business object items, there will not be a single ETag response header.Instead, the ETag for each of the items in the response will be in the properties section.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 861 Content-Type: application/json ETag: "responseETag123" Link: <<base_url>/Department/10>;rel="self";kind="item";name="Department" Set-Cookie: JSESSIONID=jXvsJ1GpdkFJV5Jh0yk7D72vPZ42t8tLYDg74NRKFQzXdnsjG9vv!1113104013; path=/; HttpOnly X-ORACLE-DMS-ECID: 51f1ff4535af720c:-7e156247:148ec9eeb3b:-8000-00000000000001adChapter 5 Checking for Data Consistency When Updating Business Object Items 5-3X-Powered-By: Servlet/2.5 JSP/2.1 { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "responseETag123" } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } 2.Update the business object item, using a PATCH request and check for data consistency by supplying the following conditional header field: If-Match: " <ETag value from resource item response> " to verify that the state of a requested resource item is current with the previous resource item response.The following sample updates the DepartmentName field of department 10 when the If-Match precondition test is satisfied.In the first request (Request 1), the ETag value responseETag123 is identical to the ETag of the current department 10 on the server side, indicating that the state of the resource item is consistent with the server side.Consequently, the update to DepartmentName is allowed.In the subsequent request (Request 2), however, the ETag supplied in the If-Match precondition is unchanged and no longer matches the new ETag value the server has for department 10 resource item.As a consequence of the stale ETag value used in the second request, the update fails with an HTTP code 412, indicating the precondition test failed, and the current ETag value responseETag567 is returned in the response header.This occurs in production web applications when multiple users simultaneously access the same business object item.For example, when user 1 and user 2 both query the same item, the item has, for example, ETag value 1. |
The presence of ETag values in the resource collection payload is a convenience for the web application that can reduce the number of requests to obtain the ETag from individual resource items.{ "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "RelState" : 1, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C69737 47881D21D99C7619D03000149000473697A65787000000001770400000001737200186F721 636C652E6A626F2E646F6D61696E2E4E7564A362286F0200015B0004646174617400025B45 27870757200025B42ACF317F8060854E00200007870" } "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection", } ] }, { "DepartmentId" : 20,Chapter 5 About Data Consistency 5-2 "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D0300014900047369 7A65787000000001770400000001737200186F7261636C652E6A626F2E646F6D61696E2E4E756D626572A5B 1371914E0BFDA0200014900096D48617368436F6465787200116F7261636C652E73716C2E4E554D424552E9 0466EE632BE1D5020000787200106F7261636C652E73716C2E446174756D4078F514A362286F0200015B000 4646174617400025B427870757200025B42ACF317F8060854E0020000787000000002C10A0000000078" } }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { ... } ] } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Checking for Data Consistency When Updating Business Object Items REST APIs support checking for data consistency when updating resource items.To check for data consistency using the ETag header and conditional header fields: 1.Query one or more business object items and, for each returned resource item, obtain the ETag value from the changeIndicator property in the properties section of the response.When querying multiple business object items, there will not be a single ETag response header.Instead, the ETag for each of the items in the response will be in the properties section.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 861 Content-Type: application/json ETag: "responseETag123" Link: <<base_url>/Department/10>;rel="self";kind="item";name="Department" Set-Cookie: JSESSIONID=jXvsJ1GpdkFJV5Jh0yk7D72vPZ42t8tLYDg74NRKFQzXdnsjG9vv!1113104013; path=/; HttpOnly X-ORACLE-DMS-ECID: 51f1ff4535af720c:-7e156247:148ec9eeb3b:-8000-00000000000001adChapter 5 Checking for Data Consistency When Updating Business Object Items 5-3X-Powered-By: Servlet/2.5 JSP/2.1 { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "responseETag123" } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } 2.Update the business object item, using a PATCH request and check for data consistency by supplying the following conditional header field: If-Match: " <ETag value from resource item response> " to verify that the state of a requested resource item is current with the previous resource item response.The following sample updates the DepartmentName field of department 10 when the If-Match precondition test is satisfied.In the first request (Request 1), the ETag value responseETag123 is identical to the ETag of the current department 10 on the server side, indicating that the state of the resource item is consistent with the server side.Consequently, the update to DepartmentName is allowed.In the subsequent request (Request 2), however, the ETag supplied in the If-Match precondition is unchanged and no longer matches the new ETag value the server has for department 10 resource item.As a consequence of the stale ETag value used in the second request, the update fails with an HTTP code 412, indicating the precondition test failed, and the current ETag value responseETag567 is returned in the response header.This occurs in production web applications when multiple users simultaneously access the same business object item.For example, when user 1 and user 2 both query the same item, the item has, for example, ETag value 1.Then, if user 1 successfully updates the item with ETag value 1, and user 2 attempts to update the same item with ETag value 1, the attempt will fail. |
{ "items" : [ { "DepartmentId" : 10, "DepartmentName" : "Administration", "RelState" : 1, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C69737 47881D21D99C7619D03000149000473697A65787000000001770400000001737200186F721 636C652E6A626F2E646F6D61696E2E4E7564A362286F0200015B0004646174617400025B45 27870757200025B42ACF317F8060854E00200007870" } "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection", } ] }, { "DepartmentId" : 20,Chapter 5 About Data Consistency 5-2 "DepartmentName" : "Marketing", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/20", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D0300014900047369 7A65787000000001770400000001737200186F7261636C652E6A626F2E646F6D61696E2E4E756D626572A5B 1371914E0BFDA0200014900096D48617368436F6465787200116F7261636C652E73716C2E4E554D424552E9 0466EE632BE1D5020000787200106F7261636C652E73716C2E446174756D4078F514A362286F0200015B000 4646174617400025B427870757200025B42ACF317F8060854E0020000787000000002C10A0000000078" } }, { "rel" : "child", "href" : "<base_url>/Department/20/child/Employee", "name" : "Employee", "kind" : "collection" } ] }, { ... } ] } ], "count" : 5, "hasMore" : true, "limit" : 25, "offset" : 0, "links" : [ { "rel" : "self", "href" : "<base_url>/Department", "name" : "Department", "kind" : "collection" } ] } Checking for Data Consistency When Updating Business Object Items REST APIs support checking for data consistency when updating resource items.To check for data consistency using the ETag header and conditional header fields: 1.Query one or more business object items and, for each returned resource item, obtain the ETag value from the changeIndicator property in the properties section of the response.When querying multiple business object items, there will not be a single ETag response header.Instead, the ETag for each of the items in the response will be in the properties section.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 861 Content-Type: application/json ETag: "responseETag123" Link: <<base_url>/Department/10>;rel="self";kind="item";name="Department" Set-Cookie: JSESSIONID=jXvsJ1GpdkFJV5Jh0yk7D72vPZ42t8tLYDg74NRKFQzXdnsjG9vv!1113104013; path=/; HttpOnly X-ORACLE-DMS-ECID: 51f1ff4535af720c:-7e156247:148ec9eeb3b:-8000-00000000000001adChapter 5 Checking for Data Consistency When Updating Business Object Items 5-3X-Powered-By: Servlet/2.5 JSP/2.1 { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "responseETag123" } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } 2.Update the business object item, using a PATCH request and check for data consistency by supplying the following conditional header field: If-Match: " <ETag value from resource item response> " to verify that the state of a requested resource item is current with the previous resource item response.The following sample updates the DepartmentName field of department 10 when the If-Match precondition test is satisfied.In the first request (Request 1), the ETag value responseETag123 is identical to the ETag of the current department 10 on the server side, indicating that the state of the resource item is consistent with the server side.Consequently, the update to DepartmentName is allowed.In the subsequent request (Request 2), however, the ETag supplied in the If-Match precondition is unchanged and no longer matches the new ETag value the server has for department 10 resource item.As a consequence of the stale ETag value used in the second request, the update fails with an HTTP code 412, indicating the precondition test failed, and the current ETag value responseETag567 is returned in the response header.This occurs in production web applications when multiple users simultaneously access the same business object item.For example, when user 1 and user 2 both query the same item, the item has, for example, ETag value 1.Then, if user 1 successfully updates the item with ETag value 1, and user 2 attempts to update the same item with ETag value 1, the attempt will fail.Request 1 URL 1 <base_url>/Department/10 HTTP Method PATCH Precondition 1 If-Match: "responseETag123" Content-Type application/vnd.oracle.adf.resourceitem+jsonChapter 5 Checking for Data Consistency When Updating Business Object Items 5-4Payload 1 { "DepartmentName" : "FirstAttempt_NewDepartmentName" } Response 1 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json ETag responseETag567 Payload 1 { "DepartmentId" : 10, "DepartmentName" : "FirstAttempt_NewDepartmentName", "RelState" : null, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : " responseETag567 " } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Request 2 URL 2 <base_url>/Department/10 HTTP Method PATCH Precondition 2 If-Match: "staleETag789" Content-Type application/vnd.oracle.adf.resourceitem+json Payload 2 { "DepartmentName" : "SecondAttempt_NewDepartmentName" } Response 2Chapter 5 Checking for Data Consistency When Updating Business Object Items 5-5HTTP Code 412 (Precondition failed) Content-Type application/vnd.oracle.adf.resourceitem+json ETag responseETag567 Payload 2 { "DepartmentId" : 10, "DepartmentName" : "FirstAttempt_NewDepartmentName", "RelState" : null, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : " responseETag567 " } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Checking for Data Consistency When Retrieving Business Object Items REST APIs support checking for data consistency when retrieving resource items. |
To check for data consistency using the ETag header and conditional header fields: 1.Query one or more business object items and, for each returned resource item, obtain the ETag value from the changeIndicator property in the properties section of the response.When querying multiple business object items, there will not be a single ETag response header.Instead, the ETag for each of the items in the response will be in the properties section.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 861 Content-Type: application/json ETag: "responseETag123" Link: <<base_url>/Department/10>;rel="self";kind="item";name="Department" Set-Cookie: JSESSIONID=jXvsJ1GpdkFJV5Jh0yk7D72vPZ42t8tLYDg74NRKFQzXdnsjG9vv!1113104013; path=/; HttpOnly X-ORACLE-DMS-ECID: 51f1ff4535af720c:-7e156247:148ec9eeb3b:-8000-00000000000001adChapter 5 Checking for Data Consistency When Updating Business Object Items 5-3X-Powered-By: Servlet/2.5 JSP/2.1 { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "responseETag123" } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } 2.Update the business object item, using a PATCH request and check for data consistency by supplying the following conditional header field: If-Match: " <ETag value from resource item response> " to verify that the state of a requested resource item is current with the previous resource item response.The following sample updates the DepartmentName field of department 10 when the If-Match precondition test is satisfied.In the first request (Request 1), the ETag value responseETag123 is identical to the ETag of the current department 10 on the server side, indicating that the state of the resource item is consistent with the server side.Consequently, the update to DepartmentName is allowed.In the subsequent request (Request 2), however, the ETag supplied in the If-Match precondition is unchanged and no longer matches the new ETag value the server has for department 10 resource item.As a consequence of the stale ETag value used in the second request, the update fails with an HTTP code 412, indicating the precondition test failed, and the current ETag value responseETag567 is returned in the response header.This occurs in production web applications when multiple users simultaneously access the same business object item.For example, when user 1 and user 2 both query the same item, the item has, for example, ETag value 1.Then, if user 1 successfully updates the item with ETag value 1, and user 2 attempts to update the same item with ETag value 1, the attempt will fail.Request 1 URL 1 <base_url>/Department/10 HTTP Method PATCH Precondition 1 If-Match: "responseETag123" Content-Type application/vnd.oracle.adf.resourceitem+jsonChapter 5 Checking for Data Consistency When Updating Business Object Items 5-4Payload 1 { "DepartmentName" : "FirstAttempt_NewDepartmentName" } Response 1 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json ETag responseETag567 Payload 1 { "DepartmentId" : 10, "DepartmentName" : "FirstAttempt_NewDepartmentName", "RelState" : null, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : " responseETag567 " } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Request 2 URL 2 <base_url>/Department/10 HTTP Method PATCH Precondition 2 If-Match: "staleETag789" Content-Type application/vnd.oracle.adf.resourceitem+json Payload 2 { "DepartmentName" : "SecondAttempt_NewDepartmentName" } Response 2Chapter 5 Checking for Data Consistency When Updating Business Object Items 5-5HTTP Code 412 (Precondition failed) Content-Type application/vnd.oracle.adf.resourceitem+json ETag responseETag567 Payload 2 { "DepartmentId" : 10, "DepartmentName" : "FirstAttempt_NewDepartmentName", "RelState" : null, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : " responseETag567 " } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Checking for Data Consistency When Retrieving Business Object Items REST APIs support checking for data consistency when retrieving resource items.To check for data consistency using the ETag header and conditional header fields: 1.Query one or more business object items and, for each returned resource item, obtain the ETag value from the changeIndicator property in the properties section of the response. |
When querying multiple business object items, there will not be a single ETag response header.Instead, the ETag for each of the items in the response will be in the properties section.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 861 Content-Type: application/json ETag: "responseETag123" Link: <<base_url>/Department/10>;rel="self";kind="item";name="Department" Set-Cookie: JSESSIONID=jXvsJ1GpdkFJV5Jh0yk7D72vPZ42t8tLYDg74NRKFQzXdnsjG9vv!1113104013; path=/; HttpOnly X-ORACLE-DMS-ECID: 51f1ff4535af720c:-7e156247:148ec9eeb3b:-8000-00000000000001adChapter 5 Checking for Data Consistency When Updating Business Object Items 5-3X-Powered-By: Servlet/2.5 JSP/2.1 { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "responseETag123" } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } 2.Update the business object item, using a PATCH request and check for data consistency by supplying the following conditional header field: If-Match: " <ETag value from resource item response> " to verify that the state of a requested resource item is current with the previous resource item response.The following sample updates the DepartmentName field of department 10 when the If-Match precondition test is satisfied.In the first request (Request 1), the ETag value responseETag123 is identical to the ETag of the current department 10 on the server side, indicating that the state of the resource item is consistent with the server side.Consequently, the update to DepartmentName is allowed.In the subsequent request (Request 2), however, the ETag supplied in the If-Match precondition is unchanged and no longer matches the new ETag value the server has for department 10 resource item.As a consequence of the stale ETag value used in the second request, the update fails with an HTTP code 412, indicating the precondition test failed, and the current ETag value responseETag567 is returned in the response header.This occurs in production web applications when multiple users simultaneously access the same business object item.For example, when user 1 and user 2 both query the same item, the item has, for example, ETag value 1.Then, if user 1 successfully updates the item with ETag value 1, and user 2 attempts to update the same item with ETag value 1, the attempt will fail.Request 1 URL 1 <base_url>/Department/10 HTTP Method PATCH Precondition 1 If-Match: "responseETag123" Content-Type application/vnd.oracle.adf.resourceitem+jsonChapter 5 Checking for Data Consistency When Updating Business Object Items 5-4Payload 1 { "DepartmentName" : "FirstAttempt_NewDepartmentName" } Response 1 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json ETag responseETag567 Payload 1 { "DepartmentId" : 10, "DepartmentName" : "FirstAttempt_NewDepartmentName", "RelState" : null, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : " responseETag567 " } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Request 2 URL 2 <base_url>/Department/10 HTTP Method PATCH Precondition 2 If-Match: "staleETag789" Content-Type application/vnd.oracle.adf.resourceitem+json Payload 2 { "DepartmentName" : "SecondAttempt_NewDepartmentName" } Response 2Chapter 5 Checking for Data Consistency When Updating Business Object Items 5-5HTTP Code 412 (Precondition failed) Content-Type application/vnd.oracle.adf.resourceitem+json ETag responseETag567 Payload 2 { "DepartmentId" : 10, "DepartmentName" : "FirstAttempt_NewDepartmentName", "RelState" : null, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : " responseETag567 " } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Checking for Data Consistency When Retrieving Business Object Items REST APIs support checking for data consistency when retrieving resource items.To check for data consistency using the ETag header and conditional header fields: 1.Query one or more business object items and, for each returned resource item, obtain the ETag value from the changeIndicator property in the properties section of the response.When querying multiple business object items, there will not be a single ETag response header. |
Instead, the ETag for each of the items in the response will be in the properties section.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 861 Content-Type: application/json ETag: "responseETag123" Link: <<base_url>/Department/10>;rel="self";kind="item";name="Department" Set-Cookie: JSESSIONID=jXvsJ1GpdkFJV5Jh0yk7D72vPZ42t8tLYDg74NRKFQzXdnsjG9vv!1113104013; path=/; HttpOnly X-ORACLE-DMS-ECID: 51f1ff4535af720c:-7e156247:148ec9eeb3b:-8000-00000000000001adChapter 5 Checking for Data Consistency When Updating Business Object Items 5-3X-Powered-By: Servlet/2.5 JSP/2.1 { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "responseETag123" } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } 2.Update the business object item, using a PATCH request and check for data consistency by supplying the following conditional header field: If-Match: " <ETag value from resource item response> " to verify that the state of a requested resource item is current with the previous resource item response.The following sample updates the DepartmentName field of department 10 when the If-Match precondition test is satisfied.In the first request (Request 1), the ETag value responseETag123 is identical to the ETag of the current department 10 on the server side, indicating that the state of the resource item is consistent with the server side.Consequently, the update to DepartmentName is allowed.In the subsequent request (Request 2), however, the ETag supplied in the If-Match precondition is unchanged and no longer matches the new ETag value the server has for department 10 resource item.As a consequence of the stale ETag value used in the second request, the update fails with an HTTP code 412, indicating the precondition test failed, and the current ETag value responseETag567 is returned in the response header.This occurs in production web applications when multiple users simultaneously access the same business object item.For example, when user 1 and user 2 both query the same item, the item has, for example, ETag value 1.Then, if user 1 successfully updates the item with ETag value 1, and user 2 attempts to update the same item with ETag value 1, the attempt will fail.Request 1 URL 1 <base_url>/Department/10 HTTP Method PATCH Precondition 1 If-Match: "responseETag123" Content-Type application/vnd.oracle.adf.resourceitem+jsonChapter 5 Checking for Data Consistency When Updating Business Object Items 5-4Payload 1 { "DepartmentName" : "FirstAttempt_NewDepartmentName" } Response 1 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json ETag responseETag567 Payload 1 { "DepartmentId" : 10, "DepartmentName" : "FirstAttempt_NewDepartmentName", "RelState" : null, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : " responseETag567 " } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Request 2 URL 2 <base_url>/Department/10 HTTP Method PATCH Precondition 2 If-Match: "staleETag789" Content-Type application/vnd.oracle.adf.resourceitem+json Payload 2 { "DepartmentName" : "SecondAttempt_NewDepartmentName" } Response 2Chapter 5 Checking for Data Consistency When Updating Business Object Items 5-5HTTP Code 412 (Precondition failed) Content-Type application/vnd.oracle.adf.resourceitem+json ETag responseETag567 Payload 2 { "DepartmentId" : 10, "DepartmentName" : "FirstAttempt_NewDepartmentName", "RelState" : null, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : " responseETag567 " } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Checking for Data Consistency When Retrieving Business Object Items REST APIs support checking for data consistency when retrieving resource items.To check for data consistency using the ETag header and conditional header fields: 1.Query one or more business object items and, for each returned resource item, obtain the ETag value from the changeIndicator property in the properties section of the response.When querying multiple business object items, there will not be a single ETag response header.Instead, the ETag for each of the items in the response will be in the properties section. |
HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 861 Content-Type: application/json ETag: "responseETag123" Link: <<base_url>/Department/10>;rel="self";kind="item";name="Department" Set-Cookie: JSESSIONID=jXvsJ1GpdkFJV5Jh0yk7D72vPZ42t8tLYDg74NRKFQzXdnsjG9vv!1113104013; path=/; HttpOnly X-ORACLE-DMS-ECID: 51f1ff4535af720c:-7e156247:148ec9eeb3b:-8000-00000000000001adChapter 5 Checking for Data Consistency When Updating Business Object Items 5-3X-Powered-By: Servlet/2.5 JSP/2.1 { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "responseETag123" } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } 2.Update the business object item, using a PATCH request and check for data consistency by supplying the following conditional header field: If-Match: " <ETag value from resource item response> " to verify that the state of a requested resource item is current with the previous resource item response.The following sample updates the DepartmentName field of department 10 when the If-Match precondition test is satisfied.In the first request (Request 1), the ETag value responseETag123 is identical to the ETag of the current department 10 on the server side, indicating that the state of the resource item is consistent with the server side.Consequently, the update to DepartmentName is allowed.In the subsequent request (Request 2), however, the ETag supplied in the If-Match precondition is unchanged and no longer matches the new ETag value the server has for department 10 resource item.As a consequence of the stale ETag value used in the second request, the update fails with an HTTP code 412, indicating the precondition test failed, and the current ETag value responseETag567 is returned in the response header.This occurs in production web applications when multiple users simultaneously access the same business object item.For example, when user 1 and user 2 both query the same item, the item has, for example, ETag value 1.Then, if user 1 successfully updates the item with ETag value 1, and user 2 attempts to update the same item with ETag value 1, the attempt will fail.Request 1 URL 1 <base_url>/Department/10 HTTP Method PATCH Precondition 1 If-Match: "responseETag123" Content-Type application/vnd.oracle.adf.resourceitem+jsonChapter 5 Checking for Data Consistency When Updating Business Object Items 5-4Payload 1 { "DepartmentName" : "FirstAttempt_NewDepartmentName" } Response 1 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json ETag responseETag567 Payload 1 { "DepartmentId" : 10, "DepartmentName" : "FirstAttempt_NewDepartmentName", "RelState" : null, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : " responseETag567 " } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Request 2 URL 2 <base_url>/Department/10 HTTP Method PATCH Precondition 2 If-Match: "staleETag789" Content-Type application/vnd.oracle.adf.resourceitem+json Payload 2 { "DepartmentName" : "SecondAttempt_NewDepartmentName" } Response 2Chapter 5 Checking for Data Consistency When Updating Business Object Items 5-5HTTP Code 412 (Precondition failed) Content-Type application/vnd.oracle.adf.resourceitem+json ETag responseETag567 Payload 2 { "DepartmentId" : 10, "DepartmentName" : "FirstAttempt_NewDepartmentName", "RelState" : null, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : " responseETag567 " } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Checking for Data Consistency When Retrieving Business Object Items REST APIs support checking for data consistency when retrieving resource items.To check for data consistency using the ETag header and conditional header fields: 1.Query one or more business object items and, for each returned resource item, obtain the ETag value from the changeIndicator property in the properties section of the response.When querying multiple business object items, there will not be a single ETag response header.Instead, the ETag for each of the items in the response will be in the properties section.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 861 Content-Type: application/json ETag: "responseETag123" Link: <base_url>/Department/10>;rel="self";kind="item";name="Department" Set-Cookie: JSESSIONID=jXvsJ1GpdkFJV5Jh0yk7D72vPZ42t8tLYDg74NRKFQzXdnsjG9vv! |
1113104013; path=/; HttpOnly X-ORACLE-DMS-ECID: 51f1ff4535af720c:-7e156247:148ec9eeb3b:-8000-00000000000001adChapter 5 Checking for Data Consistency When Updating Business Object Items 5-3X-Powered-By: Servlet/2.5 JSP/2.1 { "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "responseETag123" } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } 2.Update the business object item, using a PATCH request and check for data consistency by supplying the following conditional header field: If-Match: " <ETag value from resource item response> " to verify that the state of a requested resource item is current with the previous resource item response.The following sample updates the DepartmentName field of department 10 when the If-Match precondition test is satisfied.In the first request (Request 1), the ETag value responseETag123 is identical to the ETag of the current department 10 on the server side, indicating that the state of the resource item is consistent with the server side.Consequently, the update to DepartmentName is allowed.In the subsequent request (Request 2), however, the ETag supplied in the If-Match precondition is unchanged and no longer matches the new ETag value the server has for department 10 resource item.As a consequence of the stale ETag value used in the second request, the update fails with an HTTP code 412, indicating the precondition test failed, and the current ETag value responseETag567 is returned in the response header.This occurs in production web applications when multiple users simultaneously access the same business object item.For example, when user 1 and user 2 both query the same item, the item has, for example, ETag value 1.Then, if user 1 successfully updates the item with ETag value 1, and user 2 attempts to update the same item with ETag value 1, the attempt will fail.Request 1 URL 1 <base_url>/Department/10 HTTP Method PATCH Precondition 1 If-Match: "responseETag123" Content-Type application/vnd.oracle.adf.resourceitem+jsonChapter 5 Checking for Data Consistency When Updating Business Object Items 5-4Payload 1 { "DepartmentName" : "FirstAttempt_NewDepartmentName" } Response 1 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json ETag responseETag567 Payload 1 { "DepartmentId" : 10, "DepartmentName" : "FirstAttempt_NewDepartmentName", "RelState" : null, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : " responseETag567 " } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Request 2 URL 2 <base_url>/Department/10 HTTP Method PATCH Precondition 2 If-Match: "staleETag789" Content-Type application/vnd.oracle.adf.resourceitem+json Payload 2 { "DepartmentName" : "SecondAttempt_NewDepartmentName" } Response 2Chapter 5 Checking for Data Consistency When Updating Business Object Items 5-5HTTP Code 412 (Precondition failed) Content-Type application/vnd.oracle.adf.resourceitem+json ETag responseETag567 Payload 2 { "DepartmentId" : 10, "DepartmentName" : "FirstAttempt_NewDepartmentName", "RelState" : null, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : " responseETag567 " } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Checking for Data Consistency When Retrieving Business Object Items REST APIs support checking for data consistency when retrieving resource items.To check for data consistency using the ETag header and conditional header fields: 1.Query one or more business object items and, for each returned resource item, obtain the ETag value from the changeIndicator property in the properties section of the response.When querying multiple business object items, there will not be a single ETag response header.Instead, the ETag for each of the items in the response will be in the properties section.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 861 Content-Type: application/json ETag: "responseETag123" Link: <base_url>/Department/10>;rel="self";kind="item";name="Department" Set-Cookie: JSESSIONID=jXvsJ1GpdkFJV5Jh0yk7D72vPZ42t8tLYDg74NRKFQzXdnsjG9vv!1113104013; path=/; HttpOnly X-ORACLE-DMS-ECID: 51f1ff4535af720c:-7e156247:148ec9eeb3b:-8000-00000000000001ad X-Powered-By: Servlet/2.5 JSP/2.1 {Chapter 5 Checking for Data Consistency When Retrieving Business Object Items 5-6 "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "responseETag123" } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } 2.Query one or more business object items and check for data consistency by supplying the following conditional header field: If-None-Match: " <ETag value from resource item response> " to verify that the state of none of the previously requested resource items is current with the resource item request. |
The following sample updates the DepartmentName field of department 10 when the If-Match precondition test is satisfied.In the first request (Request 1), the ETag value responseETag123 is identical to the ETag of the current department 10 on the server side, indicating that the state of the resource item is consistent with the server side.Consequently, the update to DepartmentName is allowed.In the subsequent request (Request 2), however, the ETag supplied in the If-Match precondition is unchanged and no longer matches the new ETag value the server has for department 10 resource item.As a consequence of the stale ETag value used in the second request, the update fails with an HTTP code 412, indicating the precondition test failed, and the current ETag value responseETag567 is returned in the response header.This occurs in production web applications when multiple users simultaneously access the same business object item.For example, when user 1 and user 2 both query the same item, the item has, for example, ETag value 1.Then, if user 1 successfully updates the item with ETag value 1, and user 2 attempts to update the same item with ETag value 1, the attempt will fail.Request 1 URL 1 <base_url>/Department/10 HTTP Method PATCH Precondition 1 If-Match: "responseETag123" Content-Type application/vnd.oracle.adf.resourceitem+jsonChapter 5 Checking for Data Consistency When Updating Business Object Items 5-4Payload 1 { "DepartmentName" : "FirstAttempt_NewDepartmentName" } Response 1 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json ETag responseETag567 Payload 1 { "DepartmentId" : 10, "DepartmentName" : "FirstAttempt_NewDepartmentName", "RelState" : null, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : " responseETag567 " } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Request 2 URL 2 <base_url>/Department/10 HTTP Method PATCH Precondition 2 If-Match: "staleETag789" Content-Type application/vnd.oracle.adf.resourceitem+json Payload 2 { "DepartmentName" : "SecondAttempt_NewDepartmentName" } Response 2Chapter 5 Checking for Data Consistency When Updating Business Object Items 5-5HTTP Code 412 (Precondition failed) Content-Type application/vnd.oracle.adf.resourceitem+json ETag responseETag567 Payload 2 { "DepartmentId" : 10, "DepartmentName" : "FirstAttempt_NewDepartmentName", "RelState" : null, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : " responseETag567 " } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Checking for Data Consistency When Retrieving Business Object Items REST APIs support checking for data consistency when retrieving resource items.To check for data consistency using the ETag header and conditional header fields: 1.Query one or more business object items and, for each returned resource item, obtain the ETag value from the changeIndicator property in the properties section of the response.When querying multiple business object items, there will not be a single ETag response header.Instead, the ETag for each of the items in the response will be in the properties section.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 861 Content-Type: application/json ETag: "responseETag123" Link: <base_url>/Department/10>;rel="self";kind="item";name="Department" Set-Cookie: JSESSIONID=jXvsJ1GpdkFJV5Jh0yk7D72vPZ42t8tLYDg74NRKFQzXdnsjG9vv!1113104013; path=/; HttpOnly X-ORACLE-DMS-ECID: 51f1ff4535af720c:-7e156247:148ec9eeb3b:-8000-00000000000001ad X-Powered-By: Servlet/2.5 JSP/2.1 {Chapter 5 Checking for Data Consistency When Retrieving Business Object Items 5-6 "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "responseETag123" } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } 2.Query one or more business object items and check for data consistency by supplying the following conditional header field: If-None-Match: " <ETag value from resource item response> " to verify that the state of none of the previously requested resource items is current with the resource item request.The following sample retrieves department 10 when the If-None-Match precondition test is satisfied. |
In the first request (Request 1), the ETag value responseETag123 is identical to the ETag of the current department 10 on the server side, indicating that the state of the resource item is consistent with the server side.Consequently, the update to DepartmentName is allowed.In the subsequent request (Request 2), however, the ETag supplied in the If-Match precondition is unchanged and no longer matches the new ETag value the server has for department 10 resource item.As a consequence of the stale ETag value used in the second request, the update fails with an HTTP code 412, indicating the precondition test failed, and the current ETag value responseETag567 is returned in the response header.This occurs in production web applications when multiple users simultaneously access the same business object item.For example, when user 1 and user 2 both query the same item, the item has, for example, ETag value 1.Then, if user 1 successfully updates the item with ETag value 1, and user 2 attempts to update the same item with ETag value 1, the attempt will fail.Request 1 URL 1 <base_url>/Department/10 HTTP Method PATCH Precondition 1 If-Match: "responseETag123" Content-Type application/vnd.oracle.adf.resourceitem+jsonChapter 5 Checking for Data Consistency When Updating Business Object Items 5-4Payload 1 { "DepartmentName" : "FirstAttempt_NewDepartmentName" } Response 1 HTTP Code 200 Content-Type application/vnd.oracle.adf.resourceitem+json ETag responseETag567 Payload 1 { "DepartmentId" : 10, "DepartmentName" : "FirstAttempt_NewDepartmentName", "RelState" : null, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : " responseETag567 " } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Request 2 URL 2 <base_url>/Department/10 HTTP Method PATCH Precondition 2 If-Match: "staleETag789" Content-Type application/vnd.oracle.adf.resourceitem+json Payload 2 { "DepartmentName" : "SecondAttempt_NewDepartmentName" } Response 2Chapter 5 Checking for Data Consistency When Updating Business Object Items 5-5HTTP Code 412 (Precondition failed) Content-Type application/vnd.oracle.adf.resourceitem+json ETag responseETag567 Payload 2 { "DepartmentId" : 10, "DepartmentName" : "FirstAttempt_NewDepartmentName", "RelState" : null, "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : " responseETag567 " } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } Checking for Data Consistency When Retrieving Business Object Items REST APIs support checking for data consistency when retrieving resource items.To check for data consistency using the ETag header and conditional header fields: 1.Query one or more business object items and, for each returned resource item, obtain the ETag value from the changeIndicator property in the properties section of the response.When querying multiple business object items, there will not be a single ETag response header.Instead, the ETag for each of the items in the response will be in the properties section.HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Location: Content-Length: 861 Content-Type: application/json ETag: "responseETag123" Link: <base_url>/Department/10>;rel="self";kind="item";name="Department" Set-Cookie: JSESSIONID=jXvsJ1GpdkFJV5Jh0yk7D72vPZ42t8tLYDg74NRKFQzXdnsjG9vv!1113104013; path=/; HttpOnly X-ORACLE-DMS-ECID: 51f1ff4535af720c:-7e156247:148ec9eeb3b:-8000-00000000000001ad X-Powered-By: Servlet/2.5 JSP/2.1 {Chapter 5 Checking for Data Consistency When Retrieving Business Object Items 5-6 "DepartmentId" : 10, "DepartmentName" : "Administration", "links" : [ { "rel" : "self", "href" : "<base_url>/Department/10", "name" : "Department", "kind" : "item", "properties" : { "changeIndicator" : "responseETag123" } }, { "rel" : "child", "href" : "<base_url>/Department/10/child/Employee", "name" : "Employee", "kind" : "collection" } ] } 2.Query one or more business object items and check for data consistency by supplying the following conditional header field: If-None-Match: " <ETag value from resource item response> " to verify that the state of none of the previously requested resource items is current with the resource item request.The following sample retrieves department 10 when the If-None-Match precondition test is satisfied.In the first request (Request 1), the ETag value responseETag123 matches the ETag of the previously requested Department 10 resource item on the server side, indicating that the state of the resource item is consistent with the server side. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.