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 Fri, 23 Sep 2005 12:47:04 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.[[BR]]New  pc class required. ||
+ ||<|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 ...JDOQLKeywordsAsFieldNames` ||<|2> `jdoql.keywords.`[[BR]]`KeywordsAsFieldNames`
||<|2> Positive and negative test.[[BR]]New  pc class required. ||
- || '''`invalid:`'''[[BR]] `SELECT select FROM ...` ||
+ || '''`invalid:`'''[[BR]] `SELECT select FROM ...JDOQLKeywordsAsFieldNames` ||
  ||'''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 AS firstName,` `lastname
AS lastName` `INTO ...FullName` `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` ||
@@ -98, +98 @@

  === New Supported Methods ===
  
  || '''Assertion''' || '''JDOQL''' || '''Testclass''' || '''Comment''' ||
- ||<|3> '''A14.6.2-46:''' Supported Map methods:[[BR]] - `get(Object)`[[BR]] - `containsKey(Object)`[[BR]]
- `containsValue(Object)` || '''´get:´'''[[BR]]`SELECT FROM Person` `WHERE phoneNumbers.get('home')
== '1111'` ||<|3> `jdoql.methods.`[[BR]]`SupportedMapMethods` ||<|3> Positive
Test. ||
+ ||<|3> '''A14.6.2-46:''' Supported Map methods:[[BR]] - `get(Object)`[[BR]] - `containsKey(Object)`[[BR]]
- `containsValue(Object)` || '''`get:`'''[[BR]]`SELECT FROM Person` `WHERE phoneNumbers.get('home')
== '1111'` ||<|3> `jdoql.methods.`[[BR]]`SupportedMapMethods` ||<|3> Positive
Test. ||
- || '''containsKey:´'''[[BR]]`SELECT FROM Person` `WHERE phoneNumbers.containsKey('home')
||
+ || '''`containsKey:`'''[[BR]]`SELECT FROM Person` `WHERE phoneNumbers.containsKey('home')`
||
- || '''´containsValue:´'''[[BR]]`SELECT FROM Person` `WHERE phoneNumbers.get('1111')` ||
+ || '''`containsValue:`'''[[BR]]`SELECT FROM Person` `WHERE phoneNumbers.get('1111')` ||
  ||<|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()
== 'EMP1FIRST'`||
  || '''`indexOf:`'''[[BR]]`SELECT FROM company.Person` `WHERE firstname.indexOf('First')
== 4` ||
@@ -133, +133 @@

  
  || '''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('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.[[BR]]New
pc class required. ||
+ || '''A14.6.5-2''': ?? If the class does not manage an `Extent`, then no results will satisfy
the query. || ''`(javax.jdo.option.UnconstrainedQueryVariables)`''[[BR]]`SELECT v FROM Person
VARIABLES NoExtent v` || `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 == '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 == 'emp1First'` `& projects.contains(project)` `& project.name
== 'orange'` ||
  || '''`invalid:`'''[[BR]] `SELECT FROM company.Company` `WHERE departments.contains(department)`
`& department.name == 'Development'` `VARIABLES Employee employee` ||

Mime
View raw message