Java Reference
In-Depth Information
where it came from (except in chapter 2, where we did our simple application).
This was an example of a < select> mapped statement.
There are several types of mapped statements, each with its own purpose and
set of attributes and child elements. This may sound obvious, but generally it is
best to use the statement type that matches what you are trying to do (i.e., use an
<insert> to insert data instead of an <update> statement, or the more generic
<statement> type), because the specific types are more descriptive, and in some
cases provide additional functionality (as is the case with <insert> and its
<selectKey> child element—which we'll cover in section 5.2).
Table 4.3 contains each type of mapped statement (and two other related
XML elements that we will discuss later) as well as some additional information
about them.
Table 4.3
Mapped statement types and related XML elements
Statement type
Attributes
Child elements
Uses
More details
<select>
id
parameterClass
resultClass
parameterMap
resultMap
cacheModel
All dynamic elements
Selecting data
Section 4.2;
chapter 8
<insert>
id
parameterClass
parameterMap
All dynamic elements
selectKey
Inserting data
Section 5.2;
chapter 8
<update>
id
parameterClass
parameterMap
All dynamic elements
Updating data
Section 5.3;
chapter 8
<delete>
id
parameterClass
parameterMap
All dynamic elements
Deleting data
Section 5.3;
chapter 8
<procedure>
id
parameterClass
resultClass
parameterMap
resultMap
xmlResultName
All dynamic elements
Calling a stored
procedure
Section 5.5;
chapter 8
Search WWH ::




Custom Search