Caratacus 8 سال پیش
والد
کامیت
a1995de651

+ 6 - 6
mybatis-plus/src/main/java/com/baomidou/framework/service/impl/ServiceImpl.java

@@ -115,7 +115,7 @@ public class ServiceImpl<M extends BaseMapper<T, PK>, T, PK extends Serializable
 
 	public boolean insertBatch(List<T> entityList) {
 		if (null == entityList) {
-			throw new IllegalArgumentException("entityList must not be empty");
+			throw new IllegalArgumentException("Error: entityList must not be empty");
 		}
 		return retBool(baseMapper.insertBatch(entityList));
 	}
@@ -138,11 +138,11 @@ public class ServiceImpl<M extends BaseMapper<T, PK>, T, PK extends Serializable
 	 */
 	protected boolean insertBatch(List<T> entityList, int batchSize, boolean isSelective) {
 		if (null == entityList) {
-			throw new IllegalArgumentException("entityList must not be empty");
+			throw new IllegalArgumentException("Error: entityList must not be empty");
 		}
 		TableInfo tableInfo = TableInfoHelper.getTableInfo(currentModleClass());
 		if (null == tableInfo) {
-			throw new MybatisPlusException("Error: insertBatch Fail, ClassGenricType not found .");
+			throw new MybatisPlusException("Error: Cannot execute insertBatch Method, ClassGenricType not found .");
 		}
 		SqlSession batchSqlSession = tableInfo.getSqlSessionFactory().openSession(ExecutorType.BATCH, false);
 		try {
@@ -159,7 +159,7 @@ public class ServiceImpl<M extends BaseMapper<T, PK>, T, PK extends Serializable
 			}
 			batchSqlSession.flushStatements();
 		} catch (Exception e) {
-			logger.warning("Warn: Method insertBatch Fail. Cause:" + e);
+			logger.warning("Error: Cannot execute insertBatch Method. Cause:" + e);
 			return false;
 		}
 		return true;
@@ -173,7 +173,7 @@ public class ServiceImpl<M extends BaseMapper<T, PK>, T, PK extends Serializable
 
 	public boolean insertBatchSelective(List<T> entityList) {
 		if (null == entityList) {
-			throw new IllegalArgumentException("entityList must not be empty");
+			throw new IllegalArgumentException("Error: entityList must not be empty");
 		}
 		int result = 0;
 		for (T t : entityList) {
@@ -242,7 +242,7 @@ public class ServiceImpl<M extends BaseMapper<T, PK>, T, PK extends Serializable
 		if (CollectionUtil.isNotEmpty(list)) {
 			int size = list.size();
 			if (size > 1) {
-				logger.warning("Warn: selectOne Method There are " + size + " results.");
+				logger.warning(String.format("Warn: selectOne Method There are  %s results.", size));
 			}
 			return list.get(0);
 		}

+ 3 - 3
mybatis-plus/src/main/java/com/baomidou/mybatisplus/toolkit/ReflectionKit.java

@@ -63,9 +63,9 @@ public class ReflectionKit {
 			Method method = cls.getMethod(getMethodCapitalize(str));
 			obj = method.invoke(entity);
 		} catch (NoSuchMethodException e) {
-			logger.warning("Warn: No such method. in " + cls + ".  Cause:" + e);
+			logger.warning(String.format("Warn: No such method. in %s.  Cause:" + e, cls.getSimpleName()));
 		} catch (IllegalAccessException e) {
-			logger.warning("Warn: Cannot execute a private method. in " + cls + ".  Cause:" + e);
+			logger.warning(String.format("Warn: Cannot execute a private method. in %s.  Cause:" + e, cls.getSimpleName()));
 		} catch (InvocationTargetException e) {
 			logger.warning("Warn: Unexpected exception on getMethodValue.  Cause:" + e);
 		}
@@ -138,7 +138,7 @@ public class ReflectionKit {
 		Type[] params = ((ParameterizedType) genType).getActualTypeArguments();
 
 		if (index >= params.length || index < 0) {
-			logger.warning(String.format("Warn: " + "Index: %s, Size of %s's Parameterized Type: %s .", index,
+			logger.warning(String.format("Warn: Index: %s, Size of %s's Parameterized Type: %s .", index,
 					clazz.getSimpleName(), params.length));
 			return Object.class;
 		}