-
Notifications
You must be signed in to change notification settings - Fork 214
/
Train.hbm.xml
36 lines (30 loc) · 1.13 KB
/
Train.hbm.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="org.hibernate.tool.hbm2x">
<class name="Train">
<composite-id name="transportationId" class="TransportationPk">
<key-property name="city" type="string"/>
<key-property name="line" type="string"/>
</composite-id>
<property name="name" unique="true" type="string" not-null="true"/>
<set name="currentPassengers"
inverse="true" cascade="persist,save-update">
<key>
<column name="currentTrainCity"/>
<column name="currentTrainLine"/>
</key>
<one-to-many class="Passenger"/>
</set>
<set name="usualPassengers" table="USUAL_TRAIN" inverse="true">
<key>
<column name="trainCity"/>
<column name="trainLine"/>
</key>
<many-to-many class="Passenger">
<column name="passengerId"/>
</many-to-many>
</set>
</class>
</hibernate-mapping>