<?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="Scene" table="SCENE">
        <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="chapter_id"
            name="chapter"
            class="storybook.model.hbn.entity.Chapter"
            cascade="none"
            lazy="false"
            outer-join="auto"
            insert="true"
            update="true"
        />
        <many-to-one
            column="strand_id"
            name="strand"
            class="storybook.model.hbn.entity.Strand"
            cascade="none"
            lazy="false"
            outer-join="auto"
            insert="true"
            update="true"
        />
        <property
            column="sceneno"
            name="sceneno"
            type="java.lang.Integer"
            insert="true"
            update="true"
        />
        <property
            column="scene_ts"
            name="scenets"
            type="java.sql.Timestamp"
            insert="true"
            update="true"
        />
        <property
            column="title"
            name="title"
            length="2048"
            type="java.lang.String"
            insert="true"
            update="true"
        />
        <property
            column="summary"
            name="summary"
            length="32768"
            type="java.lang.String"
            insert="true"
            update="true"
        />
        <property
            column="status"
            name="status"
            type="java.lang.Integer"
            insert="true"
            update="true"
        />
        <property
            column="intensity"
            name="intensity"
            type="java.lang.Integer"
            insert="true"
            update="true"
        />
       <property
            column="duration"
            name="duration"
            type="java.lang.String"
            insert="true"
            update="true"
        />
        <property
            column="relative_date_difference"
            name="relativeDateDifference"
            type="java.lang.Integer"
            insert="true"
            update="true"
        />
        <property
            column="relative_time"
            name="relativetime"
            type="java.lang.String"
            insert="true"
            update="true"
        />
        <property
            column="relative_scene_id"
            name="relativesceneid"
            type="java.lang.Long"
            insert="true"
            update="true"
        />
        <property
            column="informative"
            name="informative"
            type="java.lang.Boolean"
            insert="true"
            update="true"
        />
        <property
            column="scenario_pitch"
            name="scenario_pitch"
            length="1024"
            type="java.lang.String"
            insert="true"
            update="true"
        />
        <property
            column="scenario_stage"
            name="scenario_stage"
            type="java.lang.Integer"
            insert="true"
            update="true"
        />
        <property
            column="scenario_start"
            name="scenario_start"
            type="java.lang.Integer"
            insert="true"
            update="true"
        />
        <property
            column="scenario_end"
            name="scenario_end"
            type="java.lang.Integer"
            insert="true"
            update="true"
        />
        <property
            column="scenario_moment"
            name="scenario_moment"
            type="java.lang.Integer"
            insert="true"
            update="true"
        />
        <property
            column="scenario_loc"
            name="scenario_loc"
            type="java.lang.Integer"
            insert="true"
            update="true"
        />
        <bag
            name="persons"
            table="scene_person"
            cascade="none"
            lazy="false">
            <key column="scene_id"></key>
            <many-to-many
                column="person_id"
                class="storybook.model.hbn.entity.Person"
                outer-join="auto"
                lazy="false"
            />
        </bag>
        <bag
            name="locations"
            table="scene_location"
            cascade="none"
            lazy="false">
            <key column="scene_id"></key>
            <many-to-many
                column="location_id"
                class="storybook.model.hbn.entity.Location"
                outer-join="auto"
                lazy="false"/>
        </bag>
        <bag
            name="items"
            table="scene_item"
            cascade="none"
            lazy="false">
            <key column="scene_id"></key>
            <many-to-many
                column="item_id"
                class="storybook.model.hbn.entity.Item"
                outer-join="auto"
                lazy="false"/>
        </bag>
        <bag
            name="strands"
            table="scene_strand"
            cascade="none"
            lazy="false">
            <key column="scene_id"></key>
            <many-to-many
                column="strand_id"
                class="storybook.model.hbn.entity.Strand"
                outer-join="auto"
                lazy="false"/>
        </bag>
        <bag
            name="plots"
            table="scene_plot"
            cascade="none"
            lazy="false">
            <key column="scene_id"></key>
            <many-to-many
                column="plot_id"
                class="storybook.model.hbn.entity.Plot"
                outer-join="auto"
                lazy="false"/>
        </bag>
        <property
            column="odf"
            name="odf"
            length="256"
            type="java.lang.String"
            insert="true"
            update="true"
        />
        <many-to-one
            column="narrator_id"
            name="narrator"
            class="storybook.model.hbn.entity.Person"
            cascade="none"
            lazy="false"
            outer-join="auto"
            insert="true"
            update="true"
        />
    </class>
</hibernate-mapping>