This repository has been archived by the owner on Nov 25, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
/
BatchRequestSample.dbs
executable file
·67 lines (66 loc) · 3.7 KB
/
BatchRequestSample.dbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!--
~ Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
~ in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<data enableBatchRequests="true" name="BatchRequestSample" serviceNamespace="http://ws.wso2.org/dataservice/samples/batch_request_sample">
<config id="default">
<property name="org.wso2.ws.dataservice.driver">org.h2.Driver</property>
<property name="org.wso2.ws.dataservice.protocol">jdbc:h2:file:./samples/database/DATA_SERV_SAMP</property>
<property name="org.wso2.ws.dataservice.user">wso2ds</property>
<property name="org.wso2.ws.dataservice.password">wso2ds</property>
<property name="org.wso2.ws.dataservice.minpoolsize">1</property>
<property name="org.wso2.ws.dataservice.maxpoolsize">10</property>
<property name="org.wso2.ws.dataservice.autocommit">false</property>
<property name="org.wso2.ws.dataservice.validation_query">SELECT 1</property>
</config>
<query id="addEmployeeQuery" useConfig="default">
<sql>insert into Employees (employeeNumber, lastName, firstName, email, salary) values(:employeeNumber,'test','test',:email,1000)</sql>
<param name="employeeNumber" ordinal="1" paramType="SCALAR" sqlType="INTEGER" type="IN"/>
<param name="email" ordinal="2" paramType="SCALAR" sqlType="STRING" type="IN">
<validatePattern pattern="(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])"/>
</param>
</query>
<query id="deleteEmployeeQuery" useConfig="default">
<sql>delete from Employees where employeeNumber=:employeeNumber</sql>
<properties>
<property name="org.wso2.ws.dataservice.autocommit">false</property>
</properties>
<param name="employeeNumber" ordinal="1" paramType="SCALAR" sqlType="INTEGER" type="IN"/>
</query>
<query id="employeeExistsQuery" useConfig="default">
<sql>select count(*) as c from Employees where employeeNumber=:employeeNumber</sql>
<param name="employeeNumber" ordinal="1" paramType="SCALAR" sqlType="INTEGER" type="IN"/>
<result element="Employees" rowName="Employee">
<element column="c" name="exists"/>
</result>
</query>
<operation name="deleteEmployee">
<call-query href="deleteEmployeeQuery">
<with-param name="employeeNumber" query-param="employeeNumber"/>
</call-query>
</operation>
<operation name="addEmployee" returnRequestStatus="true">
<call-query href="addEmployeeQuery">
<with-param name="employeeNumber" query-param="employeeNumber"/>
<with-param name="email" query-param="email"/>
</call-query>
</operation>
<operation name="employeeExists">
<call-query href="employeeExistsQuery">
<with-param name="employeeNumber" query-param="employeeNumber"/>
</call-query>
</operation>
</data>