⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sql-map-2.dtd

📁 如图1所示
💻 DTD
字号:
<?xml version="1.0" encoding="UTF-8" ?>
 
<!--
   Copyright 2004 Clinton Begin

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 -->

<!--The root element of an iBATIS SQL Map file.
A single SQL Map XML file can contain as many cache models, parameter maps, result maps and
statements as you like. Use discretion and organize the statements and maps appropriately for your
application (group them logically).-->
<!ELEMENT sqlMap (typeAlias* | cacheModel* | resultMap* | parameterMap* | sql* | statement* | insert* | update* | delete* | select* | procedure*)+>
<!ATTLIST sqlMap
xmlns:fo CDATA #IMPLIED
namespace CDATA #IMPLIED
>

<!--The parameterMap is responsible for mapping JavaBeans properties to the parameters of a statement.
The parameterMap itself only requires a id attribute that is an identifier that statements will use to refer to it.
The class attribute is optional but highly recommended. Similar to the parameterClass attribute of a statement, 
the class attribute allows the framework to validate the incoming parameter as well as optimize the engine
for performance. The parameterMap can contain any number of parameter mappings that map directly to the
parameters of a statement.-->
<!ELEMENT parameterMap (parameter+)>
<!ATTLIST parameterMap
id CDATA #REQUIRED
class CDATA #REQUIRED
>

<!-- The <parameter> tag is used to describe the parameters of a parameterMap.-->
<!ELEMENT parameter EMPTY>
<!ATTLIST parameter
property CDATA #REQUIRED
javaType CDATA #IMPLIED
jdbcType CDATA #IMPLIED
typeName CDATA #IMPLIED
nullValue CDATA #IMPLIED
mode (IN | OUT | INOUT) #IMPLIED
typeHandler CDATA #IMPLIED
resultMap CDATA #IMPLIED
numericScale CDATA #IMPLIED
>
<!--Result maps are an extremely important component of Data Mapper. The resultMap is responsible for
mapping JavaBeans properties to the columns of a ResultSet produced by executing a query mapped
statement.
The resultMap itself has a id attribute that statements will use to refer to it. The resultMap also has a 
class attribute that is the fully qualified (i.e. full package) name of a class or a type alias. This class will 
be instantiated and populated based on the result mappings it contains. The extends attribute can be
optionally set to the name of another resultMap upon which to base a resultMap. This is similar to
extending a class in Java, all properties of the super resultMap will be included as part of the sub
resultMap. The properties of the super resultMap are always inserted before the sub resultMap
properties and the parent resultMap must be defined before the child. The classes for the super/sub
resultMaps need not be the same, nor do they need to be related at all (they can each use any class).

The resultMap element also supports the attribute groupBy. The groupBy attribute is used to specify a list
of properties in this resultMap that are used to identify unique rows in the returned result set. Rows with
equal values for the specified properties will only generate one result object. Use groupBy in combination
with nested resultMaps to solve the N+1 query problem (see following discussion for examples).

The resultMap can contain any number of result mappings that map JavaBean properties to the columns of a
ResultSet. These property mappings will be applied in the order that they are defined in the document. The
associated class must be a JavaBeans compliant class with appropriate get/set methods for each of the
properties, a Map or XML.-->
<!ELEMENT resultMap (result*, discriminator?)>
<!ATTLIST resultMap
id CDATA #REQUIRED
class CDATA #REQUIRED
extends CDATA #IMPLIED
xmlName CDATA #IMPLIED
groupBy CDATA #IMPLIED
>
<!--Results map JavaBean properties to the columns of a ResultSet. These property mappings will be applied
in the order that they are defined in the document. The associated class must be a JavaBeans compliant 
class with appropriate get/set methods for each of the properties, a Map or XML.-->
<!ELEMENT result EMPTY>
<!ATTLIST result
property CDATA #REQUIRED
javaType CDATA #IMPLIED
column CDATA #IMPLIED
columnIndex CDATA #IMPLIED
jdbcType CDATA #IMPLIED
nullValue CDATA #IMPLIED
notNullColumn CDATA #IMPLIED
select CDATA #IMPLIED
resultMap CDATA #IMPLIED
typeHandler CDATA #IMPLIED
>
<!-- TODO: add documentation. Could not find anything about this element in the official iabtis doc.-->
<!ELEMENT discriminator (subMap+)>
<!ATTLIST discriminator
javaType CDATA #REQUIRED
column CDATA #IMPLIED
columnIndex CDATA #IMPLIED
jdbcType CDATA #IMPLIED
nullValue CDATA #IMPLIED
typeHandler CDATA #IMPLIED
>
<!-- TODO: add documentation. Could not find anything about this element in the official iabtis doc. -->
<!ELEMENT subMap EMPTY>
<!ATTLIST subMap
value CDATA #REQUIRED
resultMap CDATA #REQUIRED
>
<!--A cacheModel is used to describe a cache for use with a query mapped statement. Each query mapped statement 
can use a different cacheModel, or the same one. The following example will demonstrate how it looks related to a statement:
<br><br>
&lt;cacheModel id="product-cache" type="LRU"&gt;<br>
	&lt;flushInterval hours="24"/&gt;<br>
	&lt;flushOnExecute statement="insertProduct"/&gt;<br>
	&lt;flushOnExecute statement="updateProduct"/&gt;<br>
	&lt;flushOnExecute statement="deleteProduct"/&gt;<br>
	&lt;property name=鈥漵ize鈥

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -