Replies: 2 comments 1 reply
-
Both If you want to get a PK out of an entity instance, do Regarding the I don't really understand your "Expected vs actual behavior" for the serialization part, the surrounding code (that is missing in there) is very important for serialization - it depends on how you load the entity, not just on the
I think we do this on purpose, the composite FK is always represented as object in DTO, as the tuple is only internal ORM thing (so we can distinguish a FK from an entity object), and DTO is escaping these ORM-specific boundaries. I guess this part should be fixable, will see what I can do in v6. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the clarification.
I can't upgrade to Node 16 at the moment, so I can't try v6 at this time. One of my issues is that
In my example I'm serializing the entities right after creating them. I tried the manual
I want to serialize If v6 makes the |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
I'm not sure if this is a bug or if I'm not understanding these types and methods correctly.
The actual output of serialization and primary key extraction does not match the
Primary
type for a composite primary key.Utils.extractPK()
should returnPrimary
but for a composite primary key, it returns an object that contains the primary key components.WrappedEntity.toJSON()
/toPOJO()
should returnEntityDTO
withRef
s transformed intoPrimary
s, but the output does not match the expectedEntityDTO
s. I've tried it with and without populating relations.To Reproduce
Expected vs actual behavior
Utils.extractPK()
WrappedEntity.toJSON()
/toPOJO()
Unpopulated:
Populated:
Versions
Beta Was this translation helpful? Give feedback.
All reactions