Parameters in Dynamic API¶
The parameter required by the Dynamic API for queries and CUD operations is 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 the 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
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, as well as other details of an entity property.
DataPath
¶
DataPath
is used with DataQuery
methods for filtering, selection, expansion, or ordering, to represent a single-part of a multi-part path expression, 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 is used for identifying the instance of interest for retrieval.
DataValue
¶
The DataValue
is essentially a value holder that wraps certain value types as an object. DataValue
is an abstract class, and many subclasses hold primitive or 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 –
GeometryPoin
t,GeometryMultiPoint
, and so on - Enum -
EnumValue
, and so on
Structural type values can be either a structure or a list of structures. Therefore, all the value holders are derived from the DataValue
abstract class. See here for the inheritance tree of structural type value classes.
DataValue
and its derived classes are often used in setter and getter methods when the parameter or return value 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 setInteger
.
A very common use of a value holder is in the construction of an entity key.
EntityValue
¶
EntityValue
is a subclass of DataValue
, which represents the value of an entity instance. It is used when passing the instance as a parameter to various CUD operations in DataService
, for example createEntity
, createLink
, and createMedia
. Each instance of EntityValue
points to the representing entity type.
ComplexValue
¶
An entity type may contain a complex value as one of its properties. To create an instance of this entity may require creating a complex type value.