Relation with entity type and entity id

I have Approval entity and some other approvable entities, e.g. Contract and Tender. Please see these classes in my example app:


(Tender class near contract, but I can leave only 2 links in one post, because I’m new user :laughing:)

Seems to be simple make reference from Contract or Tender to its approvals.

But I want to make also reference from my Approval to my ApprovableEntity. What is the most straightforward way to do it in hibernate?