tags:

views:

32

answers:

0

I have mapped the following collection:

<list name="Media" table="AlbumMedia">
  <key column="Album_id" />
  <index column="Position" />
  <composite-element class="AlbumMedia>
    <parent name="Album" />
    <many-to-one name="Media" column="Media_id" />
  </composite-element>
</list>

I need to find the index of an element within this collection. So for Media of id 54 I want to find out it's index within the collection (without loading the whole collection).

This is obviously stored within the Position column, but how do I query against that column as it is not mapped.