From 5d0a655e23ed103526e4f8585bea657f7f093d9e Mon Sep 17 00:00:00 2001 From: Mikhail2048 Date: Sat, 8 Apr 2023 17:26:50 +0300 Subject: [PATCH] Migrated from deprecated api --- .../repository/query/R2dbcQueryMethod.java | 2 +- .../PersistentPropertyPathExtension.java | 37 +++++++++---------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/spring-data-r2dbc/src/main/java/org/springframework/data/r2dbc/repository/query/R2dbcQueryMethod.java b/spring-data-r2dbc/src/main/java/org/springframework/data/r2dbc/repository/query/R2dbcQueryMethod.java index 3ea6f94fcd..6fad6e34cc 100644 --- a/spring-data-r2dbc/src/main/java/org/springframework/data/r2dbc/repository/query/R2dbcQueryMethod.java +++ b/spring-data-r2dbc/src/main/java/org/springframework/data/r2dbc/repository/query/R2dbcQueryMethod.java @@ -40,7 +40,7 @@ import org.springframework.data.repository.query.Parameter; import org.springframework.data.repository.query.QueryMethod; import org.springframework.data.repository.util.ReactiveWrapperConverters; -import org.springframework.data.repository.util.ReactiveWrappers; +import org.springframework.data.util.ReactiveWrappers; import org.springframework.data.util.Lazy; import org.springframework.data.util.ReflectionUtils; import org.springframework.data.util.TypeInformation; diff --git a/spring-data-relational/src/main/java/org/springframework/data/relational/core/mapping/PersistentPropertyPathExtension.java b/spring-data-relational/src/main/java/org/springframework/data/relational/core/mapping/PersistentPropertyPathExtension.java index b0251db44c..96358884fb 100644 --- a/spring-data-relational/src/main/java/org/springframework/data/relational/core/mapping/PersistentPropertyPathExtension.java +++ b/spring-data-relational/src/main/java/org/springframework/data/relational/core/mapping/PersistentPropertyPathExtension.java @@ -81,8 +81,7 @@ public PersistentPropertyPathExtension( this.path = path; } - public static boolean isWritable(PersistentPropertyPath path) { - + public static boolean isWritable(@Nullable PersistentPropertyPath path) { return path == null || path.getLeafProperty().isWritable() && isWritable(path.getParentPath()); } @@ -92,7 +91,7 @@ public static boolean isWritable(PersistentPropertyPath getLeafEntity() { - return path == null ? entity : context.getPersistentEntity(path.getRequiredLeafProperty().getActualType()); + return path == null ? entity : context.getPersistentEntity(path.getLeafProperty().getActualType()); } /** @@ -157,7 +156,7 @@ public RelationalPersistentEntity getRequiredLeafEntity() { throw new IllegalStateException("Couldn't resolve leaf PersistentEntity absent path"); } throw new IllegalStateException(String.format("Couldn't resolve leaf PersistentEntity for type %s", - path.getRequiredLeafProperty().getActualType())); + path.getLeafProperty().getActualType())); } return entity; @@ -167,21 +166,21 @@ public RelationalPersistentEntity getRequiredLeafEntity() { * @return {@literal true} when this is an empty path or the path references an entity. */ public boolean isEntity() { - return path == null || path.getRequiredLeafProperty().isEntity(); + return path == null || path.getLeafProperty().isEntity(); } /** * @return {@literal true} when this is references a {@link java.util.List} or {@link java.util.Map}. */ public boolean isQualified() { - return path != null && path.getRequiredLeafProperty().isQualified(); + return path != null && path.getLeafProperty().isQualified(); } /** * @return {@literal true} when this is references a {@link java.util.Collection} or an array. */ public boolean isCollectionLike() { - return path != null && path.getRequiredLeafProperty().isCollectionLike(); + return path != null && path.getLeafProperty().isCollectionLike(); } /** @@ -192,7 +191,7 @@ public boolean isCollectionLike() { public SqlIdentifier getReverseColumnName() { Assert.state(path != null, "Empty paths don't have a reverse column name"); - return path.getRequiredLeafProperty().getReverseColumnName(this); + return path.getLeafProperty().getReverseColumnName(this); } /** @@ -214,7 +213,7 @@ public SqlIdentifier getColumnName() { Assert.state(path != null, "Path is null"); - return assembleColumnName(path.getRequiredLeafProperty().getColumnName()); + return assembleColumnName(path.getLeafProperty().getColumnName()); } /** @@ -341,7 +340,7 @@ public RelationalPersistentProperty getRequiredIdProperty() { */ @Nullable public SqlIdentifier getQualifierColumn() { - return path == null ? SqlIdentifier.EMPTY : path.getRequiredLeafProperty().getKeyColumn(); + return path == null ? SqlIdentifier.EMPTY : path.getLeafProperty().getKeyColumn(); } /** @@ -351,7 +350,7 @@ public SqlIdentifier getQualifierColumn() { */ @Nullable public Class getQualifierColumnType() { - return path == null ? null : path.getRequiredLeafProperty().getQualifierColumnType(); + return path == null ? null : path.getLeafProperty().getQualifierColumnType(); } /** @@ -385,7 +384,7 @@ public Class getActualType() { return path == null // ? entity.getType() // - : path.getRequiredLeafProperty().getActualType(); + : path.getLeafProperty().getActualType(); } /** @@ -393,7 +392,7 @@ public Class getActualType() { * @see RelationalPersistentProperty#isOrdered() */ public boolean isOrdered() { - return path != null && path.getRequiredLeafProperty().isOrdered(); + return path != null && path.getLeafProperty().isOrdered(); } /** @@ -401,7 +400,7 @@ public boolean isOrdered() { * @see RelationalPersistentProperty#isMap() */ public boolean isMap() { - return path != null && path.getRequiredLeafProperty().isMap(); + return path != null && path.getLeafProperty().isMap(); } /** @@ -433,7 +432,7 @@ private SqlIdentifier assembleTableAlias() { Assert.state(path != null, "Path is null"); - RelationalPersistentProperty leafProperty = path.getRequiredLeafProperty(); + RelationalPersistentProperty leafProperty = path.getLeafProperty(); String prefix; if (isEmbedded()) { prefix = leafProperty.getEmbeddedPrefix(); @@ -468,7 +467,7 @@ private SqlIdentifier assembleColumnName(SqlIdentifier suffix) { } PersistentPropertyPath parentPath = path.getParentPath(); - RelationalPersistentProperty parentLeaf = parentPath.getRequiredLeafProperty(); + RelationalPersistentProperty parentLeaf = parentPath.getLeafProperty(); if (!parentLeaf.isEmbedded()) { return suffix;