<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 2.0//EN" 
    "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping
        auto-import="false"
>
    <class
        name="magoffin.matt.ieat.domain.impl.RecipeImpl"
        table="Recipe"
    >
        <cache usage="read-write" />

        <id
            name="recipeId"
            column="recipeId"
            type="java.lang.Integer"
            unsaved-value="null"
        >
            <generator class="native">
                <param name="sequence">recipe_id_seq</param>
              <!--  
                  To add non XDoclet generator parameters, create a file named 
                  hibernate-generator-params-RecipeImpl.xml 
                  containing the additional parameters and place it in your merge dir. 
              --> 
            </generator>
        </id>

        <many-to-one
            name="owner"
            class="magoffin.matt.ieat.domain.impl.UserImpl"
            cascade="none"
            outer-join="auto"
            update="true"
            insert="true"
            column="owner"
        />

        <property
            name="image"
            type="java.lang.String"
            update="true"
            insert="true"
            column="image"
            length="255"
        />

        <property
            name="excerpt"
            type="text"
            update="true"
            insert="true"
            column="excerpt"
            not-null="true"
        />

        <property
            name="source"
            type="java.lang.String"
            update="true"
            insert="true"
            column="source"
            length="64"
        />

        <many-to-one
            name="course"
            class="magoffin.matt.ieat.domain.impl.CourseImpl"
            cascade="none"
            outer-join="auto"
            update="true"
            insert="true"
            column="course"
        />

        <many-to-one
            name="system"
            class="magoffin.matt.ieat.domain.impl.SystemImpl"
            cascade="none"
            outer-join="auto"
            update="true"
            insert="true"
            column="system"
        />

        <property
            name="directions"
            type="text"
            update="true"
            insert="true"
            column="directions"
        />

        <many-to-one
            name="base"
            class="magoffin.matt.ieat.domain.impl.BaseImpl"
            cascade="none"
            outer-join="auto"
            update="true"
            insert="true"
            column="base"
        />

        <many-to-one
            name="prepTime"
            class="magoffin.matt.ieat.domain.impl.PrepTimeImpl"
            cascade="none"
            outer-join="auto"
            update="true"
            insert="true"
            column="prepTime"
        />

        <many-to-one
            name="ethnicity"
            class="magoffin.matt.ieat.domain.impl.EthnicityImpl"
            cascade="none"
            outer-join="auto"
            update="true"
            insert="true"
            column="ethnicity"
        />

        <property
            name="createdDate"
            type="java.util.Calendar"
            update="true"
            insert="true"
            column="createdDate"
            not-null="true"
        />

        <property
            name="servingSize"
            type="java.lang.Integer"
            update="true"
            insert="true"
            column="servingSize"
            not-null="true"
        />

        <property
            name="name"
            type="java.lang.String"
            update="true"
            insert="true"
            column="name"
            length="128"
            not-null="true"
        />

        <property
            name="modifiedDate"
            type="java.util.Calendar"
            update="true"
            insert="true"
            column="modifiedDate"
        />

        <many-to-one
            name="difficulty"
            class="magoffin.matt.ieat.domain.impl.DifficultyImpl"
            cascade="none"
            outer-join="auto"
            update="true"
            insert="true"
            column="difficulty"
        />

        <list
            name="commentInternal"
            table="Recipe_CommentInternal"
            lazy="false"
            cascade="all-delete-orphan"
            where="CommentInternal_index is not null"
        >

            <key
                column="RecipeImpl_id"
            >
            </key>

            <index
                column="CommentInternal_index"
            />

            <one-to-many
                  class="magoffin.matt.ieat.domain.impl.RecipeCommentImpl"
            />

        </list>

        <list
            name="relatedRecipeInternal"
            table="Recipe_RelatedRecipeInternal"
            lazy="false"
            cascade="all-delete-orphan"
            where="RelatedRecipeInternal_index is not null"
        >

            <key
                column="RecipeImpl_id"
            >
            </key>

            <index
                column="RelatedRecipeInternal_index"
            />

            <one-to-many
                  class="magoffin.matt.ieat.domain.impl.RelatedRecipeImpl"
            />

        </list>

        <list
            name="stepInternal"
            table="Recipe_StepInternal"
            lazy="false"
            cascade="all-delete-orphan"
            where="StepInternal_index is not null"
        >

            <key
                column="RecipeImpl_id"
            >
            </key>

            <index
                column="StepInternal_index"
            />

            <one-to-many
                  class="magoffin.matt.ieat.domain.impl.RecipeStepImpl"
            />

        </list>

        <list
            name="ingredientInternal"
            table="Recipe_IngredientInternal"
            lazy="false"
            cascade="all-delete-orphan"
            where="IngredientInternal_index is not null"
        >

            <key
                column="RecipeImpl_id"
            >
            </key>

            <index
                column="IngredientInternal_index"
            />

            <one-to-many
                  class="magoffin.matt.ieat.domain.impl.RecipeIngredientImpl"
            />

        </list>

        <list
            name="ratingInternal"
            table="Recipe_RatingInternal"
            lazy="false"
            cascade="all-delete-orphan"
            where="RatingInternal_index is not null"
        >

            <key
                column="RecipeImpl_id"
            >
            </key>

            <index
                column="RatingInternal_index"
            />

            <one-to-many
                  class="magoffin.matt.ieat.domain.impl.RecipeRatingImpl"
            />

        </list>

        <!--
            To add non XDoclet property mappings, create a file named
                hibernate-properties-RecipeImpl.xml
            containing the additional properties and place it in your merge dir.
        -->

    </class>

</hibernate-mapping>
