Hi Ludek.
Thanks for engaging with this issue. I have stripped back our model until it contains only two entities, and the problem remains.
Here's our model:

The generated XML follows:
<?xml version="1.0"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xsi="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<entity name="Client\NewsBundle\Entity\NewsItem">
<id name="id" type="integer">
<generator strategy="AUTO"/>
</id>
<field name="name" type="string" length="200" nullable="false"/>
<one-to-one field="NewsItemExtra" target-entity="Client\NewsBundle\Entity\NewsItemExtra" mapped-by="NewsItem"/>
</entity>
</doctrine-mapping>
and
<?xml version="1.0"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xsi="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<entity name="Client\NewsBundle\Entity\NewsItemExtra">
<id name="news_item_id" type="integer" association-key="true"/>
<field name="extra_data" type="string" length="200" nullable="false"/>
<one-to-one field="NewsItem" target-entity="Client\NewsBundle\Entity\NewsItem" inversed-by="NewsItemExtra">
<join-columns>
<join-column name="news_item_id" referenced-column-name="id" nullable="false" unique="true"/>
</join-columns>
</one-to-one>
</entity>
</doctrine-mapping>
When I try to generate the entities I get this error:
[Doctrine\ORM\Mapping\MappingException]
No identifier/primary key specified for Entity "Client\NewsBundle\Entity\NewsItemExtra". Every Entity must have an i
dentifier/primary key.
Now, I've taken a look at http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/tutorials/composite-primary-keys.html (the Identity through foreign Entities section) and it says:
The semantics of mapping identity through foreign entities are easy:
Only allowed on Many-To-One or One-To-One associations. Plug an @Id
annotation onto every association. Set an attribute association-key
with the field name of the association in XML. Set a key
associationKey: with the field name of the association in YAML.
In the NewsItemExtra XML if I manually change
<id name="news_item_id" type="integer" association-key="true"/>
to
<id name="NewsItem" type="integer" association-key="true"/>
the entities are generated correctly and things seem to be working again.
Is this a lack of my understanding, or a problem with the generated XML, do you think?
Thanks
Dave