Quick primer on iBatis SQL Map

This section is not to be considered as the source of truth for all features supported by iBatis. Instead this covers a few basics that apply to modeling queries in iBatis.


All SQL maps are created with following XML structure -

  • sqlMap – This is the root element
  • resultMap – This is optional. This is used to define how the various columns need to be mapped into the target result object.
  • select / insert / update / delete – This is the actual query type that needs to be executed
  • parameterMap – This is optional. This is used to define how the various parameters need to be mapped.
  • sql – This is a reusable SQL fragment that can be included into a DML


Let us look at each of the elements.