vgquotes/Src/VideoGameQuotes.Api/Mappings/Quote.hbm.xml
2011-02-09 00:05:32 +00:00

27 lines
1.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="VideoGameQuotes.Api" namespace="VideoGameQuotes.Api">
<class name="Quote" table="quote">
<id column="quote_id" name="Id" type="int">
<generator class="identity" />
</id>
<property name="Text" column="quote_text" not-null="true" type="string" length="1024"/>
<property name="Created" column="created" not-null="true" type="DateTime" />
<property name="Modified" column="modified" not-null="false" type="DateTime" />
<many-to-one name="Creator" column="creator" not-null="true" foreign-key="fk_quote_user"/>
<many-to-one name="Game" column="game_id" not-null="true" foreign-key="fk_quote_game" />
<set access="field" name="votes" table="vote" cascade="all-delete-orphan">
<key column="quote_id" />
<one-to-many class="Vote" />
</set>
<set access="field" name="flags" table="quote_flag" cascade="all-delete-orphan">
<key column="quote_id" />
<one-to-many class="QuoteFlag" />
</set>
</class>
</hibernate-mapping>