You are running into this problem because your composite foreign key is another table's composite primary key. This is not a good development practice, which is why it is simply not supported by Doctrine, and I strongly doubt that it ever will be.
Solution 1 (preferred):
Add a single, auto-increment primary key to EstablecimientosSec
. You can then link to that EstablecimientosSec.id
instead.
Solution 2:
If changing the database structure is absolutely not possible, do not map the relationship. Instead, you can fetch the related EstablecimientosSec
entities in a separate query using the composite primary key. It's not a prefect solution, but it works under these constraints. Tip: avoid querying the related objects as part of a loop.