Commit f2a0383
committed
GH-1911 - Provide a way for defining dynamic queries in a type safe way.
This commit adds a couple of additional Spring Data Neo4j Extensions (mixins):
* `QuerydslPredicateExecutor`
* `CypherdslConditionExecutor`
* `CypherdslStatementExecutor`
* `ReactiveCypherdslStatementExecutor`
SDN provides now two different ways of adding dynamic conditions to generated queries: By supporting the existing Spring Data Commons `QuerydslPredicateExecutor` via the new support of QueryDSL expressions inside Cypher-DSL 2021.1.1 as well as the Neo4j native pendant to it, the `CypherdslConditionExecutor`. Conceptionally, both mixins provide the same feature. Both are implemented via an additional repository fragment, that is linked to the repository via the `Neo4jRepositoryFactory`.
The Cypher-DSL statement executors come as a pair: For the imperative and reactive world. The interface provides overloads for `findOne` and `finaAll`, which all take at least a Cypher-DSL statement, so that these extensions can be used to specifiy a complete query in a type safe way. Also provided are overloads taking in a type parameter that allows to specify a project, thus creating symmetry with the standard repository and their string based finder methods with a type parameter.
Implementationwise both statement executors are provided via new variants of a `AbstractNeo4jQuery` respectively `AbstractReactiveNeo4jQuery`, as we didn’t find a solution to access the projection type from a fragment.
This closes #1911.1 parent fd20a81 commit f2a0383
File tree
38 files changed
+1778
-587
lines changed- src
- main
- asciidoc
- faq
- getting-started
- object-mapping
- java/org/springframework/data/neo4j
- core
- mapping
- repository
- query
- support
- test/java/org/springframework/data/neo4j
- documentation/repositories
- populators
- projection
- integration
- imperative
- reactive
38 files changed
+1778
-587
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
362 | | - | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
363 | 368 | | |
364 | 369 | | |
365 | 370 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
| 207 | + | |
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
223 | 240 | | |
224 | 241 | | |
225 | | - | |
| 242 | + | |
226 | 243 | | |
227 | | - | |
228 | | - | |
| 244 | + | |
229 | 245 | | |
230 | | - | |
| 246 | + | |
231 | 247 | | |
232 | 248 | | |
233 | 249 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | | - | |
| 232 | + | |
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
| |||
49 | 48 | | |
50 | 49 | | |
51 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
Lines changed: 11 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
676 | 676 | | |
677 | 677 | | |
678 | 678 | | |
679 | | - | |
| 679 | + | |
680 | 680 | | |
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
684 | 684 | | |
685 | 685 | | |
686 | 686 | | |
687 | | - | |
688 | | - | |
689 | 687 | | |
690 | 688 | | |
691 | | - | |
| 689 | + | |
692 | 690 | | |
693 | 691 | | |
694 | 692 | | |
695 | 693 | | |
696 | 694 | | |
697 | 695 | | |
698 | 696 | | |
699 | | - | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
700 | 701 | | |
701 | | - | |
702 | 702 | | |
703 | 703 | | |
704 | 704 | | |
| |||
715 | 715 | | |
716 | 716 | | |
717 | 717 | | |
| 718 | + | |
| 719 | + | |
718 | 720 | | |
719 | 721 | | |
720 | | - | |
| 722 | + | |
721 | 723 | | |
722 | 724 | | |
723 | 725 | | |
| |||
737 | 739 | | |
738 | 740 | | |
739 | 741 | | |
| 742 | + | |
| 743 | + | |
740 | 744 | | |
741 | 745 | | |
742 | 746 | | |
| |||
791 | 795 | | |
792 | 796 | | |
793 | 797 | | |
794 | | - | |
795 | 798 | | |
0 commit comments