I have a parent entity with a collection of details.
Parent
Code:
public class GeneratingUnit : DomainObject<int>
{
private string name;
private string fullName;
private Counterparty counterparty;
private decimal productionCapacity;
private IList<GeneratingUnitProduction> production =
new List<GeneratingUnitProduction>();
...
}
ChildCode:
public class GeneratingUnitProduction : DomainObject<int>
{
private GeneratingUnit generatingUnit;
private DateTime flowDate;
...
}
I want to write a NHibernate query that will return me all the
GeneratingUnits that do not have any production for a given
flowDate.
Can someone demonstrate an example of this query...?
A equivalent query in SQL would like something like:
Code:
SELECT *
FROM Generating_Unit
where generating_unit_id NOT IN
(
SELECT generating_unit_id
FROM generating_unit_production
WHERE Flow_Date = :flowDate
)
Thanks in advance...
Greg