The following table lists the method for the Database.QueryLocator object:
| Name | Arguments | Return Type | Description |
|---|---|---|---|
| getQuery | String | Returns the query used to instantiate the Database.QueryLocator
object. This is useful when testing the start method. For example:System.assertEquals(QLReturnedFromStart. getQuery(), Database.getQueryLocator([SELECT Id FROM Account]).getQuery() ); You cannot use the FOR UPDATE keywords with a getQueryLocator query to lock a set of records. The start method automatically locks the set of records in the batch. |