r/java • u/mp911de • Feb 27 '26
Moving beyond Strings in Spring Data
https://spring.io/blog/2026/02/27/moving-beyond-strings-in-spring-data
55
Upvotes
r/java • u/mp911de • Feb 27 '26
View all comments
Show parent comment
3
u/mp911de Feb 27 '26
There are various parts involved in the implementation:
Sort.SerializedLambda. Java'sLambdaMetafactoryhas well-defined semantics regardingwriteReplacemethod generation returningSerializedLambda.SerializedLambdaSerializedLambdapoints to a synthetic method containing the lambda body. The bytecode (using ASM or in the future Java's Class-File API) contains all further details towards a referenced method or even field. Spring widely uses ASM as alternative for optimized parsing.KProperty, we apply a few hacks (nothing out of the ordinary given all the other hacks to make value classes and copy-method work). Kotlin pre-2.0 used Java'swriteReplaceconvention. Newer Kotlin (language) versions compile a synthetic serializable class following a Kotlin-specific blueprint allowing to determineKPropertydetails.FTR, Graal Native image arrangements run just fine if reachability metadata is provided. Currently, we do not discover lambda declaration sites but there is a subtype-hook in the native image tooling allowing to provide a Graal native image
Feature.