Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/mybatis-generator-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<configuration>
<skipDeploy>false</skipDeploy>
<skip>false</skip>
<locales>en,zh_CN</locales>
</configuration>
</plugin>
<!-- create the Source JAR and JavaDoc a bit earlier so it is ready for the assembly -->
Expand Down
95 changes: 95 additions & 0 deletions core/mybatis-generator-core/src/site/site_zh.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright 2006-2022 the original author or authors.

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.

-->
<project xmlns="http://maven.apache.org/DECORATION/1.8.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/DECORATION/1.8.0 http://maven.apache.org/xsd/decoration-1.8.0.xsd"
name="${project.name}">

<bannerLeft>
<name>MyBatis 生成器</name>
<href>index.html</href>
</bannerLeft>

<body>
<menu name="User's Guide">
<item href="index.html" name="简介" />
<item href="whatsNew.html" name="What's New?" />
<item href="quickstart.html" name="快速入门指南" />
<item href="running/running.html" name="运行 MyBatis Generator" collapse="true">
<item href="running/runningFromCmdLine.html" name="从命令行运行" />
<item href="running/runningWithAnt.html" name="使用 Ant" />
<item href="running/runningWithMaven.html" name="使用 Maven" />
<item href="running/runningWithJava.html" name="使用 Java" />
<item href="running/runningWithEclipse.html" name="使用 Eclipse" />
</item>
<item href="afterRunning.html" name="运行 MyBatis Generator 以后" />
<item href="migratingFromIbator.html" name="从 Ibator 迁移" />
<item href="migratingFromAbator.html" name="从 Abator 迁移" />
<item href="configreference/xmlconfig.html" name="XML 配置参考" collapse="true" >
<item href="configreference/classPathEntry.html" name="&amp;lt;classPathEntry&amp;gt;" />
<item href="configreference/columnOverride.html" name="&amp;lt;columnOverride&amp;gt;" />
<item href="configreference/columnRenamingRule.html" name="&amp;lt;columnRenamingRule&amp;gt;" />
<item href="configreference/commentGenerator.html" name="&amp;lt;commentGenerator&amp;gt;" />
<item href="configreference/connectionFactory.html" name="&amp;lt;connectionFactory&amp;gt;" />
<item href="configreference/context.html" name="&amp;lt;context&amp;gt;" />
<item href="configreference/domainObjectRenamingRule.html" name="&amp;lt;domainObjectRenamingRule&amp;gt;" />
<item href="configreference/except.html" name="&amp;lt;except&amp;gt;" />
<item href="configreference/generatedKey.html" name="&amp;lt;generatedKey&amp;gt;" />
<item href="configreference/generatorConfiguration.html" name="&amp;lt;generatorConfiguration&amp;gt;" />
<item href="configreference/ignoreColumn.html" name="&amp;lt;ignoreColumn&amp;gt;" />
<item href="configreference/ignoreColumnsByRegex.html" name="&amp;lt;ignoreColumnsByRegex&amp;gt;" />
<item href="configreference/javaClientGenerator.html" name="&amp;lt;javaClientGenerator&amp;gt;" />
<item href="configreference/javaModelGenerator.html" name="&amp;lt;javaModelGenerator&amp;gt;" />
<item href="configreference/javaTypeResolver.html" name="&amp;lt;javaTypeResolver&amp;gt;" />
<item href="configreference/jdbcConnection.html" name="&amp;lt;jdbcConnection&amp;gt;" />
<item href="configreference/plugin.html" name="&amp;lt;plugin&amp;gt;" />
<item href="configreference/properties.html" name="&amp;lt;properties&amp;gt;" />
<item href="configreference/property.html" name="&amp;lt;property&amp;gt;" />
<item href="configreference/sqlMapGenerator.html" name="&amp;lt;sqlMapGenerator&amp;gt;" />
<item href="configreference/table.html" name="&amp;lt;table&amp;gt;" />
</item>
<item href="generatedobjects/results.html" name="使用生成的对象" collapse="true" >
<item href="generatedobjects/dynamicSql.html" name="使用 MyBatis 动态 SQL" />
<item href="generatedobjects/dynamicSqlKotlin.html" name="使用 MyBatis 动态 SQL" />
<item href="generatedobjects/legacy.html" name="遗留的生成器">
<item href="generatedobjects/javamodel.html" name="Java 模型对象" />
<item href="generatedobjects/sqlmap.html" name="SQL 映射文件" />
<item href="generatedobjects/javaclient.html" name="Java Client 对象" />
<item href="generatedobjects/exampleClassUsage.html" name="使用 Example Class" />
<item href="generatedobjects/extendingExampleClass.html" name="继承 Example Classes" />
</item>
</item>
<item href="usage/intro.html" name="指定数据库信息" collapse="true" >
<item href="usage/db2.html" name="DB2" />
<item href="usage/mysql.html" name="MySql" />
<item href="usage/oracle.html" name="Oracle" />
<item href="usage/postgresql.html" name="PostgreSQL" />
</item>
<item href="reference/intro.html" name="其他参考信息" collapse="true" >
<item href="reference/building.html" name="从源码构建" />
<item href="reference/extending.html" name="继承 MyBatis Generator" />
<item href="reference/pluggingIn.html" name="实现插件" />
<item href="reference/logging.html" name="日志信息" />
<item href="reference/plugins.html" name="已应用的插件" />
<item href="philosophy.html" name="设计哲学" />
</item>
</menu>

<menu ref="reports"/>
</body>
</project>
17 changes: 17 additions & 0 deletions core/mybatis-generator-core/src/site/zh/resources/css/site.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Copyright 2006-2017 the original author or authors.
*
* 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.
*/
#leftColumn {width: 20%}
#bodyColumn {width:75%}
18 changes: 18 additions & 0 deletions core/mybatis-generator-core/src/site/zh/resources/mbgstyle.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Copyright 2006-2016 the original author or authors.
*
* 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.
*/
/* custom stylesheet - used to override any maven style, and as a placeholder
* for the eclipse help stylesheet
*/
74 changes: 74 additions & 0 deletions core/mybatis-generator-core/src/site/zh/xhtml/afterRunning.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright 2006-2019 the original author or authors.

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.

-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>运行 MyBatis Generator 之后</title>
<link rel="stylesheet" type="text/css" href="mbgstyle.css" />
</head>
<body>
<h1>运行 MyBatis Generator 之后</h1>
<p>运行 MyBatis Generator 之后,你需要创建或修改其他 MyBatis 配置文件。主要任务是创建或修改 MapperConfig.xml 文件。</p>

<h2>更新 MapperConfig.xml 文件(MyBatis 3.x)</h2>
<p>MyBatis 3.x 使用XML文件,通常命名为 <code>MapperConfig.xml</code>,
来指定将在 MyBatis 会话中使用的数据库连接、事务管理方案和 XML 映射器文件的信息。MBG 无法为你创建此文件,因为它对你的执行环境一无所知。但是,此文件中的某些配置直接与 MBG 生成的项目相关。有关不同配置选项的详细信息,请参阅 MyBatis 的相关文档。</p>

<p>MBG 配置文件中的具体需求如下:</p>
<ul>
<li>MBG 必须列出生成的 XML 映射器文件</li>
</ul>

<p>例如,假设MBG生成了一个名为
<code>MyTableMapper.xml</code> 的文件,并且文件已放置在
<code>test.xml</code> 的包中,<code>MapperConfig.xml</code> 文件应具有以下条目:</p>
<pre>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd"&gt;

&lt;configuration&gt;
&lt;!-- Setup the transaction manager and data source that are
appropriate for your environment
--&gt;
&lt;environments default"..."&gt;
&lt;environment id"..."&gt;
&lt;transactionManager type="..."&gt;
&lt;/transactionManager&gt;
&lt;dataSource type="..."&gt;
&lt;/dataSource&gt;
&lt;/environment&gt;
&lt;/environments&gt;

&lt;mappers&gt;
&lt;!-- XML mapper files should be listed here --&gt;
&lt;mapper resource="test/xml/MyTable_SqlMap.xml" /&gt;
&lt;/mappers&gt;

&lt;/configuration&gt;
</pre>

<p>如果有多个 XML 映射器文件(这很常见),则文件可以在 <code>&lt;mappers&gt;</code> 里面使用 <code>&lt;mapper&gt;</code> 以任意顺序列出。</p>

<p>如果你使用基于 Java 的配置或 Spring,则需要以合适方式注册映射器。</p>

</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright 2006-2016 the original author or authors.

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.

-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>The &lt;classPathEntry&gt; Element</title>
<link rel="stylesheet" type="text/css" href="../mbgstyle.css" />
</head>
<body>
<h1>The &lt;classPathEntry&gt; Element</h1>
<p>The &lt;classPathEntry&gt; element is used to add classpath locations to the
classpath of the MyBatis Generator (MBG) run. The &lt;classPathEntry&gt; element is an option child
element of the <a href="generatorConfiguration.html">&lt;generatorConfiguration&gt;</a> element.
MBG loads classes from these locations in these instances:</p>
<ul>
<li>When loading the JDBC driver for database introspection</li>
<li>When loading root classes in the JavaModelGenerator to check for overridden
methods</li>
</ul>

<p>This element is optional and is not required if you setup the classpath externally to MBG
(e.g. with the <code>-cp</code> argument of the <code>java</code> command</p>

<p><b>Important Note:</b> these locations are NOT used when loading classes that
extend one of MBG's classes or implement one of MBG's interfaces. In those cases
you must add your external classes to the runtime classpath in the same way you
add MBG to the classpath (e.g. with the <code>-cp</code> argument of the
<code>java</code> command).</p>

<h2>Required Attributes</h2>
<table border="1" cellspacing="0" cellpadding="5">
<tr>
<th>Attribute</th>
<th>Description</th>
</tr>
<tr>
<td>location</td>
<td>The full path name of a JAR/ZIP file to add to the classpath, or
a directory to add to the classpath.</td>
</tr>
</table>

<h2>Optional Attributes</h2>
<p>None</p>

<h2>Child Elements</h2>
<p>None</p>


<h2>Example</h2>
<p>This element specifies the location of a DB2 JDBC driver:</p>
<pre>
&lt;classPathEntry location="/Program Files/IBM/SQLLIB/java/db2java.zip" /&gt;
</pre>
</body>
</html>
Loading