<?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="net.sf.ehcache.hibernate.domain.Event" table="EVENTS">
		<cache usage="read-write" />
		<id name="id" column="EVENT_ID">
			<generator class="native" />
		</id>
		<property name="date" type="timestamp" column="EVENT_DATE" />
		<property name="title" />
		<many-to-one name="organizer" column="EVENT_ORGANIZER" class="net.sf.ehcache.hibernate.domain.Person"/>

		<set name="participants" table="PERSON_EVENT" lazy="false"
			inverse="true" cascade="lock">
			<cache usage="read-write" />
			<key column="EVENT_ID" />
			<many-to-many column="PERSON_ID"
				class="net.sf.ehcache.hibernate.domain.Person" />
		</set>
	</class>

</hibernate-mapping>
