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:
Ankur
2026-12-01 08:19:12 +05:30
co-authored by Claude Sonnet 5.5
parent a714780bca
commit 91f0757259
40 changed files with 2529 additions and 0 deletions
+23
View File
@@ -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]