Polymorphic FK mapped to field other than ID

Here's the scenario:

I have a table that looks something like:

containers