Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
3.0
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="Cinema">
<id name="id" column="id">
<generator class="identity"/>
</id>
<many-to-one name="cinemaGroup"
class="CinemaGroup"
column="cinemagroup_id"
not-null="true"
/>
<many-to-one name="address"
class="Address"
column="address_id"
not-null="true"
cascade="save-update"
/>
<bag name="nearestCinemas" lazy="true">
<key column="id"/>
<one-to-many class="CinemaDistance"/>
</bag>
<property name="name" not-null="true" />
<property name="contactName" />
<property name="telephoneNumber" />
<property name="customerNumber" />
<property name="emailAddress" />
<property name="mapReference" />
<property name="otherCustomerInformation" />
<property name="carParkingId" not-null="true" />
<property name="disabledOptionsId" not-null="true" />
</class>
</hibernate-mapping>
MySQL 4.0
Hi,
I have a schema query. I am trying to model the following in Hibernate: I have a Cinema object (as mapped above). I want to have a look up table that contains two cinema id's (fromCinema and toCinema) and the distance between then (as a float). So for example:
Cinema Table:
id (PK)
name
emailaddress
CinemaDistance Table:
fromId (FK of Cinema.id)
toId (FK of Cinema.id)
distance (float)
I'm not sure how to define the CinemaDistance object in Hibernate. Is this posible?