The label included in SQLMAP:
cachemodel>
parametermap>
resultMap>
SELECT * exoduct where prd_id =?
select>
SQLMAP>
The SQL MAP XML File
(http://www.ibatis.com/dtd/sql-map-config-2.dtd)
First, mapped statements
Mapped statements can be any SQL Statement, and can specify the MAP of the MAP and output results of the input parameters.
In simple case, Mapped Statement can specify a class directly as an input parameter and output result parameters. Mapped Statement can also use Cache Model to buffer frequently used data in memory.
[parameterclass = "some.class.name"] [Resultclass = "some.class.name"] [parametermap = "nameofparametermap"] [ResultMap = "nameofresultmap"] [cachemodel = "nameofcache"]] > Select * from product where prd_id = [? | # protyname #] Order by [$ SimpleNami] statement> In the configuration of the STATEMENT, the configuration parameters placed in [] are optional, so the following mapped statement is completely legal. INSERT INTO Product (prd_id, prd_description) Values (1, "Shih Tzu") statement> The following is described one by one, and the meaning of each label is described, and how the method is used: STATEMENT type All statements are listed in the table below, as well as their attributes and feature supported. Statement Element Attributes Child Elements Methods ParameterClass Resultclass Parametermap Resultmap Cachemodel XmlResultName All Dynamic Elements Insert Update Delete All Query Methods id ParameterClass ParameterMap All Dynamic Elements Update Delete id ParameterClass ParameterMap All Dynamic Elements insert Update Delete id ParameterClass ParameterMap All Dynamic Elements INSERT Update Delete id ParameterClass Resultclass Parametermap Resultmap Cachemodel All Dynamic Elements All Query Methods id ParameterClass Resultclass Parametermap Resultmap XmlResultname All Dynamic Elements insert Update Delete All Query Methods [parameterclass = "some.class.name"] [Resultclass = "some.class.name"] [parametermap = "nameofparametermap"] [ResultMap = "nameofresultmap"] [cachemodel = "nameofcache"]] > Select * from product where prd_id = [? | # protyname #] Order by [$ SimpleNami] statement> 2. THE SQL The SQL statement is undoubtedly the most important part of the Map, and you can use any SQL statement, as long as your database and JDBC drive support. You can also use any functions supported by the database and drive. Because you write the SQL statement in the XML document, in order to distinguish "<>" in the SQL, "<>" in XML in SQL, you can write to write. 3. Self-increased Many relational databases support from the self-increment of primary keys, SQL Map can support from Select stockidsequence.nextVal as id from dual selectKey> INSERT INTO PRODUCT (prd_id, prd_description) values (#ID #, # description #) INSERT> INSERT INTO PRODUCT (prd_description) Values (# description #) SELECT @@ identity as id selectKey> INSERT> 4. Store procedure: The stored procedure is supported by the parametermap> {CALL SWAP_EMAIL_ADDRESS (?,?)} procedure> Calling the above stored procedure switches the Email address between the two columns of the data table, and also exchanges in the corresponding parameter object. Remember: When parameter mapping Mode is inout or out, The parameter object you entered will change. Obviously, the invariant parameter object will not change, such as String objects.