Wednesday, June 10, 2009

Sample Hbm File

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

<hibernate-mapping>
<!--
This is a simplified version of the Event class used to
demonstrate proxies.
-->
<class name="Event" table="events">
<id name="id" column="uid" type="long" unsaved-value="null">
<generator class="assigned"/>
</id>
<property name="name" type="string" length="100"/>
<property name="startDate" column="start_date"
type="date"/>
<property name="duration" type="integer"/>
<many-to-one name="location" column="location_id"
class="Location"/>
</class>
</hibernate-mapping>

No comments:

Post a Comment