Hi,
I have been facing this issue for a long time now. While writing custom controller I am having 2 types of response:
- List of entities
- Custom POJO which itself may contain list of T extends standard entity
In both above cases if I just return as it is from controller I get errors like:
Could not write JSON: Cannot get unfetched attribute [tenant] from detached object com.leapmile.qikpod.entity.Organization-d9ee0db9-1511-19a0-dd23-4489e0401bbd [detached].; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Cannot get unfetched attribute [tenant] from detached object com.leapmile.qikpod.entity.Organization-
where tenant is an attribute which is not part of the view I specified. Now for case 1 above if I use entitySerializationApi.toJson it starts working but for case 2 I am not sure how to proceed.
Not sure if duplicate but I found a related issue https://youtrack.cuba-platform.com/issue/PL-9256 which is marked as closed in 6.6 while I am facing this on 6.9.1
Thanks