Skip to content

Commit e106b20

Browse files
mipo256mp911de
authored andcommitted
Migrated off deprecated PropertyPath methods.
Closes #1489
1 parent 44f7721 commit e106b20

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

spring-data-r2dbc/src/main/java/org/springframework/data/r2dbc/repository/query/R2dbcQueryMethod.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
import org.springframework.data.repository.query.Parameter;
4141
import org.springframework.data.repository.query.QueryMethod;
4242
import org.springframework.data.repository.util.ReactiveWrapperConverters;
43-
import org.springframework.data.repository.util.ReactiveWrappers;
43+
import org.springframework.data.util.ReactiveWrappers;
4444
import org.springframework.data.util.Lazy;
4545
import org.springframework.data.util.ReflectionUtils;
4646
import org.springframework.data.util.TypeInformation;

spring-data-relational/src/main/java/org/springframework/data/relational/core/mapping/PersistentPropertyPathExtension.java

+18-19
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ public PersistentPropertyPathExtension(
8181
this.path = path;
8282
}
8383

84-
public static boolean isWritable(PersistentPropertyPath<? extends RelationalPersistentProperty> path) {
85-
84+
public static boolean isWritable(@Nullable PersistentPropertyPath<? extends RelationalPersistentProperty> path) {
8685
return path == null || path.getLeafProperty().isWritable() && isWritable(path.getParentPath());
8786
}
8887

@@ -92,7 +91,7 @@ public static boolean isWritable(PersistentPropertyPath<? extends RelationalPers
9291
* @return if the leaf property is embedded.
9392
*/
9493
public boolean isEmbedded() {
95-
return path != null && path.getRequiredLeafProperty().isEmbedded();
94+
return path != null && path.getLeafProperty().isEmbedded();
9695
}
9796

9897
/**
@@ -123,8 +122,8 @@ public PersistentPropertyPathExtension getParentPath() {
123122
public boolean isMultiValued() {
124123

125124
return path != null && //
126-
(path.getRequiredLeafProperty().isCollectionLike() //
127-
|| path.getRequiredLeafProperty().isQualified() //
125+
(path.getLeafProperty().isCollectionLike() //
126+
|| path.getLeafProperty().isQualified() //
128127
|| getParentPath().isMultiValued() //
129128
);
130129
}
@@ -136,7 +135,7 @@ public boolean isMultiValued() {
136135
*/
137136
@Nullable
138137
public RelationalPersistentEntity<?> getLeafEntity() {
139-
return path == null ? entity : context.getPersistentEntity(path.getRequiredLeafProperty().getActualType());
138+
return path == null ? entity : context.getPersistentEntity(path.getLeafProperty().getActualType());
140139
}
141140

142141
/**
@@ -157,7 +156,7 @@ public RelationalPersistentEntity<?> getRequiredLeafEntity() {
157156
throw new IllegalStateException("Couldn't resolve leaf PersistentEntity absent path");
158157
}
159158
throw new IllegalStateException(String.format("Couldn't resolve leaf PersistentEntity for type %s",
160-
path.getRequiredLeafProperty().getActualType()));
159+
path.getLeafProperty().getActualType()));
161160
}
162161

163162
return entity;
@@ -167,21 +166,21 @@ public RelationalPersistentEntity<?> getRequiredLeafEntity() {
167166
* @return {@literal true} when this is an empty path or the path references an entity.
168167
*/
169168
public boolean isEntity() {
170-
return path == null || path.getRequiredLeafProperty().isEntity();
169+
return path == null || path.getLeafProperty().isEntity();
171170
}
172171

173172
/**
174173
* @return {@literal true} when this is references a {@link java.util.List} or {@link java.util.Map}.
175174
*/
176175
public boolean isQualified() {
177-
return path != null && path.getRequiredLeafProperty().isQualified();
176+
return path != null && path.getLeafProperty().isQualified();
178177
}
179178

180179
/**
181180
* @return {@literal true} when this is references a {@link java.util.Collection} or an array.
182181
*/
183182
public boolean isCollectionLike() {
184-
return path != null && path.getRequiredLeafProperty().isCollectionLike();
183+
return path != null && path.getLeafProperty().isCollectionLike();
185184
}
186185

187186
/**
@@ -192,7 +191,7 @@ public boolean isCollectionLike() {
192191
public SqlIdentifier getReverseColumnName() {
193192

194193
Assert.state(path != null, "Empty paths don't have a reverse column name");
195-
return path.getRequiredLeafProperty().getReverseColumnName(this);
194+
return path.getLeafProperty().getReverseColumnName(this);
196195
}
197196

198197
/**
@@ -214,7 +213,7 @@ public SqlIdentifier getColumnName() {
214213

215214
Assert.state(path != null, "Path is null");
216215

217-
return assembleColumnName(path.getRequiredLeafProperty().getColumnName());
216+
return assembleColumnName(path.getLeafProperty().getColumnName());
218217
}
219218

220219
/**
@@ -341,7 +340,7 @@ public RelationalPersistentProperty getRequiredIdProperty() {
341340
*/
342341
@Nullable
343342
public SqlIdentifier getQualifierColumn() {
344-
return path == null ? SqlIdentifier.EMPTY : path.getRequiredLeafProperty().getKeyColumn();
343+
return path == null ? SqlIdentifier.EMPTY : path.getLeafProperty().getKeyColumn();
345344
}
346345

347346
/**
@@ -351,7 +350,7 @@ public SqlIdentifier getQualifierColumn() {
351350
*/
352351
@Nullable
353352
public Class<?> getQualifierColumnType() {
354-
return path == null ? null : path.getRequiredLeafProperty().getQualifierColumnType();
353+
return path == null ? null : path.getLeafProperty().getQualifierColumnType();
355354
}
356355

357356
/**
@@ -385,23 +384,23 @@ public Class<?> getActualType() {
385384

386385
return path == null //
387386
? entity.getType() //
388-
: path.getRequiredLeafProperty().getActualType();
387+
: path.getLeafProperty().getActualType();
389388
}
390389

391390
/**
392391
* @return whether the leaf end of the path is ordered, i.e. the data to populate must be ordered.
393392
* @see RelationalPersistentProperty#isOrdered()
394393
*/
395394
public boolean isOrdered() {
396-
return path != null && path.getRequiredLeafProperty().isOrdered();
395+
return path != null && path.getLeafProperty().isOrdered();
397396
}
398397

399398
/**
400399
* @return {@literal true} if the leaf property of this path is a {@link java.util.Map}.
401400
* @see RelationalPersistentProperty#isMap()
402401
*/
403402
public boolean isMap() {
404-
return path != null && path.getRequiredLeafProperty().isMap();
403+
return path != null && path.getLeafProperty().isMap();
405404
}
406405

407406
/**
@@ -433,7 +432,7 @@ private SqlIdentifier assembleTableAlias() {
433432

434433
Assert.state(path != null, "Path is null");
435434

436-
RelationalPersistentProperty leafProperty = path.getRequiredLeafProperty();
435+
RelationalPersistentProperty leafProperty = path.getLeafProperty();
437436
String prefix;
438437
if (isEmbedded()) {
439438
prefix = leafProperty.getEmbeddedPrefix();
@@ -468,7 +467,7 @@ private SqlIdentifier assembleColumnName(SqlIdentifier suffix) {
468467
}
469468

470469
PersistentPropertyPath<? extends RelationalPersistentProperty> parentPath = path.getParentPath();
471-
RelationalPersistentProperty parentLeaf = parentPath.getRequiredLeafProperty();
470+
RelationalPersistentProperty parentLeaf = parentPath.getLeafProperty();
472471

473472
if (!parentLeaf.isEmbedded()) {
474473
return suffix;

0 commit comments

Comments
 (0)