【Mybaits】如何在xxMapper.xml中的SQL语句里加入代码注释
还得使用XML注释<!-- Comments --> ,SQL注释--.Java注释 // /* */都会导致错误。
如:
<mapper namespace="com.hy.dao.CompanyMapper"> <select id="fetchOne" resultMap="map1"> select <!-- fields --> c.id as cid,c.name as cname,e.id as eid,e.name as ename from <!-- tables --> company c,emp e where <!-- conditions --> c.id=e.cid and c.id=#{id} </select> ...... </mapper>
END