Browse Source

处理依赖.

聂秋荣 7 years ago
parent
commit
68eb971360

+ 0 - 4
build.gradle

@@ -91,10 +91,6 @@ subprojects{
         archives javadocJar
     }
 
-    configurations {
-        compile.exclude module: "commons-logging"
-    }
-
     signing {
         sign configurations.archives
     }

+ 12 - 7
mybatis-plus-api/src/main/java/com/baomidou/mybatisplus/toolkit/SqlUtils.java

@@ -16,6 +16,7 @@
 package com.baomidou.mybatisplus.toolkit;
 
 import com.baomidou.mybatisplus.enums.SqlLike;
+import com.baomidou.mybatisplus.exceptions.MybatisPlusException;
 import com.baomidou.mybatisplus.plugins.parser.ISqlParser;
 import com.baomidou.mybatisplus.plugins.parser.SqlInfo;
 import com.baomidou.mybatisplus.plugins.pagination.Pagination;
@@ -33,7 +34,15 @@ public class SqlUtils {
     private final static SqlFormatter sqlFormatter = new SqlFormatter();
     public final static String SQL_BASE_COUNT = "SELECT COUNT(1) FROM ( %s ) TOTAL";
     public static ISqlParser COUNT_SQL_PARSER = null;
+    private static Class<ISqlParser> DEFAULT_CLASS = null;
 
+    static {
+        try {
+            DEFAULT_CLASS = (Class<ISqlParser>) Class.forName("com.baomidou.mybatisplus.plugins.pagination.optimize.JsqlParserCountOptimize");
+        } catch (ClassNotFoundException e) {
+            //skip
+        }
+    }
     /**
      * <p>
      * 获取CountOptimize
@@ -53,13 +62,9 @@ public class SqlUtils {
                 // 默认 JsqlParser 优化 COUNT
                 try {
                     // TODO: 2017/11/20 这里我改动了下.
-                    COUNT_SQL_PARSER = (ISqlParser) Class.forName("com.baomidou.mybatisplus.plugins.pagination.optimize.JsqlParserCountOptimize").newInstance();
-                } catch (InstantiationException e) {
-                    e.printStackTrace();
-                } catch (IllegalAccessException e) {
-                    e.printStackTrace();
-                } catch (ClassNotFoundException e) {
-                    e.printStackTrace();
+                    COUNT_SQL_PARSER =  DEFAULT_CLASS.newInstance();
+                } catch (Exception e) {
+                    throw new MybatisPlusException(e);
                 }
             }
         }

+ 0 - 1
mybatis-plus-core/build.gradle

@@ -25,7 +25,6 @@ dependencies {
     testCompile rootProject.ext.dependencies["spring-webmvc"]
     testCompile rootProject.ext.dependencies["sqlserver"]
     testCompile rootProject.ext.dependencies["aspectjweaver"]
-    testCompile rootProject.ext.dependencies["servlet-api"]
     testCompile rootProject.ext.dependencies["lombok"]
     testCompile rootProject.ext.dependencies["hikaricp"]
 }

+ 0 - 40
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/generator/config/ITypeConvert.java

@@ -1,40 +0,0 @@
-/**
- * Copyright (c) 2011-2016, hubin (jobob@qq.com).
- * <p>
- * 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
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * 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.
- */
-package com.baomidou.mybatisplus.generator.config;
-
-import com.baomidou.mybatisplus.generator.config.rules.DbColumnType;
-
-/**
- * <p>
- * 数据库字段类型转换
- * </p>
- *
- * @author hubin
- * @date 2017-01-20
- */
-public interface ITypeConvert {
-
-    /**
-     * <p>
-     * 执行类型转换
-     * </p>
-     *
-     * @param fieldType 字段类型
-     * @return
-     */
-    DbColumnType processTypeConvert(String fieldType);
-
-}

+ 5 - 0
mybatis-plus/build.gradle

@@ -0,0 +1,5 @@
+dependencies{
+    compile project(":mybatis-plus-api")
+    compile project(":mybatis-plus-core")
+    compile project(":mybatis-plus-generate")
+}

+ 1 - 0
settings.gradle

@@ -1,4 +1,5 @@
 rootProject.name = 'mybatis-plus'
+include 'mybatis-plus'
 include 'mybatis-plus-api'
 include 'mybatis-plus-core'
 include 'mybatis-plus-generate'