Nhibernate subquery with multiple columns join
问题 I have database structure for Plans and PlanVersions in following relationship: +------+ +-------------+ | Plan | --------------> | PlanVersion | +------+ 1 (1..n) +-------------+ PlanVersion is version table tracking all version changes and it have ActiveFromData and ActiveToData columns show us when was this version active. Plan also can have SubPlans which can change in time so PlanVersion also have ParrentPlanId column which tell us what was current subplan for version. What i want is to