Code:
Item:
...
<set name="photos" inverse="true">
<key column="item_id" />
<one-to-many class="package.ItemPhoto" />
</set>
...
Profile:
...
<set name="photos" inverse="true">
<key column="profile_id" />
<one-to-many class="package.ProfilePhoto" />
</set>
...
if you want bidirectional, put a one-to-one in photo classes as well:
Code:
ItemPhoto:
...
<many-to-one name="item" class="package.Item" column="item_id" />
...
ProfilePhoto:
...
<many-to-one name="profile" class="package.Profile" column="profile_id" />
...