<?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 for Person
		Authors:	Rebecca Beale
					Peter Deschere
					Jason Fillo
-->

<hibernate-mapping>
	<class name="src.hibernatebb.discussion.Topic" table="topics">
		<id name="ID" column="topicid" type ="string">
			<generator class="assigned"/>
		</id>
		
		<bag name="posts"
			 order-by="ts"
			 table="posts"
			 cascade="all"
			 inverse="false">
			 <key column="topicID"/>
			 <one-to-many class="src.hibernatebb.discussion.Post"/>
	    </bag>
		<property name="timestamp" column="ts" type="timestamp"/>
		<property name="modified" column="modified" type="timestamp"/>
	</class>
</hibernate-mapping>