mybatis基於註解的編寫,便可以代替mapper文件,直接在dao層接口類中加入@select…等註解進行編寫
使用mapper.xml編寫參考添加鏈接描述
使用註解編寫,mapper.xml文件便被替代了,刪掉即可,但是需要修改sqlMapConfig.xml中的映射文件
dao層接口中的註解
使用mapper.xml編寫參考添加鏈接描述
使用註解編寫,mapper.xml文件便被替代了,刪掉即可,但是需要修改sqlMapConfig.xml中的映射文件
dao層接口中的註解
不摸魚了,直接上代碼! 也參考了網上很多資料,請理解! <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</arti
下面請看一段代碼,父類(基類)SuperClass,子類(派生類)SubClass class SuperClass { private int n; SuperClass(int n) {