Skip to content

Commit

Permalink
fix(demo-orm-jdbctemplate/BaseDao): 修复getField方法未正确过滤被注解@pk标注为主键的Field
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyitian committed Oct 18, 2022
1 parent 2308f84 commit c1d624f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ private List<Field> getField(T t, Boolean ignoreNull) {

// 过滤数据库中不存在的字段,以及自增列
List<Field> filterField;
Stream<Field> fieldStream = CollUtil.toList(fields).stream().filter(field -> ObjectUtil.isNull(field.getAnnotation(Ignore.class)) || ObjectUtil.isNull(field.getAnnotation(Pk.class)));
Stream<Field> fieldStream = CollUtil.toList(fields).stream().filter(field -> ObjectUtil.isNull(field.getAnnotation(Ignore.class)) && ObjectUtil.isNull(field.getAnnotation(Pk.class)));

// 是否过滤字段值为null的字段
if (ignoreNull) {
Expand Down

0 comments on commit c1d624f

Please sign in to comment.