You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-commits@db.apache.org by Apache Wiki <wi...@apache.org> on 2005/09/16 18:16:48 UTC

[Jdo Wiki] Update of "QueryTests" by MichaelBouschen

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 MichaelBouschen:
http://wiki.apache.org/jdo/QueryTests

The comment on the change is:
Changed package name of delete by query test cases

------------------------------------------------------------------------------
  == Deletion by Query ==
  
  || '''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` || `api.`[[BR]]`DeletePersistentAll` || Positive test. ||
+ || '''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` || `api.`[[BR]]`NoOfDeletedInstances` || 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> `api.`[[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. ||
  || '''`invalid result:`'''[[BR]]`SELECT firstname INTO ...FullName AS first` `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')` ||
  || '''`invalid range:`'''[[BR]]`SELECT FROM company.FullTimeEmployee` `RANGE 1 TO 10` ||
- || '''A14.8-4:''' Dirty instances of affected classes are first flushed to the datastore. Instances already in the cache when deleted via these methods or brought into the cache as a result of these methods undergo the life cycle transitions as if `deletePersistent` had been called on them. That is, if an affected class implements the `DeleteCallback` interface, the instances to be deleted are instantiated in memory and the `jdoPreDelete` method is called prior to deleting the instance in the datastore. If any `LifecycleListener` instances are registered with affected classes, these listeners are called for each deleted instance. Before returning control to the application, instances of affected classes in the cache are refreshed by the implementation so their status in the cache reflects whether they were deleted from the datastore. || `SELECT * FROM company.Person` || `api.`[[BR]]`DeleteCallback` || Positive test. ||
+ || '''A14.8-4:''' Dirty instances of affected classes are first flushed to the datastore. Instances already in the cache when deleted via these methods or brought into the cache as a result of these methods undergo the life cycle transitions as if `deletePersistent` had been called on them. That is, if an affected class implements the `DeleteCallback` interface, the instances to be deleted are instantiated in memory and the `jdoPreDelete` method is called prior to deleting the instance in the datastore. If any `LifecycleListener` instances are registered with affected classes, these listeners are called for each deleted instance. Before returning control to the application, instances of affected classes in the cache are refreshed by the implementation so their status in the cache reflects whether they were deleted from the datastore. || `SELECT * FROM company.Person` || `delete.`[[BR]]`DeleteCallback` || Positive test. ||
  
  [[Anchor(TestcasePattern)]]
  == Testcase Pattern ==