<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
                                      http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">

    <entity name="Lexik\Bundle\TranslationBundle\Entity\File"
            table="lexik_translation_file"
            repository-class="Lexik\Bundle\TranslationBundle\Entity\FileRepository">

        <unique-constraints>
            <unique-constraint name="hash_idx" columns="hash" />
        </unique-constraints>

        <lifecycle-callbacks>
            <lifecycle-callback type="prePersist" method="prePersist" />
            <lifecycle-callback type="preUpdate" method="preUpdate" />
        </lifecycle-callbacks>

        <id name="id" type="integer" column="id">
            <generator strategy="IDENTITY" />
        </id>

        <one-to-many field="translations" target-entity="Lexik\Bundle\TranslationBundle\Entity\Translation" mapped-by="file">
            <cascade>
                <cascade-persist/>
            </cascade>
        </one-to-many>

    </entity>
</doctrine-mapping>
