Forráskód Böngészése

Merge branch 'dev'

jobob 8 éve
szülő
commit
e08ad77b75

+ 1 - 1
mybatis-plus/src/main/java/com/baomidou/mybatisplus/activerecord/Record.java

@@ -80,7 +80,7 @@ public class Record {
 	public static TableInfo table(Class<?> clazz) {
 		TableInfo tableInfo = TableInfoHelper.getTableInfo(clazz);
 		if (null == tableInfo) {
-			throw new MybatisPlusException("Error: Cannot execute insertBatch Method, ClassGenricType not found .");
+			throw new MybatisPlusException("Error: Cannot execute table Method, ClassGenricType not found .");
 		}
 		return tableInfo;
 	}

+ 1 - 1
mybatis-plus/src/main/java/com/baomidou/mybatisplus/mapper/DBType.java

@@ -63,7 +63,7 @@ public enum DBType {
 	/**
 	 * UNKONWN DB
 	 */
-	OTHER("other", "SQLServer数据库");
+	OTHER("other", "其他数据库");
 
 	private final String db;
 

+ 8 - 5
mybatis-plus/src/main/java/com/baomidou/mybatisplus/plugins/pagination/Pagination.java

@@ -121,10 +121,6 @@ public class Pagination extends RowBounds implements Serializable {
 
 	public void setTotal(int total) {
 		this.total = total;
-		this.pages = this.total / this.size;
-		if (this.total % this.size != 0) {
-			this.pages++;
-		}
 	}
 
 	public int getSize() {
@@ -136,7 +132,14 @@ public class Pagination extends RowBounds implements Serializable {
 	}
 
 	public int getPages() {
-		return pages;
+		if (this.size == 0) {
+			return 0;
+		}
+		this.pages = this.total / this.size;
+		if (this.total % this.size != 0) {
+			this.pages++;
+		}
+		return this.pages;
 	}
 
 	public void setCurrent(int current) {

+ 1 - 1
mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/EntityWrapperTest.java

@@ -289,7 +289,7 @@ public class EntityWrapperTest {
 	}
 
 	/**
-	 * 测试Escape
+	 * 测试Qbc
 	 */
 	@Test
 	@SuppressWarnings("unchecked")