<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "classpath://org/hibernate/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="storybook.model.hbn.entity">
    <class name="Person" table="PERSON">
        <id
            column="ID"
            name="id"
            type="java.lang.Long"
            unsaved-value="null">
            <generator
                class="increment">
            </generator>
        </id>
        <!-- common data -->
        <property
            column="creation"
            name="creation"
            type="java.lang.String"
            insert="true"
            update="true"
        />
        <property
            column="maj"
            name="maj"
            type="java.lang.String"
            insert="true"
            update="true"
        />
        <property
            column="name"
            name="name"
            length="256"
            type="java.lang.String"
            insert="true"
            update="true"
        />
        <property
            column="description"
            name="description"
            length="32768"
            type="java.lang.String"
            insert="true"
            update="true"
        />
        <property
            column="notes"
            name="notes"
            length="32768"
            type="java.lang.String"
            insert="true"
            update="true"
        />
        <property
            column="assistant"
            name="assistant"
            length="32768"
            type="java.lang.String"
            insert="true"
            update="true"
        />
        <!-- specific data -->
        <many-to-one
            column="gender_id"
            name="gender"
            cascade="none"
            class="storybook.model.hbn.entity.Gender"
            lazy="false"
            outer-join="auto"
            insert="true"
            update="true"
        />
        <property
            column="firstname"
            name="firstname"
            length="256"
            type="java.lang.String"
            insert="true"
            update="true"
        />
        <property
            column="lastname"
            name="lastname"
            length="256"
            type="java.lang.String"
            insert="true"
            update="true"
        />
        <property
            column="abbreviation"
            name="abbreviation"
            length="256"
            type="java.lang.String"
            insert="true"
            update="true"
        />
        <property
            column="birthday"
            name="birthday"
            type="java.util.Date"
            insert="true"
            update="true"
        />
        <property
            column="dayofdeath"
            name="dayofdeath"
            type="java.util.Date"
            insert="true"
            update="true"
        />
        <property
            column="occupation"
            name="occupation"
            length="256"
            type="java.lang.String"
            insert="true"
            update="true"
        />
        <property
            column="color"
            name="color"
            type="java.lang.Integer"
            insert="true"
            update="true"
        />
        <many-to-one
            column="category_id"
            name="category"
            class="storybook.model.hbn.entity.Category"
            cascade="none"
            lazy="false"
            outer-join="auto"
            insert="true"
            update="true"
        />
        <bag
            table="person_attribute"
            name="attributes"
            cascade="none"
            lazy="false">
            <key
                column="person_id">
            </key>
            <many-to-many
                class="storybook.model.hbn.entity.Attribute"
                column="attribute_id"
                outer-join="auto"
            />
        </bag>
        <bag
            table="person_categories"
            name="categories"
            cascade="none"
            lazy="false">
            <key column="person_id">
            </key>
            <many-to-many
                column="category_id"
                class="storybook.model.hbn.entity.Category"
                outer-join="auto"
            />
        </bag>
    </class>
</hibernate-mapping>
