iBATIS SQL Maps Tutorial
The SQL Map File(s)
Now that we have a DataSource configured and our central configuration file is ready to go, we will need to provide the actual SQL Map file which contains our SQL code and the mappings for parameter objects and result objects (input and output respectively). Continuing with our example above, let’s build an SQL Map file for the Person class and the PERSON table. We’ll start with the general structure of an SQL document, and a simple select statement:
The above example shows the simplest form of SQL Map. It uses a feature of the SQL Maps framework hat automatically maps the columns of a ResultSet to JavaBeans properties (or Map keys etc.) based on name matching. The #value# token is an input parameter. More specifically, the use of “value” implies that we are using a simple primitive wrapper type (e.g. Integer; but we’re not limited to this).
Related iBATIS SQL Maps Tutorial: java source code, output columns, mapping approach, resultsetmetadata, central configuration, person class, sql code, resultset, select statement, input parameter, simplest form, database applications, mappings, input and output, implication