Skip to content

Commit b5effeb

Browse files
Deprecate KPropertyPath in favor of Spring Data Common's KPropertyPath.
relates to: spring-projects/spring-data-commons#478 Original Pull Request: #3533 Closes: #3515
1 parent ad6d2c9 commit b5effeb

File tree

1 file changed

+6
-1
lines changed
  • spring-data-mongodb/src/main/kotlin/org/springframework/data/mongodb/core/query

1 file changed

+6
-1
lines changed

spring-data-mongodb/src/main/kotlin/org/springframework/data/mongodb/core/query/KPropertyPath.kt

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package org.springframework.data.mongodb.core.query
1717

18+
import org.springframework.data.mapping.toDotPath
1819
import kotlin.reflect.KProperty
1920
import kotlin.reflect.KProperty1
2021

@@ -25,7 +26,9 @@ import kotlin.reflect.KProperty1
2526
* @author Mark Paluch
2627
* @author Yoann de Martino
2728
* @since 2.2
29+
* @deprecated since 3.2, KPropertyPath from Spring Data Commons.
2830
*/
31+
@Deprecated("use KPropertyPath from Spring Data Commons", replaceWith = ReplaceWith("KPropertyPath", "org.springframework.data.mapping.KPropertyPath"))
2932
class KPropertyPath<T, U>(
3033
internal val parent: KProperty<U?>,
3134
internal val child: KProperty1<U, T>
@@ -39,7 +42,7 @@ internal fun asString(property: KProperty<*>): String {
3942
return when (property) {
4043
is KPropertyPath<*, *> ->
4144
"${asString(property.parent)}.${property.child.name}"
42-
else -> property.name
45+
else -> property.toDotPath()
4346
}
4447
}
4548

@@ -54,6 +57,8 @@ internal fun asString(property: KProperty<*>): String {
5457
* @author Tjeu Kayim
5558
* @author Yoann de Martino
5659
* @since 2.2
60+
* @deprecated since 3.2, KPropertyPath.div from Spring Data Commons.
5761
*/
62+
@Deprecated("use KPropertyPath.div from Spring Data Commons", replaceWith = ReplaceWith("this / other", "org.springframework.data.mapping.div"))
5863
operator fun <T, U> KProperty<T?>.div(other: KProperty1<T, U>) =
5964
KPropertyPath(this, other)

0 commit comments

Comments
 (0)