Update a Business Entity to handle an OpenEdge JSON Filter Pattern
- Last Updated: January 16, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
Update a Business Entity to handle an OpenEdge JSON Filter Pattern
To handle the filter parameter of the Data Object Read operation method as an OpenEdge JSON Filter Pattern, you must add the following two additional annotations to the existing annotations of the Read operation.
@openapi.openedge.method.property (name="mappingType",
value="JFP").@openapi.openedge.method.property
(name="capabilities", value="ablFilter,top,skip,id,orderBy").
The JSON Filter Pattern is a JSON object that contains the following properties:
- ablFilter—Contains the text of an ABL string based on which the OpenEdge database query is filtered before returning the result set.Examples:
- “ablFilter” : “(State = ‘MA’) OR (State = ‘GA’)”“ablFilter” : “Name BEGINS ‘A’ ”
- orderBy—A comma-delimited list of the names of fields used to sort the data in the result set. By default, the result set is in ascending order. You can add desc after any field to indicate that its sort order is descending.Examples:“orderBy”: “Balance, State”—The data will be sorted in ascending order, first by Balance, and then within Balance by State.“orderBy” : “Country, State desc, City”—The data will be sorted in ascending order by Country, then in descending order by State, and in ascending order by city.
- skip—Specifies the number of records to skip in the result set before returning a page of data in the result set. For example, if the requested page size is 10 and the request is for the 5th page of data, the value of the property is set to 40.
- top—Specifies the number of records to be returned in a single page, that is, the page size of the result set after using skip.
Both the skip and top properties are used for server paging.
You must add ABL code to handle these filter parameters and their behavior in the Read operation of the Business Entity.