|
53 | 53 | import org.springframework.context.annotation.ComponentScan;
|
54 | 54 | import org.springframework.context.annotation.Configuration;
|
55 | 55 | import org.springframework.dao.DataIntegrityViolationException;
|
| 56 | +import org.springframework.data.domain.Page; |
| 57 | +import org.springframework.data.domain.PageRequest; |
56 | 58 | import org.springframework.data.domain.Sort;
|
57 | 59 | import org.springframework.data.mapping.PersistentPropertyAccessor;
|
58 | 60 | import org.springframework.data.neo4j.core.DatabaseSelectionProvider;
|
|
123 | 125 | import org.springframework.data.neo4j.integration.issues.gh2579.TableAndColumnRelation;
|
124 | 126 | import org.springframework.data.neo4j.integration.issues.gh2579.TableNode;
|
125 | 127 | import org.springframework.data.neo4j.integration.issues.gh2579.TableRepository;
|
| 128 | +import org.springframework.data.neo4j.integration.issues.gh2583.GH2583Node; |
| 129 | +import org.springframework.data.neo4j.integration.issues.gh2583.GH2583Repository; |
126 | 130 | import org.springframework.data.neo4j.integration.misc.ConcreteImplementationTwo;
|
127 | 131 | import org.springframework.data.neo4j.repository.config.EnableNeo4jRepositories;
|
128 | 132 | import org.springframework.data.neo4j.repository.query.QueryFragmentsAndParameters;
|
@@ -169,6 +173,7 @@ protected static void setupData(@Autowired BookmarkCapture bookmarkCapture) {
|
169 | 173 | setupGH2328(transaction);
|
170 | 174 | setupGH2459(transaction);
|
171 | 175 | setupGH2572(transaction);
|
| 176 | + setupGH2583(transaction); |
172 | 177 |
|
173 | 178 | transaction.commit();
|
174 | 179 | }
|
@@ -217,6 +222,21 @@ private static void setupGH2459(QueryRunner queryRunner) {
|
217 | 222 | CREATE (po1)-[:hasPet]->(a3)""").consume();
|
218 | 223 | }
|
219 | 224 |
|
| 225 | + private static void setupGH2583(QueryRunner queryRunner) { |
| 226 | + queryRunner.run(""" |
| 227 | + CREATE (n:GH2583Node)-[:LINKED]->(m:GH2583Node)-[:LINKED]->(n)-[:LINKED]->(m) |
| 228 | + -[:LINKED]->(n)-[:LINKED]->(m)-[:LINKED]->(n)-[:LINKED]->(m) |
| 229 | + -[:LINKED]->(n)-[:LINKED]->(m)-[:LINKED]->(n)-[:LINKED]->(m) |
| 230 | + -[:LINKED]->(n)-[:LINKED]->(m)-[:LINKED]->(n)-[:LINKED]->(m) |
| 231 | + -[:LINKED]->(n)-[:LINKED]->(m)-[:LINKED]->(n)-[:LINKED]->(m) |
| 232 | + -[:LINKED]->(n)-[:LINKED]->(m)-[:LINKED]->(n)-[:LINKED]->(m) |
| 233 | + -[:LINKED]->(n)-[:LINKED]->(m)-[:LINKED]->(n)-[:LINKED]->(m) |
| 234 | + -[:LINKED]->(n)-[:LINKED]->(m)-[:LINKED]->(n)-[:LINKED]->(m) |
| 235 | + -[:LINKED]->(n)-[:LINKED]->(m)-[:LINKED]->(n)-[:LINKED]->(m) |
| 236 | + -[:LINKED]->(n)-[:LINKED]->(m)-[:LINKED]->(n)-[:LINKED]->(m) |
| 237 | + -[:LINKED]->(n)-[:LINKED]->(m)-[:LINKED]->(n)-[:LINKED]->(m)""").consume(); |
| 238 | + } |
| 239 | + |
220 | 240 | @BeforeEach
|
221 | 241 | protected void prepareIndividual(
|
222 | 242 | @Autowired CityModelRepository cityModelRepository
|
@@ -907,6 +927,15 @@ void unwindWithMergeShouldWork(@Autowired Neo4jTemplate template, @Autowired Tab
|
907 | 927 | });
|
908 | 928 | }
|
909 | 929 |
|
| 930 | + @Test |
| 931 | + @Tag("GH-2583") |
| 932 | + void mapStandardCustomQueryWithLotsOfRelationshipsProperly(@Autowired GH2583Repository repository) { |
| 933 | + Page<GH2583Node> nodePage = repository.getNodesByCustomQuery(PageRequest.of(0, 300)); |
| 934 | + |
| 935 | + List<GH2583Node> nodes = nodePage.getContent(); |
| 936 | + assertThat(nodes).hasSize(2); |
| 937 | + } |
| 938 | + |
910 | 939 | @Configuration
|
911 | 940 | @EnableTransactionManagement
|
912 | 941 | @EnableNeo4jRepositories(namedQueriesLocation = "more-custom-queries.properties")
|
|
0 commit comments