Skip to content

Dynamic API Parameters

The parameters required by the Dynamic API for query and CUD operations are usually one of the following classes in the com.sap.cloud.mobile.odata package:

Note

Some proxy classes are inherited from those classes and have strongly typed variables and methods simplifying usage.

EntitySet

Entity Set is a collection of instances of an entity and is represented by the EntitySet class. It is most often used as a parameter to the from method of DataQuery class to specify which entity set the query is operating on.

EntityType

Entity type defines the structure and relationship of the entity. It is used when you create a new instance of an entity to specify its entity type.

Property

Each entity has structural and navigation properties which are often used in various DataQuery class methods when constructing a query. Those methods require the specification of a property to perform filtering, expansion, sorting and selection. The property instance provides information such as data type, nullable, and navigation among other details of an entity property.

DataPath

DataPath is used with DataQuery class methods for filtering, selection, expansion, or ordering to represent a single-part of multi-part path expressions; for example, Address/ZipCode. Both DataPath and Property are derived from the abstract class PropertyPath. Therefore, you can pass either a Property or a DataPath instance.

EntityKey

An entity is a structure with a key. The key is a property or set of properties (composite) represented by the class, EntityKey. It used for identifying the instance of interest for retrieval.

DataValue

The DataValue class is essentially a value holder that wraps certain value types as an object. DataValue is an abstract class. There are many subclasses holding both primitive and structural type values. There are five types of primitive type values:

  • Basic – BooleanValue, CharValue, ByteValue, LongValue, StringValue, and so on
  • Calendar – LocalDate, LocalTime, LocalDateTime, and so on
  • Geography – GeographyPoint, GeographyMultiPoint, and so on
  • Geometry – GeometryPoint, GeometryMultiPoint, and so on
  • Enum -

For structural type values, this class can be either a structure or a list of structures. Therefore, all the value holders are derived from the DataValue abstract class. See Appendix B for the inheritance tree of structural type value classes. add link

DataValue class or its derived type is used in certain setter or getter methods when the parameter or return is a value holder such as enum, date time, and complex type. There are also type-specific setter and getter functions such as getString, getLong, and getInteger.

A very common use of value holder is in the construction of an entity key.

EntityValue

EntityValue is a subclass of DataValue used for representing the value of an entity instance. It is used when you need to pass the instance as a parameter to various CUD methods in the DataService class; for example, createEntity, createLink, and createMedia. Each instance of EntityValue points to the entity type that it is representing.

ComplexValue

An entity type may contain a complex value as one of its properties. To create an instance of the entity may require the creation of a complex value of the complex type.