select
Add properties (to {@link com.sap.cloud.mobile.kotlin.odata.DataQuery#selectItems DataQuery.selectItems}) for selecting from the target entity.
- Example using proxy classes:
open fun selectExample(): kotlin.Unit { val service = this.service; val query = DataQuery() .select(Customer.customerID, Customer.companyName, Customer.contactName); val customers = service.getCustomers(query); L196@ for (customer in customers) { this.showCustomer(customer); } }
- Example using dynamic API:
open fun selectExample(): kotlin.Unit { val service = this.service; val customersEntitySet = service.getEntitySet("Customers"); val customerEntityType = customersEntitySet.entityType; val customerIDProperty = customerEntityType.getProperty("CustomerID"); val companyNameProperty = customerEntityType.getProperty("CompanyName"); val contactNameProperty = customerEntityType.getProperty("ContactName"); val query = DataQuery() .select(customerIDProperty, companyNameProperty, contactNameProperty) .from(customersEntitySet); val customers = service.executeQuery(query).getEntityList(); L195@ for (customer in customers) { this.showCustomer(customer); } }
Return
This query.
Parameters
items
The items to be selected.