|
15 | 15 | */
|
16 | 16 | package org.springframework.data.neo4j.integration.imperative;
|
17 | 17 |
|
18 |
| -import static org.assertj.core.api.Assertions.assertThat; |
19 |
| -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; |
20 |
| -import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; |
21 |
| - |
22 |
| -import lombok.Data; |
23 |
| - |
24 |
| -import java.util.ArrayList; |
25 |
| -import java.util.Arrays; |
26 |
| -import java.util.Collection; |
27 |
| -import java.util.Collections; |
28 |
| -import java.util.HashMap; |
29 |
| -import java.util.List; |
30 |
| -import java.util.Map; |
31 |
| -import java.util.Optional; |
32 |
| -import java.util.function.BiPredicate; |
33 |
| -import java.util.function.Function; |
34 |
| - |
35 | 18 | import org.junit.jupiter.api.BeforeEach;
|
36 | 19 | import org.junit.jupiter.api.Test;
|
37 | 20 | import org.neo4j.cypherdsl.core.Cypher;
|
|
50 | 33 | import org.springframework.context.annotation.Configuration;
|
51 | 34 | import org.springframework.dao.IncorrectResultSizeDataAccessException;
|
52 | 35 | import org.springframework.data.mapping.PropertyPath;
|
53 |
| -import org.springframework.data.neo4j.test.Neo4jImperativeTestConfiguration; |
54 | 36 | import org.springframework.data.neo4j.core.DatabaseSelectionProvider;
|
55 | 37 | import org.springframework.data.neo4j.core.Neo4jTemplate;
|
56 | 38 | import org.springframework.data.neo4j.core.mapping.Neo4jPersistentProperty;
|
|
63 | 45 | import org.springframework.data.neo4j.integration.shared.common.ThingWithGeneratedId;
|
64 | 46 | import org.springframework.data.neo4j.test.BookmarkCapture;
|
65 | 47 | import org.springframework.data.neo4j.test.Neo4jExtension.Neo4jConnectionSupport;
|
| 48 | +import org.springframework.data.neo4j.test.Neo4jImperativeTestConfiguration; |
66 | 49 | import org.springframework.data.neo4j.test.Neo4jIntegrationTest;
|
67 | 50 | import org.springframework.transaction.PlatformTransactionManager;
|
68 | 51 | import org.springframework.transaction.annotation.EnableTransactionManagement;
|
69 | 52 |
|
| 53 | +import java.util.ArrayList; |
| 54 | +import java.util.Arrays; |
| 55 | +import java.util.Collection; |
| 56 | +import java.util.Collections; |
| 57 | +import java.util.HashMap; |
| 58 | +import java.util.List; |
| 59 | +import java.util.Map; |
| 60 | +import java.util.Optional; |
| 61 | +import java.util.function.BiPredicate; |
| 62 | +import java.util.function.Function; |
| 63 | + |
| 64 | +import static org.assertj.core.api.Assertions.assertThat; |
| 65 | +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; |
| 66 | +import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; |
| 67 | + |
70 | 68 | /**
|
71 | 69 | * @author Gerrit Meier
|
72 | 70 | * @author Michael J. Simons
|
@@ -354,14 +352,88 @@ private static BiPredicate<PropertyPath, Neo4jPersistentProperty> create2LevelPr
|
354 | 352 | return predicate;
|
355 | 353 | }
|
356 | 354 |
|
357 |
| - @Data |
358 | 355 | static class DtoPersonProjection {
|
359 | 356 |
|
360 |
| - /** The ID is required in a project that should be saved. */ |
| 357 | + /** |
| 358 | + * The ID is required in a project that should be saved. |
| 359 | + */ |
361 | 360 | private final Long id;
|
362 | 361 |
|
363 | 362 | private String lastName;
|
364 | 363 | private String firstName;
|
| 364 | + |
| 365 | + DtoPersonProjection(Long id) { |
| 366 | + this.id = id; |
| 367 | + } |
| 368 | + |
| 369 | + public Long getId() { |
| 370 | + return this.id; |
| 371 | + } |
| 372 | + |
| 373 | + public String getLastName() { |
| 374 | + return this.lastName; |
| 375 | + } |
| 376 | + |
| 377 | + public String getFirstName() { |
| 378 | + return this.firstName; |
| 379 | + } |
| 380 | + |
| 381 | + public void setLastName(String lastName) { |
| 382 | + this.lastName = lastName; |
| 383 | + } |
| 384 | + |
| 385 | + public void setFirstName(String firstName) { |
| 386 | + this.firstName = firstName; |
| 387 | + } |
| 388 | + |
| 389 | + public boolean equals(final Object o) { |
| 390 | + if (o == this) { |
| 391 | + return true; |
| 392 | + } |
| 393 | + if (!(o instanceof DtoPersonProjection)) { |
| 394 | + return false; |
| 395 | + } |
| 396 | + final DtoPersonProjection other = (DtoPersonProjection) o; |
| 397 | + if (!other.canEqual((Object) this)) { |
| 398 | + return false; |
| 399 | + } |
| 400 | + final Object this$id = this.getId(); |
| 401 | + final Object other$id = other.getId(); |
| 402 | + if (this$id == null ? other$id != null : !this$id.equals(other$id)) { |
| 403 | + return false; |
| 404 | + } |
| 405 | + final Object this$lastName = this.getLastName(); |
| 406 | + final Object other$lastName = other.getLastName(); |
| 407 | + if (this$lastName == null ? other$lastName != null : !this$lastName.equals(other$lastName)) { |
| 408 | + return false; |
| 409 | + } |
| 410 | + final Object this$firstName = this.getFirstName(); |
| 411 | + final Object other$firstName = other.getFirstName(); |
| 412 | + if (this$firstName == null ? other$firstName != null : !this$firstName.equals(other$firstName)) { |
| 413 | + return false; |
| 414 | + } |
| 415 | + return true; |
| 416 | + } |
| 417 | + |
| 418 | + protected boolean canEqual(final Object other) { |
| 419 | + return other instanceof DtoPersonProjection; |
| 420 | + } |
| 421 | + |
| 422 | + public int hashCode() { |
| 423 | + final int PRIME = 59; |
| 424 | + int result = 1; |
| 425 | + final Object $id = this.getId(); |
| 426 | + result = result * PRIME + ($id == null ? 43 : $id.hashCode()); |
| 427 | + final Object $lastName = this.getLastName(); |
| 428 | + result = result * PRIME + ($lastName == null ? 43 : $lastName.hashCode()); |
| 429 | + final Object $firstName = this.getFirstName(); |
| 430 | + result = result * PRIME + ($firstName == null ? 43 : $firstName.hashCode()); |
| 431 | + return result; |
| 432 | + } |
| 433 | + |
| 434 | + public String toString() { |
| 435 | + return "Neo4jTemplateIT.DtoPersonProjection(id=" + this.getId() + ", lastName=" + this.getLastName() + ", firstName=" + this.getFirstName() + ")"; |
| 436 | + } |
365 | 437 | }
|
366 | 438 |
|
367 | 439 | @Test // GH-2215
|
|
0 commit comments