If the output of a SQL statement has multiple rows you can use arrays of structures to receive all rows. The syntax is: MyReservationStructure[], where MyReservationStructure is the name of the structure. For example, you can write as the Implementation of a method:
MyReservationStructure[] reservations = ( MyReservationStructure[])sql( MyReservationStructure[].class, "GET_CURRENT_BOOKINGS" );
If the output or input of a REST Service contains has a list of elements held in an XML or JSON array, you can use the same syntax MyReservationStructure[] in the Type field of the Parameter. Such a list of elements could look like this in XML:
<MyReservationStructures>
<MyReservationStructure participants="1" id="160">
<destination>AUSTRALIA</destination>
<tour>53</tour>
<type>ISLAND SUNTANNER</type>
</MyReservationStructure>
<MyReservationStructure participants="3" id="157">
<destination>AUSTRALIA</destination>
<tour>54</tour>
<type>ISLAND SUNTANNER</type>
</MyReservationStructure>
<MyReservationStructure participants="1" id="182">
<destination>BRAZIL</destination>
<tour>144</tour>
<type>RAINFOREST RIDE</type>
</MyReservationStructure>
</MyReservationStructures>
Or it could look like this in JSON:
[
{
"participants": 1,
"id": 160,
"destination": "AUSTRALIA",
"tour": 53,
"type": "ISLAND SUNTANNER"
},
{
"participants": 3,
"id": 157,
"destination": "AUSTRALIA",
"tour": 54,
"type": "ISLAND SUNTANNER"
},
{
"participants": 1,
"id": 182,
"destination": "BRAZIL",
"tour": 144,
"type": "RAINFOREST RIDE"
}
]
|