<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>

    <class name="com.wisemapping.model.MindMap" table="MINDMAP">
        <id name="id">
            <generator class="increment"/>
        </id>
        <property name="title"/>
        <property name="public"/>
        <property name="description"/>
        <property name="zippedXml" column="XML"/>
        <property name="lastModifierUser" column="last_editor"/>
        <property name="lastModificationTime" column="edition_date"/>
        <property name="creationTime" column="creation_date"/>
        <property name="tags" column="tags"/>
        <many-to-one name="creator" column="creator_id" unique="true" not-null="true"/>

        <set name="collaborations"
             cascade="all,delete-orphan"
             inverse="true">
            <key column="MINDMAP_ID" not-null="true"/>
            <one-to-many class="com.wisemapping.model.Collaboration"/>
        </set>
    </class>

</hibernate-mapping>