Table configuration with catalog null, schema orcl, and table ORDERS did not resolve to any tables
2016-04-26 17:26
645 查看
问题:
Tableconfiguration with catalog null, schema orcl, and table ORDERS did not resolveto any tablesMyBatisGenerator finished successfully, there were warnings.
原因:
1. jdbc:oracle:thin:@11.22.22.22:1521:orcl
oracle配置的是":"
2. <jdbcConnectiondriverClass="com.mysql.jdbc.Driver"connectionURL="jdbc:Mysql://localhost:3306/DB?characterEncoding=utf8" />
3. <tabletableName="orders"domainObjectName="Orders"
enableInsert="true"
enableCountByExample="false"enableUpdateByExample="false"enableDeleteByExample="false"
enableSelectByExample="false"selectByExampleQueryId="false">
</table>
表名配置错误
问题: 去掉Example,没用看着也乱
<!-- tableName:用于自动生成代码的数据库表;domainObjectName:对应于数据库表的javaBean类名 --> <table tableName="orders" domainObjectName="Orders" enableInsert="true" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"> </table>
正常配置
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd"> <generatorConfiguration> <classPathEntry location="C:\DingSai\Work\lib_source\ojdbc14.jar" /> <context id="DB2Tables" targetRuntime="MyBatis3"> <commentGenerator> <property name="suppressAllComments" value="true" /> <!--数据库连接的信息:驱动类、连接地址、用户名、密码 --> </commentGenerator> <jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver" connectionURL="jdbc:oracle:thin:@10.199.xx.xx:1521:orcl" userId="xx" password="xx"> </jdbcConnection> <!-- 默认false,把JDBC DECIMAL 和 NUMERIC 类型解析为 Integer true,把JDBC DECIMAL 和 NUMERIC 类型解析为java.math.BigDecimal --> <javaTypeResolver> <property name="forceBigDecimals" value="false" /> </javaTypeResolver> <!-- targetProject:自动生成代码的位置 --> <javaModelGenerator targetPackage="com.soft.model" targetProject="c:\src"> <!-- enableSubPackages:是否让schema作为包的后缀 --> <property name="enableSubPackages" value="true" /> <!-- 从数据库返回的值被清理前后的空格 --> <property name="trimStrings" value="true" /> </javaModelGenerator> <!--生成SQLMAP文件 --> <sqlMapGenerator targetPackage="com.soft.model" targetProject="c:\src"> <property name="enableSubPackages" value="false" /> </sqlMapGenerator> <!--生成Dao文件 可以配置 type="XMLMAPPER"生成xml的dao实现 ANNOTATEDMAPPER 生成的对象是 MyBatis 3.x 映射器基础结构的 Java接口。 这些接口将会基于注解和 MyBatis 3.x SqlProviders。不会有XML文件生成。(注:就是纯接口使用注解的形式,不会有XML文件) ANNOTATEDMAPPER 依赖 MyBatis 3.0.4 或更高版本。; MIXEDMAPPER 生成的对象是 MyBatis 3.x 映射器基础结构的 Java接口。 这些接口将基于注解和XML的混合形式。 注解将会用在简单注解可以实现的地方。 此客户端不会生成SqlProvider,所有复杂的动态SQL都会生成在XML中。 The MIXEDMAPPER 依赖 MyBatis 3.0.4 或更高版本。; XMLMAPPER 生成的对象是 MyBatis 3.x 映射器基础结构的 Java接口。 这些接口将会依赖于生成的XML文件。; --> <javaClientGenerator type="XMLMAPPER" targetPackage="com.soft.model" targetProject="c:\src"> <property name="enableSubPackages" value="false" /> </javaClientGenerator> <!-- tableName:用于自动生成代码的数据库表;domainObjectName:对应于数据库表的javaBean类名 --> <table tableName="orders" domainObjectName="Orders" enableInsert="true" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"> </table> </context> </generatorConfiguration>
I.执行命令
java -jar C:\DingSai\Work\workspace8.5\apiportal\lib\mybatis-generator-core-1.3.2.jar -configfile C:\DingSai\Work\study\dubbo_project\edu-service-user\src\main\java\generatorConfig.xml -overwrite
全部资源下载地址:http://download.csdn.net/detail/dingsai88/9503305
相关文章推荐
- int main(int argc, char **argv)中参数argc与argv的意义
- Spark组件之Spark Streaming学习3--结合SparkSQL的使用(wordCount)
- Nginx日志切割
- Java简繁转换ZHConverter
- notepad++编辑的json文件copy到myEclipse后中文乱码
- string stringBuffer stringBuilder 区别
- [No000085]C#反射Demo,通过类名(String)创建类实例,通过方法名(String)调用方法
- 详解C语言中条件判断语句if和switch的用法
- cf665e.cpp 01 trie树求抑或
- 关于如何使用Jeesite快速开发笔记
- 【Mac工具箱】独孤九剑!一名全栈设计师的Mac工具箱(设计/开发/效率)
- 闪屏界面的实现分析
- springmvc的请求过滤器(session过期)
- 关于android使用已有id,自己的id和系统id
- redis配置密码认证
- nginx添加ip访问频率限制
- saltstack内置执行模块列表
- 关于content=”IE=edge,chrome=1″介绍-让网页优先采用Chrome渲染
- java事物隔离性和传播
- ActiveMQ高级特性:VirtualTopic