This really is a question of whether Dali currently works as designed or
if this is a bug.
This behavior has actually recently changed in 2.2 M6, where we have
introduced new Entity Generation from Tables. For this scenario, an
attribute will now be created for the foreign key, and it will be mapped
as a default (basic) mapping. I think this is probably the most
appropriate way to generate the code, but feedback is certainly welcome.