db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Jdo Wiki] Update of "QueryTests" by MichaelWatzek
Date Wed, 21 Sep 2005 15:18:32 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jdo Wiki" for change notification.

The following page has been changed by MichaelWatzek:
http://wiki.apache.org/jdo/QueryTests

------------------------------------------------------------------------------
  || `SELECT FROM this` ||
  || `SELECT FROM company.Employee PARAMETERS int this` ||
  || `SELECT FROM company.Employee VARIABLES long this` ||
- ||<|2> '''A14.4-7''': Keywords are permitted as field names only if they are on the
right side of the "." in field access expressions || '''`valid:`'''[[BR]] `SELECT this.select
FROM ...` ||<|2> `jdoql.keywords.`[[BR]]`KeywordsAsFieldNames` ||<|2> Positive
and negative test. ||
+ ||<|2> '''A14.4-7''': Keywords are permitted as field names only if they are on the
right side of the "." in field access expressions || '''`valid:`'''[[BR]] `SELECT this.select
FROM ...` ||<|2> `jdoql.keywords.`[[BR]]`KeywordsAsFieldNames` ||<|2> Positive
and negative test.[[BR]]New  pc class required. ||
  || '''`invalid:`'''[[BR]] `SELECT select FROM ...` ||
- ||'''A14.6.13-1:''' The String version of Query represents all query elements using a single
string. The string contains the following structure: || `SELECT firstname INTO ...FullName
AS first,` `lastname INTO FullName AS last` `FROM company.FullTimeEmployee` `WHERE salary
> 1000` `& projects.contains(project)` `& project.budget > limit` `VARIABLES
Project project` `PARAMETERS BigDecimal limit` `ORDER BY salary` `GROUP BY firstname, lastname`
`HAVING lastname.startsWith('R')` `RANGE 1 TO 10` || `jdoql.keywords.`[[BR]]`SingleString`
|| Positive test. ||
+ ||'''A14.6.13-1:''' The String version of Query represents all query elements using a single
string. The string contains the following structure: || `SELECT firstname INTO ...FullName
AS firstName,` `lastname INTO ...FullName AS lastName` `FROM company.FullTimeEmployee` `WHERE
salary > 1000` `& projects.contains(project)` `& project.budget > limit` `VARIABLES
Project project` `PARAMETERS BigDecimal limit` `ORDER BY salary` `GROUP BY firstname, lastname`
`HAVING lastname.startsWith('R')` `RANGE 1 TO 10` || `jdoql.keywords.`[[BR]]`SingleString`
|| Positive test.[[BR]]New result class required. ||
  ||<|3> '''A14.6.13-2:''' Keywords, identified above in '''bold''', are either all
upper-case or all lower-case. Keywords cannot be mixed case. || '''`valid:`'''[[BR]] `SELECT
FROM company.Person` ||<|3> `jdoql.keywords.`[[BR]]`UppercaseLowercase` ||<|3>
Positive and negative test. ||
  || '''`valid:`'''[[BR]] `select from company.Person` ||
  || '''`invalid:`'''[[BR]] `SeLeCt FrOm company.Person` ||
@@ -98, +98 @@

  === New Supported Methods ===
  
  || '''Assertion''' || '''JDOQL''' || '''Testclass''' || '''Comment''' ||
- || '''A14.6.2-46:''' Supported Map methods:[[BR]] - `get(Object)`[[BR]] - `containsKey(Object)`[[BR]]
- `containsValue(Object)` || `...` || `jdoql.methods.`[[BR]]`SupportedMapMethods` || Positive
Test. ||
+ || '''A14.6.2-46:''' Supported Map methods:[[BR]] - `get(Object)`[[BR]] - `containsKey(Object)`[[BR]]
- `containsValue(Object)` || `...` || `jdoql.methods.`[[BR]]`SupportedMapMethods` || Positive
Test.[[BR]]New pc class required. ||
  ||<|9> '''A14.6.2-47''': New supported String methods:[[BR]] - `toLowerCase()`[[BR]]
- `toUpperCase()`[[BR]] - `indexOf(String)`[[BR]] - `indexOf(String, int)`[[BR]] - `matches(String)`[[BR]]
- `substring(int)`[[BR]] - `substring(int, int)`[[BR]] - `startsWith()`[[BR]] - `endsWith()`[[BR]]
|| '''`toLowerCase:`'''[[BR]]`SELECT FROM company.Person` `WHERE firstname.toLowerCase() ==
'john'` ||<|9> `jdoql.methods.`[[BR]]`SupportedStringMethods` ||<|9> Positive
test. ||
- || '''`toUpperCase:`'''[[BR]]`SELECT FROM company.Person` `WHERE firstname.toUpperCase()
== 'JOHN'`||
+ || '''`toUpperCase:`'''[[BR]]`SELECT FROM company.Person` `WHERE firstname.toUpperCase()
== 'EMP1FIRST'`||
- || '''`indexOf:`'''[[BR]]`SELECT FROM company.Person` `WHERE firstname.indexOf('hn') ==
2` ||
+ || '''`indexOf:`'''[[BR]]`SELECT FROM company.Person` `WHERE firstname.indexOf('First')
== 4` ||
- || '''`indexOf:`'''[[BR]]`SELECT FROM company.Person` `WHERE firstname.indexOf('hn', 2)
== 2` ||
+ || '''`indexOf:`'''[[BR]]`SELECT FROM company.Person` `WHERE firstname.indexOf('First',
2) == 4` ||
- || '''`matches:`'''[[BR]]`SELECT FROM company.Person` `WHERE firstname.matches('*hn')` ||
+ || '''`matches:`'''[[BR]]`SELECT FROM company.Person` `WHERE firstname.matches('*First')`
||
- || '''`substring:`'''[[BR]]`SELECT FROM company.Person` `WHERE firstname.substring(2) ==
'hn'` ||
- || '''`substring:`'''[[BR]]`SELECT FROM company.Person` `WHERE firstname.substring(2,4)
== 'hn'` ||
+ || '''`substring:`'''[[BR]]`SELECT FROM company.Person` `WHERE firstname.substring(4) ==
'First'` ||
+ || '''`substring:`'''[[BR]]`SELECT FROM company.Person` `WHERE firstname.substring(4,9)
== 'First'` ||
- || '''`startsWith:`'''[[BR]]`SELECT FROM company.Person` `WHERE firstname.startsWith('Jo')`
||
+ || '''`startsWith:`'''[[BR]]`SELECT FROM company.Person` `WHERE firstname.startsWith('emp')`
||
- || '''`endsWith:`'''[[BR]]`SELECT FROM company.Person` `WHERE firstname.endsWith('hn')`
||
+ || '''`endsWith:`'''[[BR]]`SELECT FROM company.Person` `WHERE firstname.endsWith('First')`
||
  ||<|2> '''A14.6.2-48:''' Supported Math methods: [[BR]] - `Math.abs(numeric)`[[BR]]
- `Math.sqrt(numeric)` || `SELECT FROM company.FullTimeEmployee` `WHERE Math.abs(salary) >
10000` ||<|2> `jdoql.methods.`[[BR]]`SupportedMathMethods` ||<|2> Positive test.
||
  || `SELECT FROM company.FullTimeEmployee` `WHERE Math.sqrt(salary) > 100` ||
- || '''A14.6.2-49:''' Supported JDOHelper methods:[[BR]] - `JDOHelper.getObjectId(Object)`
|| `...` || `jdoql.methods.`[[BR]]`SupportedJDOHelperMethods` || Positive test.||
+ || '''A14.6.2-49:''' Supported JDOHelper methods:[[BR]] - `JDOHelper.getObjectId(Object)`
|| `SELECT JDOHelper.getObjectId(this) FROM company.Person` || `jdoql.methods.`[[BR]]`SupportedJDOHelperMethods`
|| Positive test.||
  
  [[Anchor(Parameters)]]
  === Parameters ===
@@ -130, +130 @@

  === Variables ===
  
  || '''Assertion''' || '''JDOQL''' || '''Testclass''' || '''Comment''' ||
- || '''A14.6.5-1:''' ?? A variable that is not constrained with an explicit contains clause
is constrained by the extent of the persistence capable class (including subclasses). || `SELECT
department FROM company.Person` `WHERE firstname.endsWith('hn')` `VARIABLES Department department`
|| `jdoql.variables.`[[BR]]`UnconstrainedVariable` || Posistive test. ||
+ || '''A14.6.5-1:''' ?? A variable that is not constrained with an explicit contains clause
is constrained by the extent of the persistence capable class (including subclasses). || `SELECT
department FROM company.Person` `WHERE firstname.endsWith('First')` `VARIABLES Department
department` || `jdoql.variables.`[[BR]]`UnconstrainedVariable` || Posistive test. ||
- || '''A14.6.5-2''': ?? If the class does not manage an `Extent`, then no results will satisfy
the query. || `...` || `jdoql.variables.`[[BR]]`VariablesWithoutExtent` || Positive test.
||
+ || '''A14.6.5-2''': ?? If the class does not manage an `Extent`, then no results will satisfy
the query. || `...` || `jdoql.variables.`[[BR]]`VariablesWithoutExtent` || Positive test.[[BR]]New
pc class required. ||
- ||<|3> '''A14.6.5-3:''' All variables must be explicitly declared, or all variables
must be implicitly declared. || '''`explicit:`'''[[BR]] `SELECT FROM company.Employee` `WHERE
team.contains(employee)` `& employee.firstname == 'John'` `& projects.contains(project)`
`& project.name == 'orange'` `VARIABLES Employee employee; Project project` ||<|3>
`jdoql.variables.`[[BR]]`MixedVariables` ||<|3> Positive and negative test. ||
+ ||<|3> '''A14.6.5-3:''' All variables must be explicitly declared, or all variables
must be implicitly declared. || '''`explicit:`'''[[BR]] `SELECT FROM company.Employee` `WHERE
team.contains(employee)` `& employee.firstname == 'emp1First'` `& projects.contains(project)`
`& project.name == 'orange'` `VARIABLES Employee employee; Project project` ||<|3>
`jdoql.variables.`[[BR]]`MixedVariables` ||<|3> Positive and negative test. ||
- || '''`implicit:`'''[[BR]] `SELECT FROM company.Employee` `WHERE team.contains(employee)`
`& employee.firstname == 'John'` `& projects.contains(project)` `& project.name
== 'orange'` ||
+ || '''`implicit:`'''[[BR]] `SELECT FROM company.Employee` `WHERE team.contains(employee)`
`& employee.firstname == 'emp1First'` `& projects.contains(project)` `& project.name
== 'orange'` ||
  || '''`invalid:`'''[[BR]] `SELECT FROM company.Company` `WHERE departments.contains(department)`
`& department.name == 'Development'` `VARIABLES Employee employee` ||
- ||<|3> '''A14.6.5-4:''' Names are treated as variable names if they are explicitly
declared via `declareVariables`. Otherwise, names are treated as field names if they are members
of the candidate class. Finally, names are treated as implicitly defined variable names. ||
'''`explicit:`'''[[BR]] `SELECT FROM company.Employee` `WHERE team.contains(employee)` `&
employee.firstname == 'John'` `VARIABLES Employee employee` ||<|3> `jdoql.variables.`[[BR]]`VariablesAndFields`
||<|3> Positive test. ||
+ ||<|3> '''A14.6.5-4:''' Names are treated as variable names if they are explicitly
declared via `declareVariables`. Otherwise, names are treated as field names if they are members
of the candidate class. Finally, names are treated as implicitly defined variable names. ||
'''`explicit:`'''[[BR]] `SELECT FROM company.Employee` `WHERE team.contains(employee)` `&
employee.firstname == 'emp1First'` `VARIABLES Employee employee` ||<|3> `jdoql.variables.`[[BR]]`VariablesAndFields`
||<|3> Positive test. ||
- || '''`implicit:`'''[[BR]] `SELECT FROM company.Employee` `WHERE team.contains(employee)`
`& employee.firstname == 'John'` ||
+ || '''`implicit:`'''[[BR]] `SELECT FROM company.Employee` `WHERE team.contains(employee)`
`& employee.firstname == 'emp1First'` ||
- || '''`field name:`'''[[BR]] `SELECT FROM company.Person` `WHERE firstname == 'John'` ||
+ || '''`field name:`'''[[BR]] `SELECT FROM company.Person` `WHERE firstname == 'emp1First'`
||
  
  [[Anchor(OtherLanguageChanges)]]
  === Other Language Changes ===
  
  || '''Assertion''' || '''JDOQL''' || '''Testclass''' || '''Comment''' ||
- ||<|2> '''A14.6.2-42:''' There is no distinction made between character literals and
`String` literals. Single character `String` literals can be used wherever character literals
are permitted. `String` literals are allowed to be delimited by single quote marks or double
quote marks. This allows `String` literal filters to use single quote marks instead of escaped
double quote marks. || '''`valid:`'''[[BR]] `SELECT FROM company.Person ` `WHERE firstname
== 'John' OR ... == 'F'` ||<|2> `jdoql.`[[BR]]`CharacterAndStringLiterals` ||<|2>
Positive and negative test. ||
+ ||<|2> '''A14.6.2-42:''' There is no distinction made between character literals and
`String` literals. Single character `String` literals can be used wherever character literals
are permitted. `String` literals are allowed to be delimited by single quote marks or double
quote marks. This allows `String` literal filters to use single quote marks instead of escaped
double quote marks. || '''`valid:`'''[[BR]] `SELECT FROM mylib.PrimitiveTypes` `WHERE stringNull.startsWith('Even')
OR charNotNull == 'O'` ||<|2> `jdoql.`[[BR]]`CharacterAndStringLiterals` ||<|2>
Positive and negative test. ||
- || '''`invalid:`'''[[BR]] `SELECT FROM company.Person` `WHERE firstname == 'John' OR ...
== 'F.'` ||
+ || '''`invalid:`'''[[BR]] `SELECT FROM mylib.PrimitiveTypes` `WHERE stringNull.startsWith('Even')
OR charNotNull == 'O.'` ||
- ||<|2> '''A14.6.2-43:''' Identifiers that are persistent field names or `public final
static` field names are required to be supported by JDO implementations. || '''`field names:`'''[[BR]]
`SELECT FROM company.Person` `VARIABLES String firstname PARAMETERS long personid` ||<|2>
`jdoql.`[[BR]]`IdentifiersEqualFieldNames` ||<|2> Positive test. ||
+ ||<|2> '''A14.6.2-43:''' Identifiers that are persistent field names or `public final
static` field names are required to be supported by JDO implementations. || '''`field names:`'''[[BR]]
`SELECT FROM company.Person` `VARIABLES String firstname PARAMETERS long personid` ||<|2>
`jdoql.`[[BR]]`IdentifiersEqualFieldNames` ||<|2> Positive test.[[BR]]New static field
required.||
  || '''`static field names:`'''[[BR]] `...` ||
  || '''A14.6.8-1:''' `setRange(long fromIncl, long toExcl)` || `SELECT lastname FROM company.Person
RANGE 1 TO 10` || `jdoql.`[[BR]]`PositiveRange` || Positive test. ||
  || '''A14.6.8-2:''' If `((toExcl - fromIncl) <= 0)` evaluates to `true`, if the result
of the query execution is a List, the returned List contains no instances, and an Iterator
obtained from the List returns `false` to `hasNext()`. If the result of the query execution
is a single instance `(setUnique(true))`, it will have a value of `null`. || `SELECT lastname
FROM company.Person RANGE 10 TO 1` || `jdoql.`[[BR]]`NegativeRange` || Positive test. ||
@@ -156, +156 @@

  
  || '''Assertion''' || '''JDOQL''' || '''Testclass''' || '''Comment''' ||
  || '''A14.5-11:''' Construct a new query instance using the specified `String` as the single-string
representation of the query. || `SELECT FROM company.Person` || `api.`[[BR]]`NewQuerySingleString`
|| Positive test. ||
- || '''A14.5-12:''' Construct a new query instance with the given candidate class from a
named query. || `SELECT FROM company.Person` || `api.`[[BR]]`NewNamedQuery` || Positive test.
||
+ || '''A14.5-12:''' Construct a new query instance with the given candidate class from a
named query. || `SELECT FROM company.Person` || `api.`[[BR]]`NewNamedQuery` || Positive test.[[BR]]Add
JDO metadata for named queries. ||
- || '''A14.5-13:''' If the named query is not found in already-loaded metadata, the query
is searched for using an algorithm. Files containing metadata are examined in turn until the
query is found. The order is based on the metadata search order for class metadata, but includes
files named based on the query name. || `SELECT FROM company.Person` || `api.`[[BR]]`MetadataSearchOrder`
|| Positive test. ||
+ || '''A14.5-13:''' If the named query is not found in already-loaded metadata, the query
is searched for using an algorithm. Files containing metadata are examined in turn until the
query is found. The order is based on the metadata search order for class metadata, but includes
files named based on the query name. || `SELECT FROM company.Person` || `api.`[[BR]]`MetadataSearchOrder`
|| Positive test.[[BR]]Add JDO metadata for named queries. ||
  || '''A14.5-14:''' If the metadata is not found in the above, a `JDOUserException` is thrown.
|| || `api.`[[BR]]`NamedQueryNotFound` || Negative test. ||
- || '''A14.5-15:''' The `Query` instance returned from this method can be modified by the
application, just like any other `Query` instance. || `SELECT FROM company.Person WHERE firstname
== 'John'` || `api.`[[BR]]`ChangeQuery` || Positive test. ||
+ || '''A14.5-15:''' The `Query` instance returned from this method can be modified by the
application, just like any other `Query` instance. || `SELECT FROM company.Person WHERE firstname
== 'emp1First'` || `api.`[[BR]]`ChangeQuery` || Positive test. ||
- || '''A14.5-16:''' Named queries must be compilable. Attempts to get a named query that
cannot be compiled result in `JDOUserException`. || `SELECT from company.Person` || `api.`[[BR]]`InvalidNamedQuery`
|| Negative test. ||
+ || '''A14.5-16:''' Named queries must be compilable. Attempts to get a named query that
cannot be compiled result in `JDOUserException`. || `SeLeCt FrOm company.Person` || `api.`[[BR]]`InvalidNamedQuery`
|| Negative test.[[BR]]Add JDO metadata for named queries. ||
  || '''A14.6-21:''' This method retrieves the fetch plan associated with the `Query`. It
always returns the identical instance for the same `Query` instance. Any change made to the
fetch plan affects subsequent query execution. || `SELECT FROM company.Person` || `api.`[[BR]]`FetchPan`
|| Positive test. ||
- ||<|2> '''A14.6-16:''' `void setResult (String result);` Specify the results of the
query if not instances of the candidate class. || '''`valid:`'''[[BR]]`SELECT lastname FROM
company.Person` ||<|2> `api.`[[BR]]`NewNamedQuery` ||<|2> Positive test and negative
test. ||
+ ||<|2> '''A14.6-16:''' `void setResult (String result);` Specify the results of the
query if not instances of the candidate class. || '''`valid:`'''[[BR]]`SELECT lastname FROM
company.Person` ||<|2> `api.`[[BR]]`SetResult` ||<|2> Positive test and negative
test. ||
- ||'''`invalid:`'''[[BR]]`SELECT middlename FROM company.Person` ||
+ ||'''`invalid:`'''[[BR]]`SELECT noname FROM company.Person` ||
  || '''A14.6-17:''' `void setGrouping (String grouping);` Specify the grouping of results
for aggregates. || `SELECT lastname FROM company.Person GROUP BY lastname` || `api.`[[BR]]`SetGrouping`
|| Positive test. ||
- || '''A14.6-18:''' `void setUnique (boolean unique);` Specify that there is a single result
of the query. || `SELECT UNIQUE firstname` `FROM company.Person` `WHERE lastname == Russel'`
|| `api.`[[BR]]`SetUnique` || Positive test. ||
+ || '''A14.6-18:''' `void setUnique (boolean unique);` Specify that there is a single result
of the query. || `SELECT UNIQUE firstname` `FROM company.Person` `WHERE lastname == emp1Last'`
|| `api.`[[BR]]`SetUnique` || Positive test. ||
- || '''A14.6-19:''' `void setResultClass (Class resultClass);` Specify the class to be used
to return result instances. || `SELECT firstname, lastname INTO ...FullName` `FROM company.Person`
|| `api.`[[BR]]`SetResultClass` || Positive test. ||
+ || '''A14.6-19:''' `void setResultClass (Class resultClass);` Specify the class to be used
to return result instances. || `SELECT firstname, lastname INTO ...FullName` `FROM company.Person`
|| `api.`[[BR]]`SetResultClass` || Positive test.[[BR]]New result class required. ||
  || '''A14.6-20:''' `setRange(int fromIncl, int toExcl);` Specify the number of instances
to skip over and the maximum number of result instances to return. || `SELECT FROM company.Person
RANGE 1 TO 10` || `api.`[[BR]]`SetRange` || Positive test. ||
  || '''A14.6-22:''' The `Unmodifiable` option, when set to `true`, disallows further modification
of the query, except for specifying the range and result class and `ignoreCache` option. ||
`SELECT FROM company.Person` || `api.`[[BR]]`UnmodifiableQuery` || Negative test. ||
- || '''A14.6-23:''' The single string query is first parsed to yield the result, result class,
filter, variable list, parameter list, import list, grouping, ordering, and range. Then, the
values specified in APIs `setResult`, `setResultClass`, `setFilter`, `declareVariables`, `declareParamters`,
`declareImports`, `setGrouping`, `setOrdering`, and `setRange` override the corresponding
settings from the single string query. || `...` || `api.`[[BR]]`SingleStringQuery` || Positive
test. ||
+ || '''A14.6-23:''' The single string query is first parsed to yield the result, result class,
filter, variable list, parameter list, import list, grouping, ordering, and range. Then, the
values specified in APIs `setResult`, `setResultClass`, `setFilter`, `declareVariables`, `declareParamters`,
`declareImports`, `setGrouping`, `setOrdering`, and `setRange` override the corresponding
settings from the single string query. || `SELECT firstname INTO ...FullName AS firstName,`
`lastname INTO ...FullName AS lastName` `FROM company.FullTimeEmployee` `WHERE salary >
1000` `& projects.contains(project)` `& project.budget > limit` `VARIABLES Project
project` `PARAMETERS BigDecimal limit` `ORDER BY salary` `GROUP BY firstname, lastname` `HAVING
lastname.startsWith('R')` `RANGE 1 TO 10` || `api.`[[BR]]`SingleStringQuery` || Positive test.[[BR]]New
result class required. ||
  || '''A14.9-1:''' Some JDO vendors provide extensions to the query, and these extensions
must be set in the query instance prior to execution. || `SELECT FROM company.Person` || `api.`[[BR]]`QueryExtentions`
|| Positive test. ||
  
  [[Anchor(ResultHandling)]]
@@ -195, +195 @@

  ||<|2> '''A14.6.10-1:''' When grouping is specified, each result expression must be
one of: an expression contained in the grouping expression; or, an aggregate expression evaluated
once per group. The query groups all elements where all expressions specified in `setGrouping`
have the same values. The query result consists of one element per group. || '''`valid:`'''[[BR]]`SELECT
department, SUM(salary)` `FROM company.FullTimeEmployee GROUP BY department` ||<|2>
`result.`[[BR]]`Grouping` ||<|2> Positive and negative test. ||
  || '''`invalid:`'''[[BR]]`SELECT department, salary` `FROM company.FullTimeEmployee GROUP
BY department` ||
  ||<|2> '''A14.6.10-2:''' When `having` is specified, the `having` expression consists
of arithmetic and boolean expressions containing aggregate expressions. || '''`valid:`'''[[BR]]`SELECT
department, SUM(salary)` `FROM company.FullTimeEmployee GROUP BY department` `HAVING COUNT(department.employees)
> 0` ||<|2> `result.`[[BR]]`Having` ||<|2> Positive and negative test. ||
- || '''`invalid:`'''[[BR]]`SELECT department, SUM(salary)` `FROM company.FullTimeEmployee
GROUP BY department` `HAVING firstname == 'John'` ||
+ || '''`invalid:`'''[[BR]]`SELECT department, SUM(salary)` `FROM company.FullTimeEmployee
GROUP BY department` `HAVING firstname == 'emp1First'` ||
  ||<|3> '''A14.6.11-1:''' When the value of the `Unique` flag is `true`, then the result
of a query is a single value, with `null` used to indicate that none of the instances in the
candidates satisfied the filter. If more than one instance satisfies the filter, and the range
is not limited to one result, then `execute` throws a `JDOUserException.` || '''`valid, result
is non-null:`'''[[BR]]`SELECT UNIQUE FROM company.Company` `WHERE companyid == 1` ||<|3>
`result.`[[BR]]`Unique` ||<|3> Positive and negative test. ||
  || '''`valid, result is null:`'''[[BR]]`SELECT UNIQUE FROM company.Company` WHERE name ==
'non-existent' ||
  || '''`invalid:`'''[[BR]]`SELECT UNIQUE FROM company.Person` ||
  ||<|3> '''A14.6.11-2:''' The default Unique setting is `true` for aggregate results
without a grouping expression, and `false` otherwise. || '''`true:`'''[[BR]]`SELECT COUNT(THIS)
FROM company.Person` ||<|3> `result.`[[BR]]`DefaultUnique` ||<|3> Positive test.
||
  || '''`false grouping:`'''[[BR]]`SELECT FROM company.Person` `GROUP BY lastname` ||
  || '''`false:`'''[[BR]]`SELECT FROM company.Person` ||
- || '''A14.6.12-1:''' The result class may be one of ... ... Portable result classes do not
invoke any persistence behavior during their no-args constructor or set methods. || `SELECT
firstname, lastname INTO ...FullName FROM company.Person` || `result.`[[BR]]`ResultClassRequirements`
|| Positive test. ||
+ || '''A14.6.12-1:''' The result class may be one of ... ... Portable result classes do not
invoke any persistence behavior during their no-args constructor or set methods. || `SELECT
firstname, lastname INTO ...FullName FROM company.Person` || `result.`[[BR]]`ResultClassRequirements`
|| Positive test.[[BR]]New result class required. ||
  || '''A14.6.12-2:''' Table 6: Shape of Result (C is the candidate class) || `...` || `result.`[[BR]]`ShapeOfResult`
|| Positive test. ||
  
  [[Anchor(SQLQueries)]]
@@ -210, +210 @@

  
  || '''Assertion''' || '''JDOQL''' || '''Testclass''' || '''Comment''' ||
  ||'''A14.7-1:''' In this case, the factory method that takes the language string and Object
is used: `newQuery (String language, Object query)`. The language parameter is `javax.jdo.query.SQL`
and the query parameter is the SQL query string. || `SELECT * FROM company.Person` || `sql.`[[BR]]`NewQuery`
|| Positive test.  ||
- ||<|4> '''A14.7-2:''' The only methods that can be used are `setClass` to establish
the candidate class, `setUnique` to declare that there is only one result row, and `setResultClass`
to establish the result class. || '''`setClass:`'''[[BR]]`SELECT * FROM company.Person` ||<|4>
`sql.`[[BR]]`AllowedAPIMethods` ||<|4> Positive and negative test. ||
+ ||<|4> '''A14.7-2:''' The only methods that can be used are `setClass` to establish
the candidate class, `setUnique` to declare that there is only one result row, and `setResultClass`
to establish the result class. || '''`setClass:`'''[[BR]]`SELECT * FROM company.Person` ||<|4>
`sql.`[[BR]]`AllowedAPIMethods` ||<|4> Positive and negative test.[[BR]]New result class
required. ||
  || '''`setUnique:`'''[[BR]]`SELECT * FROM company.Company` ||
  || '''`setResultClass:`'''[[BR]]`SELECT firstname, lastname FROM company.Person` ||
  || '''`invalid:`'''[[BR]]''`for all other query api methods`'' ||
@@ -224, +224 @@

  || '''Assertion''' || '''JDOQL''' || '''Testclass''' || '''Comment''' ||
  || '''A14.8-1:''' These methods delete the instances of affected classes that pass the filter,
and all dependent instances. Affected classes are the candidate class and its persistence-capable
subclasses. || `SELECT * FROM company.Person` || `delete.`[[BR]]`DeletePersistentAll` || Positive
test. ||
  || '''A14.8-2:''' The number of instances of affected classes that were deleted is returned.
Embedded instances and dependent instances are not counted in the return value. || `SELECT
* FROM company.Person` || `delete.`[[BR]]`NoOfDeletedInstances` || Positive test. ||
- ||<|6> '''A14.8-3:''' Query elements `filter`, `parameters`, `imports`, `variables`,
and `unique` are valid in queries used for delete. Elements `result`, `result class`, `range`,
`grouping`, and `ordering` are invalid. If any of these elements is set to its non-default
value when one of the `deletePersistentAll` methods is called, a `JDOUserException` is thrown
and no instances are deleted. || '''`valid:`'''[[BR]]`SELECT UNIQUE FROM company.FullTimeEmployee`
`WHERE salary > 1000` `& projects.contains(project)` `& project.budget > limit`
`VARIABLES Project project` `PARAMETERS BigDecimal limit` ||<|6> `delete.`[[BR]]`DeleteQueryElements`
||<|6> Positive and negative test. ||
+ ||<|6> '''A14.8-3:''' Query elements `filter`, `parameters`, `imports`, `variables`,
and `unique` are valid in queries used for delete. Elements `result`, `result class`, `range`,
`grouping`, and `ordering` are invalid. If any of these elements is set to its non-default
value when one of the `deletePersistentAll` methods is called, a `JDOUserException` is thrown
and no instances are deleted. || '''`valid:`'''[[BR]]`SELECT UNIQUE FROM company.FullTimeEmployee`
`WHERE salary > 1000` `& projects.contains(project)` `& project.budget > limit`
`VARIABLES Project project` `PARAMETERS BigDecimal limit` ||<|6> `delete.`[[BR]]`DeleteQueryElements`
||<|6> Positive and negative test.[[BR]]New result class required. ||
- || '''`invalid result:`'''[[BR]]`SELECT firstname INTO ...FullName AS first` `FROM company.FullTimeEmployee`
||
+ || '''`invalid result:`'''[[BR]]`SELECT firstname INTO ...FullName AS firstName` `FROM company.FullTimeEmployee`
||
  || '''`invalid order by:`'''[[BR]]`SELECT FROM company.FullTimeEmployee` `ORDER BY salary`
||
  || '''`invalid group by:`'''[[BR]]`SELECT FROM company.FullTimeEmployee` `GROUP BY lastname`
||
  || '''`invalid having:`'''[[BR]]`SELECT FROM company.FullTimeEmployee` `GROUP BY lastname`
`HAVING lastname.startsWith('R')` ||

Mime
View raw message