Skip to content

Commit 8ac597a

Browse files
committed
Merge pull request #9 from zaherhammoud/master
Added documentation to the index.xml for the #in directive usage
2 parents 9e82b56 + 52fb476 commit 8ac597a

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

src/site/xdoc/index.xml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,57 @@ FROM City
211211
#repeat( $_parameter.ids $id "," " state_id IN (" ")" )
212212
@{id}
213213
#end
214+
#end
215+
]]></source>
216+
</subsection>
217+
<subsection name="in">
218+
<h5>#in( collection var field ) body #end</h5>
219+
<p>
220+
Generates a SQL IN clause and breaks it into groups of 1000 items seperated by an OR clause to get around database limitations on the maximum number of items that can be handled.
221+
It also supports iterative parameter bindings via @{...} syntax.
222+
</p>
223+
<table>
224+
<thead>
225+
<tr>
226+
<th>Arg</th>
227+
<th>Description</th>
228+
<th>Type</th>
229+
<th>Default</th>
230+
<th>Example</th>
231+
</tr>
232+
</thead>
233+
<tbody>
234+
<tr>
235+
<td>collection</td>
236+
<td>List or array to iterate</td>
237+
<td>List or Array</td>
238+
<td>Empty List</td>
239+
<td>$_parameter.selectedIds</td>
240+
</tr>
241+
<tr>
242+
<td>var</td>
243+
<td>Variable to be used in the loop</td>
244+
<td>Reference</td>
245+
<td></td>
246+
<td>$item</td>
247+
</tr>
248+
<tr>
249+
<td>field</td>
250+
<td>Field name to be inserted before the IN clause</td>
251+
<td>String</td>
252+
<td>Empty String</td>
253+
<td>"state_id"</td>
254+
</tr>
255+
</tbody>
256+
</table>
257+
<p>Example:</p>
258+
<source><![CDATA[
259+
SELECT *
260+
FROM City
261+
#where()
262+
#in( $_parameter.ids $id "state_id" )
263+
@{id}
264+
#end
214265
#end
215266
]]></source>
216267
</subsection>

0 commit comments

Comments
 (0)