2011-02-09 00:05:32 +00:00
|
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
|
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="VideoGameQuotes.Api" namespace="VideoGameQuotes.Api">
|
|
|
|
|
|
2011-02-09 03:41:35 +00:00
|
|
|
|
<class name="Quote" table="game_quote">
|
2011-02-09 00:05:32 +00:00
|
|
|
|
<id column="quote_id" name="Id" type="int">
|
|
|
|
|
<generator class="identity" />
|
|
|
|
|
</id>
|
|
|
|
|
|
2011-02-26 01:22:07 +00:00
|
|
|
|
<property name="text" access="field" column="quote_text" not-null="true" type="string" length="1024"/>
|
2011-02-09 00:05:32 +00:00
|
|
|
|
<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"/>
|
2011-02-23 09:19:32 +00:00
|
|
|
|
<many-to-one name="Game" column="game_id" not-null="true" foreign-key="fk_quote_game" fetch="join" />
|
2011-02-24 01:10:52 +00:00
|
|
|
|
|
2011-02-23 09:19:32 +00:00
|
|
|
|
<!-- denormalization for performance purposes -->
|
2011-02-27 01:41:07 +00:00
|
|
|
|
<property name="Score" column="score" not-null="true" index="idx_score_upvotes" />
|
|
|
|
|
<property name="UpVotes" column="upvotes" not-null="true" index="idx_score_upvotes" />
|
|
|
|
|
<property name="DownVotes" column="downvotes" not-null="true" />
|
|
|
|
|
<property name="FlagCount" column="flag_count" not-null="true" />
|
2011-02-24 01:10:52 +00:00
|
|
|
|
|
2011-02-23 01:30:53 +00:00
|
|
|
|
<set access="nosetter.camelcase" name="Categories" table="quote_category_map">
|
2011-02-12 23:53:43 +00:00
|
|
|
|
<key column="quote_id" />
|
|
|
|
|
<many-to-many class="VideoGameQuotes.Api.Category" column="category_id" />
|
|
|
|
|
</set>
|
2011-02-24 01:10:52 +00:00
|
|
|
|
|
2011-02-19 09:41:09 +00:00
|
|
|
|
<set access="nosetter.camelcase" name="Votes" table="vote" inverse="true" cascade="all-delete-orphan">
|
|
|
|
|
<key column="quote_id" not-null="true" />
|
2011-02-12 23:53:43 +00:00
|
|
|
|
<one-to-many class="VideoGameQuotes.Api.Vote" />
|
2011-02-09 00:05:32 +00:00
|
|
|
|
</set>
|
|
|
|
|
|
2011-02-19 09:41:09 +00:00
|
|
|
|
<set access="nosetter.camelcase" name="Flags" inverse="true" table="quote_flag" cascade="all-delete-orphan">
|
|
|
|
|
<key not-null="true" column="quote_id" />
|
2011-02-12 23:53:43 +00:00
|
|
|
|
<one-to-many class="VideoGameQuotes.Api.QuoteFlag" />
|
2011-02-09 00:05:32 +00:00
|
|
|
|
</set>
|
|
|
|
|
</class>
|
|
|
|
|
|
|
|
|
|
</hibernate-mapping>
|