MyBatis与Hibernate更改schema的方式
(2016-12-06 16:49:40)
Hibernate需要在xml文件里面注释~~
<?xml
version="1.0"?>
<!DOCTYPE
hibernate-mapping SYSTEM
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
</hibernate-mapping>
|
Mybatis因为本来就是SQL语句,所以直接在SQL里面加就可以啦~~
<?xml
version="1.0"
encoding="UTF-8"
?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper
3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace="table.student.Student2Mapper">
<resultMap
type="StudentEntity2"
id="studentResultMap">
<id
property="id"
column="stu_id"/>
<result
property="name"
column="stu_name"/>
<result
property="age"
column="stu_age"/>
</resultMap>
<select
id="getStudentAll"
<![CDATA[
SELECT * from newschema.stu_tab
]]>
</select>
</mapper>
|