I have issues with the following:
I have 3 entities (all have primary composite keys):
customer extends relation
Relation has a sqlresultsetmapping with 2 entityResults : Relation and Contacperson.
I execute a nativequery with a resultsetmapping.
This works well and I get a list of Relation and contactperson (via a subselect I only have one contactperson result)
At first I don't have a customer, later I added customer who extends relation and then the native query fails
It works well until I extend customer from relation.
Then I got following error :
an undefined column name was detected
(full stacktrace is in attachment)
I can see that it wants to map to customer instead of relation but I want relations, because there are more relations than just customers in that relation table.
Thus the question is : How can I make the resultset clear that it don't have to get Customer but Relation?