Comments (2)
Care to provide the UserId
type? Ideally, you would provide a minimal reproducer as GitHub repo or zip file (attached to this issue) so that we have an exact reproducer.
One more thing: Looking at your dependency versions, it seems that you're using Spring Boot 3.0.4 that uses Spring Data Commons 3.0.4.
Kotlin value class support was introduced in a later version 3.2, as I'd anticipate inline/value class usage here.
from spring-data-mongodb.
Providing minimal working example would take some time, because project is a bit messy rn, so here are the classes
internal class UserId(val id: String) {
companion object {
fun fromString(eventId: String?): UserId {
if (eventId == null) {
throw RuntimeException("UserId can not be null.")
}
return UserId(eventId)
}
fun createNew(): UserId = UserId("user-" + getRandomString(15))
}
// skipped toString, equals, hashCode, which I generated trying to find the root cause
}
Converters
@WritingConverter
internal class UserIdToStringConverter : Converter<UserId, String> {
override fun convert(source: UserId): String {
return source.id
}
}
@ReadingConverter
internal class StringToUserIdConverter : Converter<String, UserId> {
override fun convert(source: String): UserId {
return UserId.fromString(source)
}
}
Thanks for the ticket link, didn't know value classes were not supported yet, I'll pack the minimal reproducable example later today, but from the debugging I've done, it's not the "value" class, because UserId object is being restored correctly, the problem lies in parameters list having 3 values instead of 2, where first 2 are real parameters and the last one is null.
from spring-data-mongodb.
Related Issues (20)
- VectorSearch Aggregation Stage HOT 1
- Id conversion handling in `QueryMapper.getMappedValue(…)` doesn't consider nesting HOT 1
- Can't create CRaC checkpoint, fails with the error message "Restarting Spring-managed lifecycle beans after JVM restore" HOT 2
- `SpringDataMongodbQuery` and `SpringDataMongodbSerializer` apply mapping twice HOT 1
- Null-Values from custom converters are stored in document HOT 1
- SpringApplication.exit(...) not closing application due to MongoDB locks for cluster with multiple nodes
- Converter called multiple times evaluating aggregation operation query methods HOT 5
- Creating a Type-Safe Query with Kotlin for Document IDs that have a relationship with DBRef HOT 3
- Aggregation with `$unwind` and `$project` causes `IllegalArgumentException` HOT 1
- Support derived queries using the same field multiple times HOT 1
- querydsl predicate using IN operator returns no results with @DBRef HOT 3
- Aggregation pipeline breaks if $replaceRoot stage is present HOT 2
- Misleading Change Streams documentation HOT 2
- Release 4.2.8 (2023.1.8)
- Release 4.3.2 (2024.0.2)
- MongoTemplate.count Specify strategy HOT 2
- Unable to Determine Generic Converter type HOT 1
- Switch to Broadcom docker proxy
- Using records as `@Unwrapped` auditing objects fails with `Cannot set property`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-data-mongodb.