Skip to content

Commit c3534d1

Browse files
Fix #788 - Undocumented attributes on sql-query
1 parent babbdb6 commit c3534d1

File tree

2 files changed

+107
-0
lines changed

2 files changed

+107
-0
lines changed

doc/reference/modules/manipulating_data.xml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,63 @@ q.SetString(0, name);
297297
q.SetInt32(1, minWeight);
298298
var cats = q.List<Cat>();]]></programlisting>
299299

300+
<para>
301+
Named queries are by default validated at startup time, allowing to catch errors
302+
more easily than having to test all the application features using HQL queries. In
303+
case of validation errors, the details of failing queries are logged and a
304+
validation error is raised.
305+
</para>
306+
307+
<para>
308+
Named queries accepts a number of attributes matching settings available on the
309+
<literal>IQuery</literal> interface.
310+
</para>
311+
312+
<itemizedlist spacing="compact">
313+
<listitem>
314+
<para>
315+
<literal>flush-mode</literal> - override the session flush mode just for this query.
316+
</para>
317+
</listitem>
318+
<listitem>
319+
<para>
320+
<literal>cacheable</literal> - allow the query results to be cached by the second level cache.
321+
See <xref linkend="caches"/>.
322+
</para>
323+
</listitem>
324+
<listitem>
325+
<para>
326+
<literal>cache-region</literal> - specify the cache region of the query.
327+
</para>
328+
</listitem>
329+
<listitem>
330+
<para>
331+
<literal>cache-mode</literal> - specify the cache mode of the query.
332+
</para>
333+
</listitem>
334+
<listitem>
335+
<para>
336+
<literal>fetch-size</literal> - set a fetch size for the underlying ADO query.
337+
</para>
338+
</listitem>
339+
<listitem>
340+
<para>
341+
<literal>timeout</literal> - set the query timeout in seconds.
342+
</para>
343+
</listitem>
344+
<listitem>
345+
<para>
346+
<literal>read-only</literal> - <literal>true</literal> switches yielded entities to read-only.
347+
See <xref linkend="readonly"/>.
348+
</para>
349+
</listitem>
350+
<listitem>
351+
<para>
352+
<literal>comment</literal> - add a custom comment to the generated SQL.
353+
</para>
354+
</listitem>
355+
</itemizedlist>
356+
300357
<para>
301358
The query interface supports the use of named parameters. Named parameters
302359
are identifiers of the form <literal>:name</literal> in the query string.

doc/reference/modules/query_sql.xml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,56 @@ var pusList = query.SetString("name", "Pus%").List<Cat>();]]></programlisting>
463463
.SetResultSetMapping("catAndKitten")
464464
.List<Cat>();]]></programlisting>
465465

466+
<para>
467+
Like HQL named queries, SQL named queries accepts a number of attributes matching settings
468+
available on the <literal>ISQLQuery</literal> interface.
469+
</para>
470+
471+
<itemizedlist spacing="compact">
472+
<listitem>
473+
<para>
474+
<literal>flush-mode</literal> - override the session flush mode just for this query.
475+
</para>
476+
</listitem>
477+
<listitem>
478+
<para>
479+
<literal>cacheable</literal> - allow the query results to be cached by the second level cache.
480+
See <xref linkend="caches"/>.
481+
</para>
482+
</listitem>
483+
<listitem>
484+
<para>
485+
<literal>cache-region</literal> - specify the cache region of the query.
486+
</para>
487+
</listitem>
488+
<listitem>
489+
<para>
490+
<literal>cache-mode</literal> - specify the cache mode of the query.
491+
</para>
492+
</listitem>
493+
<listitem>
494+
<para>
495+
<literal>fetch-size</literal> - set a fetch size for the underlying ADO query.
496+
</para>
497+
</listitem>
498+
<listitem>
499+
<para>
500+
<literal>timeout</literal> - set the query timeout in seconds.
501+
</para>
502+
</listitem>
503+
<listitem>
504+
<para>
505+
<literal>read-only</literal> - <literal>true</literal> switches yielded entities to read-only.
506+
See <xref linkend="readonly"/>.
507+
</para>
508+
</listitem>
509+
<listitem>
510+
<para>
511+
<literal>comment</literal> - add a custom comment to the SQL.
512+
</para>
513+
</listitem>
514+
</itemizedlist>
515+
466516
<sect2 id="propertyresults">
467517
<title>Using return-property to explicitly specify column/alias
468518
names</title>

0 commit comments

Comments
 (0)