Commit b46d50fe authored by Zheng Jie's avatar Zheng Jie
Browse files
parent cf3655ad
......@@ -53,6 +53,7 @@ public class QueryHelp {
}
}
try {
Map<String, Join> joinKey = new HashMap<>();
List<Field> fields = getAllFields(query.getClass(), new ArrayList<>());
for (Field field : fields) {
boolean accessible = field.isAccessible();
......@@ -75,14 +76,15 @@ public class QueryHelp {
String[] blurrys = blurry.split(",");
List<Predicate> orPredicate = new ArrayList<>();
for (String s : blurrys) {
orPredicate.add(cb.like(root.get(s)
.as(String.class), "%" + val.toString() + "%"));
orPredicate.add(cb.like(root.get(s).as(String.class), "%" + val.toString() + "%"));
}
Predicate[] p = new Predicate[orPredicate.size()];
list.add(cb.or(orPredicate.toArray(p)));
continue;
}
if (ObjectUtil.isNotEmpty(joinName)) {
join = joinKey.get(joinName);
if(join == null){
String[] joinNames = joinName.split(">");
for (String name : joinNames) {
switch (q.join()) {
......@@ -110,6 +112,8 @@ public class QueryHelp {
default: break;
}
}
joinKey.put(joinName, join);
}
}
switch (q.type()) {
case EQUAL:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment