34
34
import org .springframework .core .annotation .AnnotatedElementUtils ;
35
35
import org .springframework .data .annotation .Persistent ;
36
36
import org .springframework .data .mapping .Association ;
37
- import org .springframework .data .mapping .PropertyHandler ;
38
37
import org .springframework .data .mapping .model .BasicPersistentEntity ;
39
38
import org .springframework .data .neo4j .core .schema .DynamicLabels ;
40
39
import org .springframework .data .neo4j .core .schema .GeneratedValue ;
@@ -222,7 +221,10 @@ private void verifyNoDuplicatedGraphProperties() {
222
221
223
222
Set <String > seen = new HashSet <>();
224
223
Set <String > duplicates = new HashSet <>();
225
- this .doWithProperties ((PropertyHandler <Neo4jPersistentProperty >) persistentProperty -> {
224
+ PropertyHandlerSupport .of (this ).doWithProperties (persistentProperty -> {
225
+ if (persistentProperty .isEntity ()) {
226
+ return ;
227
+ }
226
228
String propertyName = persistentProperty .getPropertyName ();
227
229
if (seen .contains (propertyName )) {
228
230
duplicates .add (propertyName );
@@ -238,7 +240,7 @@ private void verifyNoDuplicatedGraphProperties() {
238
240
private void verifyDynamicAssociations () {
239
241
240
242
Set <Class > targetEntities = new HashSet <>();
241
- this .doWithAssociations ((Association <Neo4jPersistentProperty > association ) -> {
243
+ AssociationHandlerSupport . of ( this ) .doWithAssociations ((Association <Neo4jPersistentProperty > association ) -> {
242
244
Neo4jPersistentProperty inverse = association .getInverse ();
243
245
if (inverse .isDynamicAssociation ()) {
244
246
Relationship relationship = inverse .findAnnotation (Relationship .class );
@@ -272,7 +274,7 @@ private void verifyDynamicLabels() {
272
274
273
275
Set <String > namesOfPropertiesWithDynamicLabels = new HashSet <>();
274
276
275
- this .doWithProperties (( PropertyHandler < Neo4jPersistentProperty >) persistentProperty -> {
277
+ PropertyHandlerSupport . of ( this ) .doWithProperties (persistentProperty -> {
276
278
if (!persistentProperty .isAnnotationPresent (DynamicLabels .class )) {
277
279
return ;
278
280
}
@@ -449,7 +451,7 @@ private IdDescription computeIdDescription() {
449
451
public Collection <RelationshipDescription > getRelationships () {
450
452
451
453
final List <RelationshipDescription > relationships = new ArrayList <>();
452
- this .doWithAssociations (
454
+ AssociationHandlerSupport . of ( this ) .doWithAssociations (
453
455
(Association <Neo4jPersistentProperty > association ) -> relationships .add ((RelationshipDescription ) association ));
454
456
return Collections .unmodifiableCollection (relationships );
455
457
}
@@ -489,7 +491,7 @@ private Collection<GraphPropertyDescription> computeGraphProperties() {
489
491
490
492
final List <GraphPropertyDescription > computedGraphProperties = new ArrayList <>();
491
493
492
- doWithProperties (( PropertyHandler < Neo4jPersistentProperty >) computedGraphProperties ::add );
494
+ PropertyHandlerSupport . of ( this ). doWithProperties ( computedGraphProperties ::add );
493
495
494
496
return Collections .unmodifiableCollection (computedGraphProperties );
495
497
}
0 commit comments