How to join objects on non-primary keys?

Have two objects that link together, but it’s via their non-primary keys. For specific reasons, I’m not able to change the primary key of the objects. So I wanted to to know if there was a way to match using non-primary columns.

You can create a many<>many link that is backed by a join table that maps the pk of each object together (docs).