Skip to content

Commit 9d3d49a

Browse files
committed
deprecated IbatisException, replaced with PersistenceException. Implemented new DTDs into EntityResolver
1 parent bd82b37 commit 9d3d49a

File tree

79 files changed

+296
-135
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+296
-135
lines changed

NOTICE

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1-
This product includes software developed by
2-
The Apache Software Foundation (http://www.apache.org/).
1+
iBATIS
2+
This product includes software developed by
3+
The Apache Software Foundation (http://www.apache.org/).
4+
5+
Copyright 2010 The Apache Software Foundation
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
318

419
OGNL
520
//--------------------------------------------------------------------------

mybatis.iml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
4+
<output url="file://$MODULE_DIR$/target/classes" />
5+
<output-test url="file://$MODULE_DIR$/target/test-classes" />
6+
<content url="file://$MODULE_DIR$">
7+
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
8+
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
9+
<excludeFolder url="file://$MODULE_DIR$/target" />
10+
</content>
11+
<orderEntry type="inheritedJdk" />
12+
<orderEntry type="sourceFolder" forTests="false" />
13+
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.5.8" level="project" />
14+
<orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.5.8" level="project" />
15+
<orderEntry type="library" name="Maven: log4j:log4j:1.2.13" level="project" />
16+
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.1.1" level="project" />
17+
<orderEntry type="library" name="Maven: cglib:cglib:2.1_3" level="project" />
18+
<orderEntry type="library" exported="" name="Maven: asm:asm:1.5.3" level="project" />
19+
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.3.1" level="project" />
20+
<orderEntry type="library" scope="TEST" name="Maven: hsqldb:hsqldb:1.8.0.1" level="project" />
21+
<orderEntry type="library" scope="TEST" name="Maven: org.apache.derby:derby:10.3.2.1" level="project" />
22+
<orderEntry type="library" scope="TEST" name="Maven: org.jmock:jmock-junit4:2.1.0" level="project" />
23+
<orderEntry type="library" scope="TEST" name="Maven: org.jmock:jmock:2.1.0" level="project" />
24+
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-api:1.0" level="project" />
25+
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-library:1.0" level="project" />
26+
<orderEntry type="library" scope="TEST" name="Maven: org.jmock:jmock-legacy:2.1.0" level="project" />
27+
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:1.0" level="project" />
28+
<orderEntry type="library" scope="TEST" name="Maven: cglib:cglib-nodep:2.1_3" level="project" />
29+
<orderEntry type="library" scope="TEST" name="Maven: commons-dbcp:commons-dbcp:1.2.1" level="project" />
30+
<orderEntry type="library" scope="TEST" name="Maven: commons-collections:commons-collections:2.1" level="project" />
31+
<orderEntry type="library" scope="TEST" name="Maven: commons-pool:commons-pool:1.2" level="project" />
32+
<orderEntry type="library" scope="TEST" name="Maven: xml-apis:xml-apis:1.0.b2" level="project" />
33+
<orderEntry type="library" scope="TEST" name="Maven: xerces:xercesImpl:2.0.2" level="project" />
34+
<orderEntry type="library" scope="TEST" name="Maven: geronimo-spec:geronimo-spec-jta:1.0.1B-rc4" level="project" />
35+
</component>
36+
</module>
37+

src/main/java/org/apache/ibatis/binding/BindingException.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package org.apache.ibatis.binding;
22

3-
import org.apache.ibatis.exceptions.IbatisException;
3+
import org.apache.ibatis.exceptions.PersistenceException;
44

5-
public class BindingException extends IbatisException {
5+
public class BindingException extends PersistenceException {
66

77
public BindingException() {
88
super();

src/main/java/org/apache/ibatis/builder/BuilderException.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package org.apache.ibatis.builder;
22

3-
import org.apache.ibatis.exceptions.IbatisException;
3+
import org.apache.ibatis.exceptions.PersistenceException;
44

5-
public class BuilderException extends IbatisException {
5+
public class BuilderException extends PersistenceException {
66

77
public BuilderException() {
88
super();

src/main/java/org/apache/ibatis/builder/xml/XMLMapperEntityResolver.java

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,35 @@
1616
*/
1717
public class XMLMapperEntityResolver implements EntityResolver {
1818

19-
private static final String MAPPER_CONFIG_DTD_RESOURCE = "org/apache/ibatis/builder/xml/ibatis-3-config.dtd";
20-
private static final String MAPPER_DTD_RESOURCE = "org/apache/ibatis/builder/xml/ibatis-3-mapper.dtd";
21-
2219
private static final Map<String, String> doctypeMap = new HashMap<String, String>();
2320

21+
private static final String IBATIS_CONFIG_DOCTYPE = "-//ibatis.apache.org//DTD Config 3.0//EN".toUpperCase(Locale.ENGLISH);
22+
private static final String IBATIS_CONFIG_URL = "http://ibatis.apache.org/dtd/ibatis-3-config.dtd".toUpperCase(Locale.ENGLISH);
23+
24+
private static final String IBATIS_MAPPER_DOCTYPE = "-//ibatis.apache.org//DTD Mapper 3.0//EN".toUpperCase(Locale.ENGLISH);
25+
private static final String IBATIS_MAPPER_URL = "http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd".toUpperCase(Locale.ENGLISH);
26+
27+
private static final String MYBATIS_CONFIG_DOCTYPE = "-//mybatis.org//DTD Config 3.0//EN".toUpperCase(Locale.ENGLISH);
28+
private static final String MYBATIS_CONFIG_URL = "http://mybatis.org/dtd/mybatis-3-config.dtd".toUpperCase(Locale.ENGLISH);
29+
30+
private static final String MYBATIS_MAPPER_DOCTYPE = "-//mybatis.org//DTD Mapper 3.0//EN".toUpperCase(Locale.ENGLISH);
31+
private static final String MYBATIS_MAPPER_URL = "http://mybatis.org/dtd/mybatis-3-mapper.dtd".toUpperCase(Locale.ENGLISH);
32+
33+
private static final String IBATIS_CONFIG_DTD = "org/apache/ibatis/builder/xml/mybatis-3-config.dtd";
34+
private static final String IBATIS_MAPPER_DTD = "org/apache/ibatis/builder/xml/mybatis-3-mapper.dtd";
35+
2436
static {
25-
doctypeMap.put("http://ibatis.apache.org/dtd/ibatis-3-config.dtd".toUpperCase(Locale.ENGLISH), MAPPER_CONFIG_DTD_RESOURCE);
26-
doctypeMap.put("-//ibatis.apache.org//DTD Config 3.0//EN".toUpperCase(Locale.ENGLISH), MAPPER_CONFIG_DTD_RESOURCE);
37+
doctypeMap.put(IBATIS_CONFIG_URL, IBATIS_CONFIG_DTD);
38+
doctypeMap.put(IBATIS_CONFIG_DOCTYPE, IBATIS_CONFIG_DTD);
39+
40+
doctypeMap.put(IBATIS_MAPPER_URL, IBATIS_MAPPER_DTD);
41+
doctypeMap.put(IBATIS_MAPPER_DOCTYPE, IBATIS_MAPPER_DTD);
42+
43+
doctypeMap.put(MYBATIS_CONFIG_URL, IBATIS_CONFIG_DTD);
44+
doctypeMap.put(MYBATIS_CONFIG_DOCTYPE, IBATIS_CONFIG_DTD);
2745

28-
doctypeMap.put("http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd".toUpperCase(Locale.ENGLISH), MAPPER_DTD_RESOURCE);
29-
doctypeMap.put("-//ibatis.apache.org//DTD Mapper 3.0//EN".toUpperCase(Locale.ENGLISH), MAPPER_DTD_RESOURCE);
46+
doctypeMap.put(MYBATIS_MAPPER_URL, IBATIS_MAPPER_DTD);
47+
doctypeMap.put(MYBATIS_MAPPER_DOCTYPE, IBATIS_MAPPER_DTD);
3048
}
3149

3250
/**

src/main/java/org/apache/ibatis/cache/CacheException.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package org.apache.ibatis.cache;
22

3-
import org.apache.ibatis.exceptions.IbatisException;
3+
import org.apache.ibatis.exceptions.PersistenceException;
44

5-
public class CacheException extends IbatisException {
5+
public class CacheException extends PersistenceException {
66

77
public CacheException() {
88
super();

src/main/java/org/apache/ibatis/datasource/DataSourceException.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package org.apache.ibatis.datasource;
22

3-
import org.apache.ibatis.exceptions.IbatisException;
3+
import org.apache.ibatis.exceptions.PersistenceException;
44

5-
public class DataSourceException extends IbatisException {
5+
public class DataSourceException extends PersistenceException {
66

77
public DataSourceException() {
88
super();

src/main/java/org/apache/ibatis/exceptions/ExceptionFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
public class ExceptionFactory {
66

77
public static RuntimeException wrapException(String message, Exception e) {
8-
return new IbatisException(ErrorContext.instance().message(message).cause(e).toString(), e);
8+
return new PersistenceException(ErrorContext.instance().message(message).cause(e).toString(), e);
99
}
1010

1111
}

0 commit comments

Comments
 (0)