Metadata tools deepCopy does not copy embedded entities

Hi,

I am trying to clone an entity which has embedded entities with:

MyEntity copy = metadata.getTools().deepCopy(original);

It looks like the embedded entity is ignored by “deepCopy”.

I am using CUBA version 6.6.
Is this the expected behaviour or is it a bug?

Thank you for the support and for the great product.

Nicholas

1 Like

Hi Nicholas,

It’s rather a bug, thank you for noticing.
I’ve just fixed it for 6.8.8 and above, but in 6.8 you will have to set cuba.deepCopyNonPersistentReferences application property to true to turn the fix on, because it can be a breaking change if some code expected the old behavior. Starting from 6.9 it will be the default.

2 Likes