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 * fromnewschema.stu_tab ]]> </select> </mapper> |
版权声明:本文为u010770993原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。