From b5effeb4d820ab0e6c365160062f18052cf00a5c Mon Sep 17 00:00:00 2001 From: Christoph Strobl Date: Mon, 11 Jan 2021 14:38:39 +0100 Subject: [PATCH] Deprecate KPropertyPath in favor of Spring Data Common's KPropertyPath. relates to: spring-projects/spring-data-commons#478 Original Pull Request: #3533 Closes: #3515 --- .../data/mongodb/core/query/KPropertyPath.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spring-data-mongodb/src/main/kotlin/org/springframework/data/mongodb/core/query/KPropertyPath.kt b/spring-data-mongodb/src/main/kotlin/org/springframework/data/mongodb/core/query/KPropertyPath.kt index 4471e04a7..01325069f 100644 --- a/spring-data-mongodb/src/main/kotlin/org/springframework/data/mongodb/core/query/KPropertyPath.kt +++ b/spring-data-mongodb/src/main/kotlin/org/springframework/data/mongodb/core/query/KPropertyPath.kt @@ -15,6 +15,7 @@ */ package org.springframework.data.mongodb.core.query +import org.springframework.data.mapping.toDotPath import kotlin.reflect.KProperty import kotlin.reflect.KProperty1 @@ -25,7 +26,9 @@ import kotlin.reflect.KProperty1 * @author Mark Paluch * @author Yoann de Martino * @since 2.2 + * @deprecated since 3.2, KPropertyPath from Spring Data Commons. */ +@Deprecated("use KPropertyPath from Spring Data Commons", replaceWith = ReplaceWith("KPropertyPath", "org.springframework.data.mapping.KPropertyPath")) class KPropertyPath( internal val parent: KProperty, internal val child: KProperty1 @@ -39,7 +42,7 @@ internal fun asString(property: KProperty<*>): String { return when (property) { is KPropertyPath<*, *> -> "${asString(property.parent)}.${property.child.name}" - else -> property.name + else -> property.toDotPath() } } @@ -54,6 +57,8 @@ internal fun asString(property: KProperty<*>): String { * @author Tjeu Kayim * @author Yoann de Martino * @since 2.2 + * @deprecated since 3.2, KPropertyPath.div from Spring Data Commons. */ +@Deprecated("use KPropertyPath.div from Spring Data Commons", replaceWith = ReplaceWith("this / other", "org.springframework.data.mapping.div")) operator fun KProperty.div(other: KProperty1) = KPropertyPath(this, other)