support FIND_IN_SET cond (#745)

* fix weird prefixes keys when use RedisUtils.scan

* Column use `` for reserved key

ref: https://stackoverflow.com/questions/2224503/how-to-map-an-entity-field-whose-name-is-a-reserved-word-in-jpa

* add FIND_IN_SET 条件查询

* note
pull/805/head
Aborn Jiang 2023-07-04 17:32:22 +08:00 committed by GitHub
parent f72efb8044
commit f0ed88c51e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -74,7 +74,9 @@ public @interface Query {
// 不为空 // 不为空
,NOT_NULL ,NOT_NULL
// 为空 // 为空
,IS_NULL ,IS_NULL,
// Aborn Jiang 2022/06/01, 对应SQL: SELECT * FROM table WHERE FIND_IN_SET('querytag', table.tags);
FIND_IN_SET
} }
/** /**

View File

@ -166,6 +166,10 @@ public class QueryHelp {
(Comparable) between.get(0), (Comparable) between.get(1))); (Comparable) between.get(0), (Comparable) between.get(1)));
} }
break; break;
case FIND_IN_SET:
list.add(cb.greaterThan(cb.function("FIND_IN_SET", Integer.class,
cb.literal(val.toString()), root.get(attributeName)), 0));
break;
default: break; default: break;
} }
} }