JPA returns an error, that I can not use AbstractEntity there. But I don't know, which type of entity is returned at this point. I have stored the type in another entity, here I need a reference to the specific instance. But actually the only thing I need is the ID of the instance.
How I can prevent that error?
Exception Description: [class Blubb] uses a non-entity [class AbstractEntity] as target entity in the relationship attribute [field instance]..
Can you explain the relationship a bit or what you are trying to accomplish? It isn't clear why you would want to have Blubb with a 1:1 that can hold any instance, or how you would expect to represent this in the database. When you read in a Blubb, it needs to use that mapping to read in a thing instance, so the type needs to be determined somehow.
If the type is determined somewhere else (I assume you mean other entities are extending Blubb), why not map the 'thing' at those points?