轉載自http://blog.csdn.net/wyswlp/article/details/8957878
XML Parser Error on line 13: XML 文檔結構必須從頭至尾包含在同一個實體內。
貌似設定檔不能加註釋。
Unexpected error while running MyBatis Generator. Exception getting JDBC Driver
查閱generator官方文檔發現指定Jar包路徑即可
<classPathEntry location="D:/Dev/j2eeDev/jar/mysql-connector-java-5.1.24/mysql-connector-java-5.1.24/mysql-connector-java-5.1.24-bin.jar" />
eneration Warnings Occured Table configuration with catalog null, schema null, and table T_LOGIN did not resolve to any tables
忘了建表,資料庫中沒表當然解析不了.........建立表,解析成功,毫無壓力
增加分頁支援
首先在Example對象裡面加入兩個整形變數start和limit,start代表起始索引,limit代表數量,然後產生對應的get/set方法,使MyBatis在執行的時候能夠擷取相應的值.
第二部就是修改Mapper了,在selectByExample裡面加入對Example對象中start和limit的判斷,如果start和limit不同時為0,則自動在sql的最後加入分頁條件,以下是需要加入的xml代碼,記得加在selectByExample這個sql的最後面,也就是排序的後面
<if test="start !=0 or limit!=0"> limit #{start},#{limit} </if>