bean-mapping: Dozer 7.0.0 vs MapStruct 1.6.3 module (basic/nested/collection/null handling, silent-failure pitfalls, records, lazy getters, parity test, compile-failure demos, JMH benchmark), 14 contract tests
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b6ZEVHGaYy15HAxRzy
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
a714780bca
commit
91f0757259
@@ -0,0 +1,23 @@
|
||||
== 1. Basic mapping: id and username by name, email -> emailAddress by configuration
|
||||
ID: 1
|
||||
User: ankurm
|
||||
Email: [email protected]
|
||||
|
||||
== 2. Nested object: no configuration at all
|
||||
profile class: ProfileEntity
|
||||
first name: John
|
||||
|
||||
== 3. Collection: List<String> -> List<TagEntity> through the custom converter
|
||||
Java
|
||||
Spring Boot
|
||||
Dozer
|
||||
|
||||
== 4. Bidirectional: the same configuration maps the entity back
|
||||
round trip equals original: true
|
||||
UserDTO[id=1, username=ankurm, [email protected], profile=ProfileDTO[John Doe], tags=[Java, Spring Boot, Dozer, MapStruct, JMH]]
|
||||
|
||||
== 5. Null handling: default Dozer copies null over an existing value
|
||||
after mapping a DTO with null email and null profile: emailAddress=null, profile=null
|
||||
|
||||
== 6. Null handling: TypeMappingOptions.mapNull(false) keeps the existing value
|
||||
after the same update: [email protected], profile=ProfileEntity[John Doe]
|
||||
Reference in New Issue
Block a user