views:

12

answers:

0

I have a class (Person) that contains an int property (Foo). Another class (FooRange) contains records representing possible ranges of Foo, with high and low boundaries in each row. Think of Foo as a 1 - 100 number and FooRange containing 10 rows, each representing a decile (0-9,10-19,etc.).

How do I structure my NHibernate relationship mapping between Person.Foo and FooRange where there is no explicit value to join on? The SQL would be like so:

JOIN FooRange ON Person.Foo BETWEEN FooRange.Low AND FooRange.High

Assume that the ranges in FooRange are all unique. Thanks, I'm stumped!