Hi. I am trying to create a copy function that should not only copy a page object itself but also the image objects related to it. I am able to copy the image objects. Also, page object can be copied as well but when combining this with the related images I get this error:
IllegalStateException: During synchronization a new object was found through a relationship that was not marked cascade PERSIST: com.company.test.entity.Image-39a64c7a-6704-9a5f-66b2-2ca787b646e9 [new].
Attached is a test project that contains the extract of my main project and that isolates the problem I am not getting to work around. There is some code for trying alternative solutions but they all end up in the same error.
Any help appreciated.