Input mappings allow you to add parameters to a query so that you can set the parameter value when executing the query. For example, when you define a query as SELECT *, FROM TEST_TABLE, WHERE ID=1,
an input mapping is a parameter that sets the value of ID.
...
- SCALAR: In the target query, the parameter will be used as one value.
- ARRAY: In the target query, the parameter will contain one or many values for a mapped parameter.
Note |
---|
Note that ARRAY parameter type cannot be used with the QUERY_STRING data type (SQL type). |
In the context of RDBMS and SQL datasources, an ARRAY parameter mapped to an SQL query will be expanded to multiple comma separated parameters at runtime. For example, this can be used in SQL statement conditions such as SELECT ... WHERE ... IN(?).
SQL type
The data type of the corresponding SQL parameter can be selected from this menu. Note that the QUERY_STRING data type cannot be used if the parameter type is set to ARRAY. Find more from here about data types.
...
If you need to provide properties when initializing the custom validator, it is necessary to implement the org.wso2.carbon.dataservices.core.validation.ValidatorExt
interface. This extends the Validator interface as shown below.
...
Code Block | ||
---|---|---|
| ||
public interface ValidatorExt extends Validator { public void init(Map<String, String> props); } |
The init method initializes the set of properties provided for the custom validator via the management console or the configuration file of the data service. See the examples given below.
- Properties provided via the management console:
- Properties provided via the data service configuration file:
...