Skip to content

Commit abd1264

Browse files
committed
added dtd from ibatis.org and config to use during transform for those unlucky enough to not be able to access internet without significant difficulty :(
1 parent f692aa0 commit abd1264

13 files changed

+2086
-3
lines changed

build.xml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@
2121
<fileset dir="destination" includes="*.xml"/>
2222
</delete>
2323
<!-- xslt convert sqlMaps 2 to mybatis 3 -->
24-
<xslt basedir="source" style="migrate.xslt" includes="*.xml" destdir="destination" extension=".xml"/>
24+
<xslt basedir="source" style="migrate.xslt" includes="*.xml" destdir="destination" extension=".xml">
25+
<xmlcatalog>
26+
<dtd publicId="-//ibatis.apache.org//DTD SQL Map 2.0//EN" location="dtd/sql-map-2.dtd"/>
27+
<dtd publicId="-//www.ibatis.com//DTD SQL Map 2.0//EN" location="dtd/sql-map-2.dtd"/>
28+
</xmlcatalog>
29+
30+
</xslt>
2531
<!-- replace #id:NUMERIC# to #id,jdbcType=NUMERIC# etc. -->
2632
<replace dir="destination" includes="*.xml" token=":NUMERIC#" value=",jdbcType=NUMERIC#" encoding="UTF8"/>
2733
<replace dir="destination" includes="*.xml" token=":TIMESTAMP#" value=",jdbcType=TIMESTAMP#" encoding="UTF8"/>
@@ -47,8 +53,8 @@
4753
<attribute name="http://apache.org/xml/features/validation/schema" value="false" />
4854
<attribute name="http://xml.org/sax/features/namespaces" value="false" />
4955
<fileset dir="destination" includes="*.xml" />
50-
<dtd publicId="-//mybatis.org//DTD SQL Map Config 3.0//EN" location="mybatis-3-config.dtd" />
51-
<dtd publicId="-//mybatis.org//DTD Mapper 3.0//EN" location="mybatis-3-mapper.dtd" />
56+
<dtd publicId="-//mybatis.org//DTD SQL Map Config 3.0//EN" location="dtd/mybatis-3-config.dtd" />
57+
<dtd publicId="-//mybatis.org//DTD Mapper 3.0//EN" location="dtd/mybatis-3-mapper.dtd" />
5258
</xmlvalidate>
5359

5460
</target>

dtd/abator-config_1_0.dtd

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!--
4+
Copyright 2006 The Apache Software Foundation
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
-->
18+
19+
<!--
20+
This DTD defines the structure of the Abator for iBATIS configuration file.
21+
Abator configuration files should declare the DOCTYPE as follows:
22+
23+
<!DOCTYPE abatorConfiguration PUBLIC
24+
"-//Apache Software Foundation//DTD Abator for iBATIS Configuration 1.0//EN"
25+
"http://ibatis.apache.org/dtd/abator-config_1_0.dtd">
26+
27+
Please see the documentation included with Abator for details on each option
28+
in the DTD. You may also view documentation on-line here:
29+
30+
http://ibatis.apache.org/docs/tools/abator
31+
32+
-->
33+
34+
<!--
35+
The abatorConfiguration element is the root element for Abator configurations.
36+
-->
37+
<!ELEMENT abatorConfiguration (properties?, abatorContext+)>
38+
39+
<!--
40+
The properties element is used to define a standard Java properties file
41+
that contains placeholders for use in the remainder of the configuration
42+
file.
43+
-->
44+
<!ELEMENT properties EMPTY>
45+
<!ATTLIST properties
46+
resource CDATA #IMPLIED
47+
url CDATA #IMPLIED>
48+
49+
<!--
50+
The abatorContext element is used to describe a context for generating files, and the source
51+
tables.
52+
-->
53+
<!ELEMENT abatorContext (property*, commentGenerator?, jdbcConnection, javaTypeResolver?, javaModelGenerator,
54+
sqlMapGenerator, daoGenerator?, table+)>
55+
<!ATTLIST abatorContext id ID #IMPLIED
56+
defaultModelType CDATA #IMPLIED
57+
generatorSet CDATA #IMPLIED>
58+
59+
<!--
60+
The jdbcConnection element is used to describe the JDBC connection that Abator
61+
will use to introspect the database.
62+
-->
63+
<!ELEMENT jdbcConnection (classPathEntry*, property*)>
64+
<!ATTLIST jdbcConnection
65+
driverClass CDATA #REQUIRED
66+
connectionURL CDATA #REQUIRED
67+
userId CDATA #IMPLIED
68+
password CDATA #IMPLIED>
69+
70+
<!--
71+
The classPathEntry element is used to add the JDBC driver to the run-time classpath.
72+
Repeat this element as often as needed to add elements to the classpath.
73+
-->
74+
<!ELEMENT classPathEntry EMPTY>
75+
<!ATTLIST classPathEntry
76+
location CDATA #REQUIRED>
77+
78+
<!--
79+
The property element is used to add custom properties to many of Abator's
80+
configuration elements. See each element for example properties.
81+
Repeat this element as often as needed to add as many properties as necessary
82+
to the configuration element.
83+
-->
84+
<!ELEMENT property EMPTY>
85+
<!ATTLIST property
86+
name CDATA #REQUIRED
87+
value CDATA #REQUIRED>
88+
89+
<!--
90+
The javaModelGenerator element is used to define properties of the Java Model Generator.
91+
The Java Model Generator builds primary key classes, record classes, and Query by Example
92+
indicator classes.
93+
-->
94+
<!ELEMENT javaModelGenerator (property*)>
95+
<!ATTLIST javaModelGenerator
96+
type CDATA #IMPLIED
97+
targetPackage CDATA #REQUIRED
98+
targetProject CDATA #REQUIRED>
99+
100+
<!--
101+
The javaTypeResolver element is used to define properties of the Java Type Resolver.
102+
The Java Type Resolver is used to calculate Java types from database column information.
103+
The default Java Type Resolver attempts to make JDBC DECIMAL and NUMERIC types easier
104+
to use by substituting Integral types if possible (Long, Integer, Short, etc.)
105+
-->
106+
<!ELEMENT javaTypeResolver (property*)>
107+
<!ATTLIST javaTypeResolver
108+
type CDATA #IMPLIED>
109+
110+
<!--
111+
The sqlMapGenerator element is used to define properties of the SQL Map Generator.
112+
The SQL Map Generator builds an XML file for each table that conforms to iBATIS'
113+
SqlMap DTD.
114+
-->
115+
<!ELEMENT sqlMapGenerator (property*)>
116+
<!ATTLIST sqlMapGenerator
117+
type CDATA #IMPLIED
118+
targetPackage CDATA #REQUIRED
119+
targetProject CDATA #REQUIRED>
120+
121+
<!--
122+
The daoGenerator element is used to define properties of the DAO Generator.
123+
The DAO Generator builds DAO an interface and implementation class for each table.
124+
If this element is missing, then Abator will not build DAO classes.
125+
-->
126+
<!ELEMENT daoGenerator (property*)>
127+
<!ATTLIST daoGenerator
128+
type CDATA #REQUIRED
129+
targetPackage CDATA #REQUIRED
130+
targetProject CDATA #REQUIRED>
131+
132+
<!--
133+
The table element is used to specify a database table that will be the source information
134+
for a set of generated objects.
135+
-->
136+
<!ELEMENT table (property*, generatedKey?, columnRenamingRule?, (columnOverride | ignoreColumn)*) >
137+
<!ATTLIST table
138+
catalog CDATA #IMPLIED
139+
schema CDATA #IMPLIED
140+
tableName CDATA #REQUIRED
141+
alias CDATA #IMPLIED
142+
domainObjectName CDATA #IMPLIED
143+
enableInsert CDATA #IMPLIED
144+
enableSelectByPrimaryKey CDATA #IMPLIED
145+
enableSelectByExample CDATA #IMPLIED
146+
enableUpdateByPrimaryKey CDATA #IMPLIED
147+
enableDeleteByPrimaryKey CDATA #IMPLIED
148+
enableDeleteByExample CDATA #IMPLIED
149+
enableCountByExample CDATA #IMPLIED
150+
enableUpdateByExample CDATA #IMPLIED
151+
selectByPrimaryKeyQueryId CDATA #IMPLIED
152+
selectByExampleQueryId CDATA #IMPLIED
153+
modelType CDATA #IMPLIED
154+
escapeWildcards CDATA #IMPLIED
155+
delimitIdentifiers CDATA #IMPLIED>
156+
157+
<!--
158+
The columnOverride element is used to change certain attributes of the column
159+
from their default values.
160+
-->
161+
<!ELEMENT columnOverride EMPTY>
162+
<!ATTLIST columnOverride
163+
column CDATA #REQUIRED
164+
property CDATA #IMPLIED
165+
javaType CDATA #IMPLIED
166+
jdbcType CDATA #IMPLIED
167+
typeHandler CDATA #IMPLIED
168+
delimitedColumnName CDATA #IMPLIED>
169+
170+
<!--
171+
The ignoreColumn element is used to identify a column that should be ignored.
172+
No generated SQL will refer to the column, and no property will be generated
173+
for the column in the model objects.
174+
-->
175+
<!ELEMENT ignoreColumn EMPTY>
176+
<!ATTLIST ignoreColumn
177+
column CDATA #REQUIRED
178+
delimitedColumnName CDATA #IMPLIED>
179+
180+
<!--
181+
The generatedKey element is used to identify a column in the table whose value
182+
is calculated - either from a sequence (or some other query), or as an identity column.
183+
-->
184+
<!ELEMENT generatedKey EMPTY>
185+
<!ATTLIST generatedKey
186+
column CDATA #REQUIRED
187+
sqlStatement CDATA #REQUIRED
188+
identity CDATA #IMPLIED
189+
type CDATA #IMPLIED>
190+
191+
<!--
192+
The columnRenamingRule element is used to specify a rule for renaming
193+
columns before the corresponding property name is calculated
194+
-->
195+
<!ELEMENT columnRenamingRule EMPTY>
196+
<!ATTLIST columnRenamingRule
197+
searchString CDATA #REQUIRED
198+
replaceString CDATA #IMPLIED>
199+
200+
<!--
201+
The commentGenerator element is used to define properties of the Comment Generator.
202+
The Comment Generator adds comments to generated elements.
203+
-->
204+
<!ELEMENT commentGenerator (property*)>
205+
<!ATTLIST commentGenerator
206+
type CDATA #IMPLIED>
207+

dtd/dao-2.dtd

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!ELEMENT daoConfig (properties? , context+)>
3+
4+
<!ELEMENT context (transactionManager, dao*)+>
5+
<!ATTLIST context
6+
id CDATA #IMPLIED
7+
>
8+
9+
<!ELEMENT properties EMPTY>
10+
<!ATTLIST properties
11+
resource CDATA #IMPLIED
12+
url CDATA #IMPLIED
13+
>
14+
15+
<!ELEMENT transactionManager (property*)>
16+
<!ATTLIST transactionManager
17+
type CDATA #REQUIRED
18+
>
19+
20+
<!ELEMENT property EMPTY>
21+
<!ATTLIST property
22+
name CDATA #REQUIRED
23+
value CDATA #REQUIRED
24+
>
25+
26+
<!ELEMENT dao EMPTY>
27+
<!ATTLIST dao
28+
interface CDATA #REQUIRED
29+
implementation CDATA #REQUIRED
30+
>

dtd/dao.dtd

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!ELEMENT dao-config (properties? , context+)>
3+
<!ELEMENT context (transaction-pool?, dao-factory, extra-properties?)+>
4+
<!ATTLIST context
5+
name ID #REQUIRED
6+
default (true | false) #IMPLIED
7+
>
8+
<!ELEMENT properties EMPTY>
9+
<!ATTLIST properties
10+
resource CDATA #REQUIRED
11+
>
12+
<!ELEMENT transaction-pool (property*)>
13+
<!ATTLIST transaction-pool
14+
implementation CDATA #REQUIRED
15+
>
16+
<!ELEMENT dao-factory (dao*)>
17+
<!ELEMENT dao EMPTY>
18+
<!ATTLIST dao
19+
name CDATA #REQUIRED
20+
implementation CDATA #REQUIRED
21+
>
22+
<!ELEMENT extra-properties (property*)>
23+
<!ELEMENT property EMPTY>
24+
<!ATTLIST property
25+
name CDATA #REQUIRED
26+
value CDATA #REQUIRED
27+
>

dtd/ibatis-3-config.dtd

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
3+
<!ELEMENT configuration (properties?, settings?, typeAliases?, typeHandlers?, objectFactory?, plugins?, environments?, mappers?)>
4+
5+
<!ELEMENT properties (property*)>
6+
<!ATTLIST properties
7+
resource CDATA #IMPLIED
8+
url CDATA #IMPLIED
9+
>
10+
11+
<!ELEMENT property EMPTY>
12+
<!ATTLIST property
13+
name CDATA #REQUIRED
14+
value CDATA #REQUIRED
15+
>
16+
17+
<!ELEMENT settings (setting+)>
18+
19+
<!ELEMENT setting EMPTY>
20+
<!ATTLIST setting
21+
name CDATA #REQUIRED
22+
value CDATA #REQUIRED
23+
>
24+
25+
<!ELEMENT typeAliases (typeAlias+)>
26+
27+
<!ELEMENT typeAlias EMPTY>
28+
<!ATTLIST typeAlias
29+
type CDATA #REQUIRED
30+
alias CDATA #IMPLIED
31+
>
32+
33+
<!ELEMENT typeHandlers (typeHandler+)>
34+
35+
<!ELEMENT typeHandler EMPTY>
36+
<!ATTLIST typeHandler
37+
javaType CDATA #REQUIRED
38+
jdbcType CDATA #IMPLIED
39+
handler CDATA #REQUIRED
40+
>
41+
42+
<!ELEMENT objectFactory (property*)>
43+
<!ATTLIST objectFactory
44+
type CDATA #REQUIRED
45+
>
46+
47+
<!ELEMENT plugins (plugin+)>
48+
49+
<!ELEMENT plugin (property*)>
50+
<!ATTLIST plugin
51+
interceptor CDATA #REQUIRED
52+
>
53+
54+
<!ELEMENT environments (environment+)>
55+
<!ATTLIST environments
56+
default CDATA #REQUIRED
57+
>
58+
59+
<!ELEMENT environment (transactionManager,dataSource)>
60+
<!ATTLIST environment
61+
id CDATA #REQUIRED
62+
>
63+
64+
<!ELEMENT transactionManager (property*)>
65+
<!ATTLIST transactionManager
66+
type CDATA #REQUIRED
67+
>
68+
69+
<!ELEMENT dataSource (property*)>
70+
<!ATTLIST dataSource
71+
type CDATA #REQUIRED
72+
>
73+
74+
<!ELEMENT mappers (mapper+)>
75+
76+
<!ELEMENT mapper EMPTY>
77+
<!ATTLIST mapper
78+
resource CDATA #IMPLIED
79+
url CDATA #IMPLIED
80+
>

0 commit comments

Comments
 (0)