How to model a relationship with variable tables (polymorphism)? What is the best way to model the following kind relationship?

Let's say I have tables representing two types of entities: company and person. I have a customer table with an entity_id field, which should refer to either a company or a person.

If I simply store a company_id or a person_id in entity_id then I won't know which table to look up the entity in. The first solution which has occurred to me is to have a entity_type field in customer which would take the values "company" or "person" to tell me which table my foreign key in entity_id refers to. I'm not sure if this is the best way though.

This seems like it should be a fairly common problem in database design, so I'm hoping there is a design pattern I can adopt.

I've used the word polymorphism in the title in the broader sense, so I'm not referring to inheritance. In my example, a company is not a person (or vice versa) but they are still interchangeable. Other questions I've found on Stack Exchange sites have assumed inheritance is also a requirement, so I'm not sure that there is a suitable duplicate.
There seem to be 2 main ways to model such a situation: 

(1) Use supertype/subtypes.  However, as we are not discussing "object oriented" design, the second option may be a bit more appropriate. 

(2) Use a so-called ARC, which expresses a XOR relationship. 

Suppose we have an entity TRANSACTION.  Each customer can be involved in one ore more transactions AND a customer is either a COMPANY or a PERSON (XOR).
Our ERD/relational model could look something like the ones below.  Notice the "arc", that is drawn across both relationships.




As for the implementation: you can code a CHECK constraint (in order to avoid triggers), which will enforce the XOR (exclusive or).  The complete DDL code looks something like this (notice the CHECK):

CREATE TABLE company ( 
  c_id NUMBER PRIMARY KEY
);

CREATE TABLE person ( 
  p_id NUMBER PRIMARY KEY
);

CREATE TABLE transaction ( 
  t_id NUMBER PRIMARY KEY
, c_id NUMBER 
, p_id NUMBER
);

ALTER TABLE transaction 
ADD CONSTRAINT fkarc CHECK (
     ( (c_id IS NOT NULL) AND (p_id IS NULL) ) 
  OR ( (p_id IS NOT NULL) AND (c_id IS NULL) ) 
);

ALTER TABLE transaction
ADD CONSTRAINT transaction_company_fk 
FOREIGN KEY ( c_id ) REFERENCES COMPANY ( c_id ) ;

ALTER TABLE transaction
ADD CONSTRAINT transaction_person_fk
FOREIGN KEY ( p_id ) REFERENCES PERSON ( p_id ) ;


(Tested on Oracle 12c)