hibernate composite


<idbag name="departureTimes" fetch="subselect" order-by="DEPARTURE_TIME" table="T_Schedule_DepartureTime">
<collection-id type="long" column="SCH_DT_ID">
<generator class="increment"/>
</collection-id>
<key column="SCH_ID"></key>
<composite-element class="tri.pis.ts.domain.schedule.ScheduleDepartureTime">
<parent name="schedule"/>
<property name="departureTime" column="DEPARTURE_TIME"  not-null="true"/>
</composite-element>
</idbag>


<idbag name="viaCities" fetch="subselect" order-by="SEQ" table="T_Schedule_Via_City">
<collection-id type="long" column="SCH_VC_ID">
<generator class="increment"/>
</collection-id>
<key column="SCH_ID"></key>
<composite-element class="tri.pis.ts.domain.schedule.ScheduleViaCity">
<parent name="schedule"/>
<property name="cityName" column="CITY_NAME" />
<property name="travelTime" column="TRAVEL_TIME" />
<property name="travelMileage" column="TRAVEL_MILEAGE" />
<property name="carfare" column="CARFARE" />
<property name="seq" column="SEQ" />
</composite-element>
</idbag>
<subclass name="CoachSchedule" discriminator-value="Coach">
</subclass>
<subclass name="ShipSchedule" discriminator-value="Ship">
</subclass>

你可能感兴趣的:(Hibernate)