I have two classes that are associated with a one-to-one mapping:
<class name="Employee" table="Employees">
...
<one-to-one name="Address" class="AddressInfo">
...
</class>
I would like to use a criteria expression to get only Employees where the the associated Address class is not null, something like this (which I know doesn't work):
IList employeesWithAddresses = sess.CreateCriteria(typeof(Employee))
.Add( Expression.IsNotNull("Address") )
.List();
I guess this is either a really difficult question or almost no one has tried to do this?