<?xml version="1.0" encoding="UTF-8" ?>

<!--

 This file is part of the Sylius package.

 (c) Sylius Sp. z o.o.

 For the full copyright and license information, please view the LICENSE
 file that was distributed with this source code.

-->

<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping">

    <mapped-superclass name="Sylius\Component\Core\Model\ProductReview" table="sylius_product_review">
        <many-to-one field="reviewSubject" target-entity="Sylius\Component\Product\Model\ProductInterface" inversed-by="reviews">
            <join-column name="product_id" referenced-column-name="id" nullable="false" on-delete="CASCADE" />
        </many-to-one>

        <many-to-one field="author" target-entity="Sylius\Component\Customer\Model\CustomerInterface">
            <join-column name="author_id" referenced-column-name="id" nullable="false" on-delete="CASCADE" />
            <cascade>
                <cascade-persist />
            </cascade>
        </many-to-one>
    </mapped-superclass>

</doctrine-mapping>
