<data enableBatchRequests="true" name="RouteService">
   <config id="routeDS">
      <property name="driverClassName">com.mysql.jdbc.Driver</property>
      <property name="url">jdbc:mysql://localhost:3306/test</property>
      <property name="username">root</property>
      <property name="password">root</property>
   </config>
   <query id="insertQuery" useConfig="routeDS">
      <sql>insert into route (name, length) values (:name, :length)</sql>
      <param name="name" sqlType="STRING"/>
      <param name="length" sqlType="STRING"/>
   </query>
   <query id="selectAll" useConfig="routeDS">
      <sql>select id, name, length from route;</sql>
      <result outputType="json">{    "routes": {        "route": [            {                "id": "$id",                "name": "$name",                "length": "$length(type:integer)"            }        ]    }}</result>
   </query>
   <operation name="getAll">
      <call-query href="selectAll"/>
   </operation>
   <operation name="insert" returnRequestStatus="true">
      <call-query href="insertQuery">
         <with-param name="name" query-param="name"/>
         <with-param name="length" query-param="length"/>
      </call-query>
   </operation>
   <resource method="POST" path="route">
      <call-query href="insertQuery">
         <with-param name="name" query-param="name"/>
         <with-param name="length" query-param="length"/>
      </call-query>
   </resource>
   <resource method="GET" path="routes">
      <call-query href="selectAll"/>
   </resource>
</data>