Skip to content

Commit 2d75d19

Browse files
gavinkinglukasj
authored andcommitted
very lightly rewrite section on input parameters
see #103
1 parent f17c289 commit 2d75d19

File tree

1 file changed

+28
-27
lines changed

1 file changed

+28
-27
lines changed

spec/src/main/asciidoc/ch04-query-language.adoc

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,47 +1253,48 @@ _collection_member_expression_, or as an argument to the SIZE operator.
12531253

12541254
==== Input Parameters
12551255

1256-
Either positional or named parameters may be
1257-
used. Positional and named parameters must not be mixed in a single
1258-
query.
1256+
An input parameter allows a value in the Java program to be safely
1257+
interpolated into the text of the parameterized query.
12591258

1260-
Input parameters can only be used in the
1261-
WHERE clause or HAVING clause of a query or
1262-
as the new value for an update item in the SET clause of an update
1263-
statement.
1259+
In a given query, either positional or named parameters may be used.
1260+
Positional and named parameters must not be mixed in a single query.
1261+
1262+
The persistence provider is required to support input parameters which
1263+
occur in the _WHERE_ clause or _HAVING_ clause of a query, or as the
1264+
new value for an update item in the _SET_ clause of an update statement.
12641265

12651266
[NOTE]
12661267
====
1267-
Note that if an input parameter value is
1268-
null, comparison operations or arithmetic operations involving the input
1269-
parameter will return an unknown value. See <<a5676>>.
1268+
Note that if an input parameter value is null, comparison operations or
1269+
arithmetic operations involving the input parameter will result in an
1270+
unknown value. See <<a5676>>.
12701271
====
12711272

1272-
All input parameters must be single-valued,
1273-
except in IN expressions (see <<a5107>>), which support the use of collection-valued input
1274-
parameters.
1273+
Every input parameter must be single-valued, unless the parameter occurs
1274+
as the right hand side of an _IN_ expressions (see <<a5107>>). Such input
1275+
parameters may be collection-valued.
12751276

1276-
The API for the binding of query parameters
1277-
is described in <<a1060>>.
1277+
The API for the binding concrete arguments to query parameters is described
1278+
in <<a3125>>.
12781279

12791280
===== Positional Parameters
12801281

1281-
The following rules apply to positional
1282-
parameters.
1282+
The following rules apply to positional input parameters.
12831283

1284-
* Input parameters are designated by the
1285-
question mark (_?_) prefix followed by an integer. For example: _?1_.
1284+
* A positional parameter is designated by an integer, and prefixed with a
1285+
_?_ symbol (question mark) in the text of the query string.
1286+
For example: _?1_.
12861287
* Input parameters are numbered starting from 1.
1287-
* The same parameter can be used more than once in the query string.
1288-
* The ordering of the use of parameters within
1289-
the query string need not conform to the order of the positional
1290-
parameters.
1288+
* A given positional parameter may occur more than once in the query string.
1289+
* The ordering of the use of parameters within the text of the query string
1290+
need not match the numbering of the positional parameters.
12911291

12921292
===== Named Parameters
12931293

1294-
A named parameter is denoted by an identifier
1295-
that is prefixed by the ":" symbol. It follows the rules for identifiers
1296-
defined in <<a4760>>. Named parameters are case sensitive.
1294+
A named parameter is denoted by an identifier, and prefixed by the _:_ symbol
1295+
(colon) in the text of the query string. The identifier name must follow the
1296+
usual rules for identifiers specified in <<a4760>>. Named parameters are
1297+
case-sensitive.
12971298

12981299
Example:
12991300

@@ -1304,7 +1305,7 @@ FROM Customer c
13041305
WHERE c.status = :stat
13051306
----
13061307

1307-
The same named parameter can be used more than once in the query string.
1308+
A given named parameter may occur more than once in the query string.
13081309

13091310
==== Conditional Expression Composition
13101311

0 commit comments

Comments
 (0)