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
//1、因为大多数情况表模型和业务模型是分开的需要转换,有以下类似的api使用就更方便了 //2、部分业务需要设置空值,但是现在api是不支持设置空值的,需要自己写xml或者全量更新
/** * 设置更新字段为空 * @param fns * @return */ @SafeVarargs public final LambdaExampleWrapper<T> setNull(Fn<T, Object> ... fns) { for (Fn<T, Object> fn : fns) { this.example.set(fn.toColumn()+" = NULL "); } return this; } public <RE extends Serializable> List<RE> list(Class<RE> returnClass){ List<T> ts = list(); List<RE> res = BeanUtil.copys(ts, returnClass); if(ts instanceof Page) { Page<RE> pageRes = new Page<>(); pageRes.addAll(res); pageRes.setTotal(((Page<T>) ts).getTotal()); //其他字段按需添加 return pageRes; } return res; } public <RE extends Serializable> RE one(Class<RE> returnClass){ T t = one(); if(t != null) { return BeanUtil.copy(t, returnClass); } return null; } public <RE extends Serializable> List<RE> top(Integer limit,Class<RE> returnClass){ List<T> ts = top(limit); List<RE> res = BeanUtil.copys(ts, returnClass); return res; } public <RE extends Serializable> RE first(Class<RE> returnClass) { T t = first(); if(t != null) { return BeanUtil.copy(t, returnClass); } return null; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
//1、因为大多数情况表模型和业务模型是分开的需要转换,有以下类似的api使用就更方便了
//2、部分业务需要设置空值,但是现在api是不支持设置空值的,需要自己写xml或者全量更新
The text was updated successfully, but these errors were encountered: