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
查询语句里多次用到many端的属性时,会重复join。 下面代码能修复这个问题
public From getRoot(String property, Root<T> root) { if (property.contains(".")) { String joinProperty = StringUtils.split(property, ".")[0]; //防止重复join Optional<Join<T, ?>> oldJoin = root.getJoins().stream().filter(j -> j.getAttribute().getName().equals(joinProperty)).findAny(); return oldJoin.orElseGet(() -> root.join(joinProperty, JoinType.LEFT)); } return root; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
查询语句里多次用到many端的属性时,会重复join。
下面代码能修复这个问题
The text was updated successfully, but these errors were encountered: