Which query has better performance?
Often the simplest way to express the query will perform the best.

The following query should be close to optimal:

select e.id
from entry e
join class c on c.id = e.cid 
join principal p on p.id = e.pid
where e.object_id = 45
and c.name = 'Class#3'
and (p.id = 2 and p.role or p.id = 3 and !p.role);


But a lot depends on your data and your indexing. Compare execution plans to be sure.