@@ -297,6 +297,63 @@ q.SetString(0, name);
297
297
q.SetInt32(1, minWeight);
298
298
var cats = q.List<Cat>();]]> </programlisting >
299
299
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
+
300
357
<para >
301
358
The query interface supports the use of named parameters. Named parameters
302
359
are identifiers of the form <literal >:name</literal > in the query string.
0 commit comments