# Keine inheritance mit einer OneToOne EntityExtension des Produkts möglich

**URL:** <https://forum.shopware.com/t/keine-inheritance-mit-einer-onetoone-entityextension-des-produkts-moeglich/90215>\
**Category:** Programmierung\
**Tags:** general, programming\
**Created:** [9. September 2021 um 08:55 UTC](https://forum.shopware.com/t/keine-inheritance-mit-einer-onetoone-entityextension-des-produkts-moeglich/90215 "2021-09-09T08:55:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sawden](https://avatars.discourse-cdn.com/v4/letter/s/4491bb/32.png) [@sawden](https://forum.shopware.com/u/sawden)\
**Post date:** [9. September 2021 um 08:55 UTC](https://forum.shopware.com/t/keine-inheritance-mit-einer-onetoone-entityextension-des-produkts-moeglich/90215/1 "2021-09-09T08:55:26Z")

</div>

Hallo,

ich versuche das Produkt durch eine OneToOne EntityExtension zu erweitern und es scheint auch alles zu funktionieren, nur die Vererbung der Felder an Child Produktvarianten funktioniert auch nach 20 Lösungsansätzen leider nicht.

Mache ich was falsch oder ist eine Vererbung mit OneToOneRelations nicht möglich?

Habe dazu bereits vor ca. einem Monat ein Ticket im Github angelegt und auch ein Repo in dem ich den Fehler nachstelle.

Ich wäre wirklich sehr dankbar für Hilfe jeglicher Art! 😅

Reproduction Reposetory mit SW6 Plugin zum testen des Fehlers:

> **[GitHub - sawden/OneToOneProductExtensionTest: Plugin to test the Shopware 6...](https://github.com/sawden/OneToOneProductExtensionTest)**
>
> Plugin to test the Shopware 6 OneToOne EntityExtension functionality. - GitHub - sawden/OneToOneProductExtensionTest: Plugin to test the Shopware 6 OneToOne EntityExtension functionality.

Github Issue:

> <https://github.com/shopware/platform/issues/2015>
>
> \### PHP Version
> 
> 7.4.22
> 
> \### Shopware Version
> 
> 6.4.3.0
> 
> \### Expected behaviour
> 
> …It should be possible to expand the product with a "OneToOneAssociationField" as described in the \[documentation\](https://developer.shopware.com/docs/guides/plugins/plugins/framework/data-handling/add-complex-data-to-existing-entities#adding-a-field-with-database).
> 
> \*\*\_This error is very critical because none of the plugins that extend the product entity can currently be used.\_\*\* 
> 
> 
> \### Actual behaviour
> 
> Currently, all plugins that extend the product entity with a "OneToOneAssociationField" lead to a 500 error when saving or editing products in the administration.
> 
> An error message appears in the upper corner.
> !\[sw6\_err\](https://user-images.githubusercontent.com/36924392/128963822-7151448e-4aaf-42b9-a64e-181f81e1cb1d.png)
> 
> In the developer tools you can see that there is an Internal Server Error.
> !\[sw6\_err2\](https://user-images.githubusercontent.com/36924392/128963981-3ab40ec4-4a76-47b3-9659-96e994636166.png)
> \`SQLSTATE\[42S22\]: Column not found: 1054 Unknown column 'OTO' in 'field list'\`
> 
> \### How to reproduce
> 
> Create a Plugin that extends the "Product" with a "OneToOneAssociationField" or download/clone my example plugin that reproduce this error.
> 
> \[Github repository here\](https://github.com/sawden/OneToOneProductExtensionTest)
> 
> \- Install the plugin.
> \- Open the administration and edit an existing product (add a space in to the name) or try to create a new product.
> \- Press "Save"
> 
> ...\*\*Internal Server Error\*\*...

---

<div class="post-metadata">

**Author:** ![AlexGalax](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/alexgalax/32/9925_2.png) [@AlexGalax](https://forum.shopware.com/u/AlexGalax)\
**Post date:** [9. September 2021 um 09:05 UTC](https://forum.shopware.com/t/keine-inheritance-mit-einer-onetoone-entityextension-des-produkts-moeglich/90215/2 "2021-09-09T09:05:14Z")

</div>

Also rein von der Logik her würde ich sagen, dass man `OneToOne` gar nicht vererben _kann_. Sobald _mehrere_ Produkte (Varianten) ins Spiel kommen, muss es doch auf einer Seite `Many` sein?

---

<div class="post-metadata">

**Author:** ![sawden](https://avatars.discourse-cdn.com/v4/letter/s/4491bb/32.png) [@sawden](https://forum.shopware.com/u/sawden)\
**Post date:** [9. September 2021 um 09:32 UTC](https://forum.shopware.com/t/keine-inheritance-mit-einer-onetoone-entityextension-des-produkts-moeglich/90215/3 "2021-09-09T09:32:36Z")

</div>

Achso okay das kann natürlich sein.  
Würde auf jeden Fall einiges erklären… 😬  
Ich baue den Spaß dann mal zu einer OneToMany Association zurück und danke dir für den hilfreichen auch wenn einfachen Hinweis! 🙂 👍
