I'm using Hibernate 3.2 and have an object model where a class called Track has many time-ordered TrackPoints in a one-to-many relationship. I would like to build a HQL query that would return me a Track object, but with only a subset of its associated TrackPoints based off a Calendar value. I looked through Chapter 14 of Java Persistence with Hibernate, but cannot seem to find a place that addresses queries of this type. Any help would be greatly appreciated.
Here's a pasting of the relevant hbm files:
Code:
<hibernate-mapping>
<class name="Track" table="track">
<id name="id" column="id">
<generator class="assigned"/>
</id>
<list name="trackPoints" cascade="all" lazy="false">
<key column="track_id" not-null="true"/>
<list-index column="point_position"/>
<one-to-many class="TrackPoint"/>
</list>
</class>
</hibernate-mapping>
<hibernate-mapping>
<class name="TrackPoint" table="track_point">
<id name="id" column="id">
<generator class="assigned"/>
</id>
<property name="DTG" type="calendar"/>
<property name="x"/>
<property name="y"/>
<property name="z"/>
</class>
</hibernate-mapping>