Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ public PersistentPropertyPathExtension(
this.path = path;
}

public static boolean isWritable(PersistentPropertyPath<? extends RelationalPersistentProperty> path) {

public static boolean isWritable(@Nullable PersistentPropertyPath<? extends RelationalPersistentProperty> path) {
return path == null || path.getLeafProperty().isWritable() && isWritable(path.getParentPath());
}

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

/**
Expand Down Expand Up @@ -123,8 +122,8 @@ public PersistentPropertyPathExtension getParentPath() {
public boolean isMultiValued() {

return path != null && //
(path.getRequiredLeafProperty().isCollectionLike() //
|| path.getRequiredLeafProperty().isQualified() //
(path.getLeafProperty().isCollectionLike() //
|| path.getLeafProperty().isQualified() //
|| getParentPath().isMultiValued() //
);
}
Expand All @@ -136,7 +135,7 @@ public boolean isMultiValued() {
*/
@Nullable
public RelationalPersistentEntity<?> getLeafEntity() {
return path == null ? entity : context.getPersistentEntity(path.getRequiredLeafProperty().getActualType());
return path == null ? entity : context.getPersistentEntity(path.getLeafProperty().getActualType());
}

/**
Expand All @@ -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;
Expand All @@ -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();
}

/**
Expand All @@ -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);
}

/**
Expand All @@ -214,7 +213,7 @@ public SqlIdentifier getColumnName() {

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

return assembleColumnName(path.getRequiredLeafProperty().getColumnName());
return assembleColumnName(path.getLeafProperty().getColumnName());
}

/**
Expand Down Expand Up @@ -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();
}

/**
Expand All @@ -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();
}

/**
Expand Down Expand Up @@ -385,23 +384,23 @@ public Class<?> getActualType() {

return path == null //
? entity.getType() //
: path.getRequiredLeafProperty().getActualType();
: path.getLeafProperty().getActualType();
}

/**
* @return whether the leaf end of the path is ordered, i.e. the data to populate must be ordered.
* @see RelationalPersistentProperty#isOrdered()
*/
public boolean isOrdered() {
return path != null && path.getRequiredLeafProperty().isOrdered();
return path != null && path.getLeafProperty().isOrdered();
}

/**
* @return {@literal true} if the leaf property of this path is a {@link java.util.Map}.
* @see RelationalPersistentProperty#isMap()
*/
public boolean isMap() {
return path != null && path.getRequiredLeafProperty().isMap();
return path != null && path.getLeafProperty().isMap();
}

/**
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -468,7 +467,7 @@ private SqlIdentifier assembleColumnName(SqlIdentifier suffix) {
}

PersistentPropertyPath<? extends RelationalPersistentProperty> parentPath = path.getParentPath();
RelationalPersistentProperty parentLeaf = parentPath.getRequiredLeafProperty();
RelationalPersistentProperty parentLeaf = parentPath.getLeafProperty();

if (!parentLeaf.isEmbedded()) {
return suffix;
Expand Down