File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/main/java/org/springframework/data/keyvalue/repository/query Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 29
29
import org .springframework .data .repository .query .parser .PartTree .OrPart ;
30
30
import org .springframework .expression .spel .standard .SpelExpression ;
31
31
import org .springframework .expression .spel .standard .SpelExpressionParser ;
32
+ import org .springframework .util .StringUtils ;
32
33
33
34
/**
34
35
* {@link AbstractQueryCreator} to create {@link SpelExpression} based {@link KeyValueQuery}s.
35
36
*
36
37
* @author Christoph Strobl
37
38
* @author Oliver Gierke
39
+ * @author Mark Paluch
38
40
*/
39
41
public class SpelQueryCreator extends AbstractQueryCreator <KeyValueQuery <SpelExpression >, String > {
40
42
@@ -109,7 +111,7 @@ protected SpelExpression toPredicateExpression(PartTree tree) {
109
111
110
112
Part part = partIter .next ();
111
113
112
- if (!requiresInverseLookup (part )) {
114
+ if (!requiresInverseLookup (part )) {
113
115
114
116
partBuilder .append ("#it?." );
115
117
partBuilder .append (part .getProperty ().toDotPath ().replace ("." , "?." ));
@@ -212,7 +214,7 @@ protected SpelExpression toPredicateExpression(PartTree tree) {
212
214
}
213
215
}
214
216
215
- return PARSER .parseRaw (sb .toString ());
217
+ return ! StringUtils . hasText ( sb ) ? null : PARSER .parseRaw (sb .toString ());
216
218
}
217
219
218
220
private static boolean requiresInverseLookup (Part part ) {
You can’t perform that action at this time.
0 commit comments