Hi,
When I am removing a record from the list page it shows the following exception.
ClassCastException: org.eclipse.persistence.internal.indirection.jdk8.IndirectList cannot be cast to com.haulmont.cuba.core.entity.Entity
In our application there is an Institute entity which is associated to employee with one to many relation and with the same entity with many to one relation.
The design is for one Institute can have child institutes and all institute has it’s own employees. I created a parent institute and associate it to a child institute. I get the above exception while removing the child institute or parent institute. It works perfectly if the parent and child institutes are not related to each other.
We are using CUBA 6.2.3 and MySQL database. Also we have configured the application to support soft delete.
Hi
I am trying to reproduce the issue with different combination of screen parameters, but the specified fault does not appear.
It seems some significant details of your configuration are missed.
Could you prepare an example project in which the described exception could be observed and share it here?
Hi I am attaching a similar demo project with this comment. I am also attaching the screen-shot of the exception.
Please help me to fix the issue.
Steps to reproduce.
Create one Institute. Say University
Create another Institute : say Technical Institute with parent as University
Create another Institute: say Computer Science Institute with parent as Technical Institute
Now try to remove University or Technical Institute.
You will find the
ClassCastException: org.eclipse.persistence.internal.indirection.jdk8.IndirectList cannot be cast to com.haulmont.cuba.core.entity.Entity
Hi
The Entity “Institution” in your project has ONE_TO_MANY relation to itself. So it has “children” and “parentInstitute” attributes.
Both attributes have On delete = CASCADE. This is meaningless.
Try to set On delete = CASCADE only for one of these attributes (leave empty for the other) and the fault should disappear.