Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b6ZEVHGaYy15HAxRzy
19 lines
1.0 KiB
Plaintext
19 lines
1.0 KiB
Plaintext
== 1. Basic + nested + collection in one mapper
|
|
UserEntity[id=1, username=ankurm, [email protected], profile=ProfileEntity[John Doe], tags=[Tag[Java], Tag[Spring Boot], Tag[Dozer], Tag[MapStruct], Tag[JMH]]]
|
|
|
|
== 2. Bidirectional through @InheritInverseConfiguration
|
|
round trip equals original: true
|
|
|
|
== 3. Null handling: the plain method copies null, the update method with IGNORE does not
|
|
new object from DTO with nulls: emailAddress=null, profile=null
|
|
update() of an existing entity: [email protected], profile=ProfileEntity[John Doe]
|
|
|
|
== 4. Records, both directions
|
|
record destination: UserRecord[id=1, username=ankurm]
|
|
record source: UserDTO[id=7, username=rec, email=null, profile=null, tags=[]]
|
|
|
|
== 5. A lazy getter: MapStruct calls it too, unless you ignore the property
|
|
map failed: IllegalStateException: could not initialize proxy - no Session (simulated lazy collection)
|
|
without ignore, getOrders() was called 1 time(s)
|
|
with ignore: LazyUserView[id=6, name=lazy2, orders=null], getOrders() called 0 time(s)
|