Hi all.
Can somebody help me?
I have 2 classes: Person and Photo. I map class Person as follows:
Code:
<class name="Person" table="Person">
<id name="ID" type="Int64" column="ID" unsaved-value="0">
<generator class="identity"/>
</id>
<property name="Name" column="Name" />
<bag name="Photos" inverse="true" cascade="all" >
<key column="PersonID"/>
<one-to-many class="Photo"/>
</bag>
</class>
I can get list of Person like this:
Code:
ICriteria c = session.CreateCriteria(typeof(Person));
IList lst = c.list();
But I want the first Persons was Persons who has a photo. How to do it?
Thanks.