完善代码注释

This commit is contained in:
admin 2021-06-07 14:13:23 +08:00
parent aa87090997
commit a1c792e890
5 changed files with 10 additions and 8 deletions

View File

@ -9,7 +9,6 @@ import org.apache.ibatis.session.Configuration;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationListener;
import java.lang.reflect.Field;
@ -21,6 +20,7 @@ import java.util.List;
*
* @author yulichang
*/
@SuppressWarnings("SpringJavaAutowiredMembersInspection")
public class InterceptorConfig implements ApplicationListener<ApplicationReadyEvent> {
@Autowired

View File

@ -60,7 +60,7 @@ public class MPJSqlInjector extends DefaultSqlInjector {
// 循环注入自定义方法
methodList.forEach(m -> m.inject(builderAssistant, mapperClass, modelClass, tableInfo));
} else {
logger.debug(mapperClass.toString() + ", No effective injection method was found.");
logger.debug(mapperClass + ", No effective injection method was found.");
}
mapperRegistryCache.add(className);
}

View File

@ -33,7 +33,7 @@ import java.util.stream.Collectors;
* @author yulichang
*/
@Deprecated
@SuppressWarnings("DeprecatedIsStillUsed")
@SuppressWarnings({"DeprecatedIsStillUsed", "unused"})
public class MPJLambdaQueryWrapper<T> extends AbstractLambdaWrapper<T, MPJLambdaQueryWrapper<T>>
implements Query<MPJLambdaQueryWrapper<T>, T, SFunction<T, ?>>, MPJJoin<MPJLambdaQueryWrapper<T>> {

View File

@ -30,6 +30,7 @@ import java.util.stream.Collectors;
* @author yulichang
* @see com.github.yulichang.toolkit.Wrappers
*/
@SuppressWarnings("unused")
public class MPJQueryWrapper<T> extends AbstractWrapper<T, String, MPJQueryWrapper<T>>
implements Query<MPJQueryWrapper<T>, T, String>, MPJJoin<MPJQueryWrapper<T>> {
@ -141,6 +142,7 @@ public class MPJQueryWrapper<T> extends AbstractWrapper<T, String, MPJQueryWrapp
*
* @param as 实体对应的别名
*/
@SuppressWarnings({"DuplicatedCode", "UnusedReturnValue"})
public final MPJQueryWrapper<T> selectAll(Class<?> clazz, String as) {
TableInfo info = TableInfoHelper.getTableInfo(clazz);
Assert.notNull(info, "can not find table info");

View File

@ -18,7 +18,6 @@ import static java.util.stream.Collectors.joining;
*
* @author yulichang
*/
@SuppressWarnings("serial")
public abstract class MPJAbstractLambdaWrapper<T, Children extends MPJAbstractLambdaWrapper<T, Children>>
extends MPJAbstractWrapper<T, Children> {
@ -34,15 +33,16 @@ public abstract class MPJAbstractLambdaWrapper<T, Children extends MPJAbstractLa
@Override
protected <X> String columnToString(X column) {
return columnToString((SFunction<?, ?>) column, true);
return columnToString((SFunction<?, ?>) column);
}
@Override
protected <X> String columnsToString(X... columns) {
return Arrays.stream(columns).map(i -> columnToString((SFunction<?, ?>) i, true)).collect(joining(StringPool.COMMA));
@SafeVarargs
protected final <X> String columnsToString(X... columns) {
return Arrays.stream(columns).map(i -> columnToString((SFunction<?, ?>) i)).collect(joining(StringPool.COMMA));
}
protected String columnToString(SFunction<?, ?> column, boolean onlyColumn) {
protected String columnToString(SFunction<?, ?> column) {
return Constant.TABLE_ALIAS + getDefault(subTable.get(LambdaUtils.getEntityClass(column))) + StringPool.DOT +
getCache(column).getColumn();
}