...
This combination provides tremendous flexibility in modeling the various DMLs used within the application. In case for your application, the needs are simple, you can ignore the Operation Extension and use only the Data Access Map Key and the Operation (which is mandatory anyway).
How the exact locator logic is used based on these three parameters is specific to the Data Access Layer. And this is where the flexibility is provided for the Data Access Layer implementation to use the parameters as appropriate.
The default iBATIS Data Access Manager interprets the locator as –follows:
<Data Access Map Key><Operation><Operation Extension>
This locator pattern is used for identifying a SQL Map from the iBATIS configuration XML and the SQL Map is used for executing the operation requested for.
The key attributes provided by a DatabaseRequest are provided –in the following table:
Attribute or Operation | Purpose |
int startRowNo; | This sets the starting row number for Pagination purposes |
int endRowNo; | This sets the ending row number for Pagination purposes |
PaginationModel paginationModel; | This sets the starting and ending row number for Pagination purposes using PaginationModel Object |
SortingModel sortingModel; | This sets the sorting conditions that should be applied to the DML using the SortingModel Object |
String dataAccessMapKey; | This sets the Data Access Map Key that is part of the DML Locator |
int operation; | This sets the operation to be executed. This has to one of the constants from DatabaseConstants. |
String operationExtension; | This sets the operation extension that is part of the DML Locator |
String dataSource; | This sets the logical data source that should be used for executing the DML. |
String dbAccessImpl; | This sets the actual underlying data access manager that needs to be used for that specific execution. This is typically not changed at a per request level. Rather there is a system level default provided as a configuration to the Canvas Configuration System that is defaulted. |
Map data; | This Map contains the data (could be flat or hierarchical) that should be used as part of the request. The Data Access Layer implementation can choose how it wants to use the data as part of any operation execution. |
List<Map> batchData; | This is a List of Maps that should be executed as a batch. This will be used by the Data access Layer implementation only of the operation is a Batch related operation. |
boolean queryAsMap; | This flag indicates whether the request should be executed with the intent of ultimately getting the result as a Map. By default this is set to false. When false, the control of the result packaging is left to the data access layer implementation. |
void addDataToBatch(Map aRow); | This method can be used to add a particular data set as a batch. This will be used by the Data access Layer implementation only of the operation is a Batch related operation. |
void clearFilters(); | This method can be used to clear any earlier filters that have been added to this request. |
void addFilter(String colName, Object Value) | This method is used to add a filter for the specific column for the specific value. |
DatabaseResult execute(); | This is the method that actually triggers the execution of this request. |
DatabaseResult getDatabaseResult(); | This is a helper method that returns the result that created post execution. |