|
22 | 22 | import org.springframework.core.MethodParameter; |
23 | 23 | import org.springframework.core.annotation.AnnotatedElementUtils; |
24 | 24 | import org.springframework.data.neo4j.repository.support.CypherdslStatementExecutor; |
25 | | -import org.springframework.data.neo4j.repository.support.ReactiveCypherdslStatementExecutor; |
26 | 25 | import org.springframework.data.projection.ProjectionFactory; |
27 | 26 | import org.springframework.data.repository.core.RepositoryMetadata; |
28 | 27 | import org.springframework.data.repository.query.Parameter; |
@@ -61,12 +60,24 @@ class Neo4jQueryMethod extends QueryMethod { |
61 | 60 | * @param factory must not be {@literal null}. |
62 | 61 | */ |
63 | 62 | Neo4jQueryMethod(Method method, RepositoryMetadata metadata, ProjectionFactory factory) { |
| 63 | + this(method, metadata, factory, ClassUtils.hasMethod(CypherdslStatementExecutor.class, method)); |
| 64 | + } |
| 65 | + |
| 66 | + /** |
| 67 | + * Allows to configure {@link #cypherBasedProjection} from inheriting classes. Not meant to be called outside the |
| 68 | + * inheritance tree. |
| 69 | + * |
| 70 | + * @param method must not be {@literal null}. |
| 71 | + * @param metadata must not be {@literal null}. |
| 72 | + * @param factory must not be {@literal null}. |
| 73 | + * @param cypherBasedProjection True if this points to a Cypher-DSL based projection. |
| 74 | + */ |
| 75 | + Neo4jQueryMethod(Method method, RepositoryMetadata metadata, ProjectionFactory factory, boolean cypherBasedProjection) { |
64 | 76 | super(method, metadata, factory); |
65 | 77 |
|
66 | 78 | Class<?> declaringClass = method.getDeclaringClass(); |
67 | 79 | this.repositoryName = declaringClass.getName(); |
68 | | - this.cypherBasedProjection = ClassUtils.hasMethod(CypherdslStatementExecutor.class, method) || ClassUtils |
69 | | - .hasMethod(ReactiveCypherdslStatementExecutor.class, method); |
| 80 | + this.cypherBasedProjection = cypherBasedProjection; |
70 | 81 | this.queryAnnotation = AnnotatedElementUtils.findMergedAnnotation(method, Query.class); |
71 | 82 | } |
72 | 83 |
|
|
0 commit comments