Skip to content

Commit 4b083ea

Browse files
committed
Use AOT ExpressionMarker support.
Closes #3965
1 parent 9c9818c commit 4b083ea

File tree

1 file changed

+2
-6
lines changed
  • spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/aot

1 file changed

+2
-6
lines changed

spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/aot/JpaCodeBlocks.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,6 @@ public CodeBlock build() {
215215
builder.add(applyRewrite(sortParameterName, dynamicReturnType, queryStringVariableName, actualReturnType));
216216
}
217217

218-
if (queries.result().hasExpression() || queries.count().hasExpression()) {
219-
builder.addStatement("class ExpressionMarker{}");
220-
}
221-
222218
builder.add(createQuery(false, queryVariableName, queryStringVariableName, queryRewriterName, queries.result(),
223219
this.sqlResultSetMapping, pageable, this.queryHints, this.entityGraph, this.queryReturnType));
224220

@@ -550,13 +546,13 @@ private Object getParameter(ParameterBinding.ParameterOrigin origin) {
550546
expressionString = "#{" + expressionString + "}";
551547
}
552548

553-
builder.add("evaluateExpression(ExpressionMarker.class.getEnclosingMethod(), $S$L)", expressionString,
549+
builder.add("evaluateExpression($L, $S$L)", context.getExpressionMarker().enclosingMethod(), expressionString,
554550
parameterNames);
555551

556552
return builder.build();
557553
}
558554

559-
throw new UnsupportedOperationException("Not supported yet");
555+
throw new UnsupportedOperationException("Not supported yet for: " + origin);
560556
}
561557

562558
private CodeBlock applyEntityGraph(AotEntityGraph entityGraph, String queryVariableName) {

0 commit comments

Comments
 (0)