<?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 repository-class="App\Entity\OccupantRepository" name="App\Entity\Occupant"
            table="occupant">
        <id name="id" type="integer" column="id">
            <generator strategy="IDENTITY"/>
        </id>
        <field name="nom" type="string" column="nom" precision="0" scale="0" nullable="false"/>
        <field name="prenom" type="string" column="prenom" precision="0" scale="0" nullable="false"/>
        <field name="civilite" type="string" column="civilite" precision="0" scale="0" nullable="false"/>
        <field name="tel" type="string" column="tel" precision="0" scale="0" nullable="true"/>
        <field name="dateNaissance" type="datetime" column="dateNaissance" nullable="true"/>
        <field name="type" type="string" column="type" precision="0" scale="0" nullable="false"/>
        <field name="email" column="email" type="string" length="180" nullable="true"/>
        <field name="commentaire" type="text" column="commentaire" nullable="true"/>
        <field name="adresse" type="string" column="adresse" length="255" precision="0" scale="0" nullable="true"/>
        <field name="nomContact" type="string" column="nomContact" length="255" precision="0" scale="0" nullable="true"/>
        <field name="prenomContact" type="string" column="prenomContact" length="255" precision="0" scale="0" nullable="true"/>
        <field name="adresseContact" type="string" column="adresseContact" length="255" precision="0" scale="0" nullable="true"/>
        <field name="telContact" type="string" column="telContact" length="255" precision="0" scale="0" nullable="true"/>
        <field name="mailContact" type="string" column="mailContact" length="255" precision="0" scale="0" nullable="true"/>
        <field name="dateDebut" type="datetime" column="dateDebut" nullable="true"/>
        <field name="dateFin" type="datetime" column="dateFin" nullable="true"/>
        <field name="photo" type="string" column="photo" length="255" nullable="true"/>
        <many-to-one field="structure" target-entity="App\Entity\Structure" fetch="LAZY">
            <join-columns>
                <join-column name="structure_id" referenced-column-name="id" nullable="true"/>
            </join-columns>
        </many-to-one>
        <many-to-one field="departement" target-entity="App\Entity\Departement" fetch="LAZY">
            <join-columns>
                <join-column name="departement_id" referenced-column-name="id" nullable="true"/>
            </join-columns>
        </many-to-one>
        <many-to-one field="espace" target-entity="App\Entity\Espace" fetch="LAZY">
            <join-columns>
                <join-column name="espace_id" referenced-column-name="id" nullable="true"/>
            </join-columns>
        </many-to-one>
        <one-to-one field="repas" target-entity="Repas" inversed-by="occupant">
            <cascade><cascade-remove/></cascade>
            <join-column name="repas_id" referenced-column-name="id" on-delete="CASCADE" nullable="true"/>
        </one-to-one>
    </entity>
</doctrine-mapping>
