Skip to content

Commit 942cc2c

Browse files
author
javaage
committed
modify mybatis
1 parent f37e97b commit 942cc2c

File tree

3 files changed

+29
-9
lines changed

3 files changed

+29
-9
lines changed

flexible/postgres/src/main/java/com/cisco/la/UserServlet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOExc
6161
@Override
6262
public void init() throws ServletException {
6363
try{
64-
String resource = "org/mybatis/builder/mybatis-config.xml";
64+
String resource = "mybatis-config.xml";
6565
InputStream inputStream = Resources.getResourceAsStream(resource);
6666
SqlSessionFactoryBuilder builder = new SqlSessionFactoryBuilder();
6767
SqlSessionFactory factory = builder.build(inputStream);

flexible/postgres/src/main/resources/generatorConfig.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,5 @@
6161
<columnOverride column="USR_RL_NAME" property="roleName" />
6262
<columnOverride column="USR_ACTIVE" property="active" />
6363
</table>
64-
<!--
65-
<table schema="public" tableName="wms_speed" domainObjectName="SpeedModel">
66-
<generatedKey column="wm_speed_id" sqlStatement="SELECT nextval('wms_speed_wm_speed_id_seq')" identity="true"/>
67-
<columnOverride column="wm_speed_id" property="id" javaType="int"/>
68-
<columnOverride column="wm_speed" property="speed" />
69-
<columnOverride column="wm_time" property="time" />
70-
</table>
71-
-->
7264
</context>
7365
</generatorConfiguration>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
3+
"http://mybatis.org/dtd/mybatis-3-config.dtd">
4+
<configuration>
5+
<typeAliases>
6+
<!--
7+
<typeAlias alias="User" type="cn.hncu.domain.User" />
8+
<typeAlias alias="Person" type="cn.hncu.domain.Person" />
9+
-->
10+
</typeAliases>
11+
<environments default="development">
12+
<environment id="development">
13+
<transactionManager type="JDBC" />
14+
<dataSource type="POOLED">
15+
<property name="driver" value="org.postgresql.Driver" />
16+
<property name="url"
17+
value="jdbc:postgresql://localhost:5432/la" />
18+
<property name="username" value="postgres" />
19+
<property name="password" value="19786028" />
20+
<property name="poolMaximumActiveConnections" value="5" />
21+
</dataSource>
22+
</environment>
23+
</environments>
24+
<mappers>
25+
<mapper resource="com/cisco/la/mapper/UserModelMapper.xml" />
26+
</mappers>
27+
28+
</configuration>

0 commit comments

Comments
 (0)