Solutionunvalidated
Make the common superclass an @Entity and use JPA inheritance (e.g., @Inheritance with JOINED/TABLE_PER_CLASS/SINGLE_TABLE) so the container can reference the entity type. Then map the collection as a relationship to the base entity type (or use an association table/discriminator via the chosen inheritance strategy), rather than storing IDs as a workaround.
729c5f20-7c9a-4d9f-9b5e-57fa62f79080
Make the common superclass an @Entity and use JPA inheritance (e.g., @Inheritance with JOINED/TABLE_PER_CLASS/SINGLE_TABLE) so the container can reference the entity type. Then map the collection as a relationship to the base entity type (or use an association table/discriminator via the chosen inheritance strategy), rather than storing IDs as a workaround.