I have a legacy table in which 3 columns are defined. (column names changed for ease).
MANAGER : not-nullable int
TEAMMANAGER : nullable int
TEAMMEMBER: string
If i'm a teammember, all 3 columns are filled. However, my teammanager does not have it's teammember column filled. And his manager has an empty teammanager column as well as an empty teammember column..
I'm trying to map these persons using <sub-classes>
I have defined a composite-ID with a nullableInt32
This actually works. I have a discriminator column and I can select these entities without problems.
However, I have <bag> relations with these types. They are mapped with 3 <column>s but nHibernate does not understand that it should do a nullability compare in the generated SQL.
Generated SQL maps the columns as follows:
[3160] - binding '1' to parameter: 0
[3160] - binding '' to parameter: 1
[3160] - binding null to parameter: 2
.... WHERE Manager=:p0 and TeamManager=:p1 and Teammember=:p2
the first parameter is fine, The second and third I do not get.
Possibly the third will work, I do not know. I can't see the exact SQL as it's sent (??)
But the second will not work for sure..
Is there some way to achieve what I want, or should I really create three seperate entities, with different composite-ID's ?? :x
Regards
|