We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BEAN 定义如下: @table("coin_activity") public class CoinActivityDO extends BaseDO {
private static final long serialVersionUID = -3645547428797953987L; /** * 关联的优惠ID */ @Column(hump = true) private Long refPromotionId; /** * 所属卖家ID */ @Column(hump = true) private Long sellerId;
}
我需要忽略更新sellerId字段,设置的update脚本如下:
Condition condition = Cnd.where("id", "=", coinActivityDO.getId()).and("seller_id", "=", coinActivityDO.getSellerId()) .and("venture", "=", coinActivityDO.getVenture()); //注意lock函数有bug Chain chain = Chain.from(coinActivityDO, FieldMatcher.make(null, "seller_id", true)); return coinActivityDao.updateInstance(CoinActivityDO.class, chain, condition);
实际跟踪到忽略逻辑如下 org.nutz.dao.Chain line 222: Mirror<?> mirror = Mirror.me(obj.getClass()); for (Field f : mirror.getFields()) { //此处仅识别Field name, 未识别@column注解定义的hump& value alias别称 if (null != fm && !fm.match(f.getName())) continue; Object v = mirror.getValue(obj, f.getName()); if (null == v) { if (fm != null && fm.isIgnoreNull()) continue; } else if (fm != null && fm.isIgnoreBlankStr() && v instanceof String && Strings.isBlank((String)v)) { continue; } if (c == null) { c = Chain.make(f.getName(), v); } else { c = c.add(f.getName(), v); } }
The text was updated successfully, but these errors were encountered:
算不上bug,用sellerId应该是可以的吧?
Sorry, something went wrong.
No branches or pull requests
BEAN 定义如下:
@table("coin_activity")
public class CoinActivityDO extends BaseDO {
}
我需要忽略更新sellerId字段,设置的update脚本如下:
Condition condition = Cnd.where("id", "=", coinActivityDO.getId()).and("seller_id", "=", coinActivityDO.getSellerId())
.and("venture", "=", coinActivityDO.getVenture());
//注意lock函数有bug
Chain chain = Chain.from(coinActivityDO, FieldMatcher.make(null, "seller_id", true));
return coinActivityDao.updateInstance(CoinActivityDO.class, chain, condition);
实际跟踪到忽略逻辑如下 org.nutz.dao.Chain line 222:
Mirror<?> mirror = Mirror.me(obj.getClass());
for (Field f : mirror.getFields()) {
//此处仅识别Field name, 未识别@column注解定义的hump& value alias别称
if (null != fm && !fm.match(f.getName()))
continue;
Object v = mirror.getValue(obj, f.getName());
if (null == v) {
if (fm != null && fm.isIgnoreNull())
continue;
} else if (fm != null && fm.isIgnoreBlankStr() && v instanceof String && Strings.isBlank((String)v)) {
continue;
}
if (c == null) {
c = Chain.make(f.getName(), v);
} else {
c = c.add(f.getName(), v);
}
}
The text was updated successfully, but these errors were encountered: