Have inherited classes.
class Base;
class A:Base;
class B:Base;
class C:B;
class D:B;
all classes mapped in one table vary by descriminator.
when load some entity by any Criteria ( CriteriaLoader used ) - all Ok.
but when i try load some entity by Id - have troubles when load
entity A, but provide ID from entity C - expected result is - No records return, but it return record and convert it to A type( Error )
When CriteriaLoader works, it add to Select clause where part:
"AND descriminator_field=descriminator_value "
But with EntityLoader it is not added.
Promlem fixed if replace line:
Code:
return persister.WhereJoinFragment( alias, true, true );
with new one:
Code:
return ( (IQueryable) Persister).QueryWhereFragment( Alias, true, true );
in AbstractEntityLoader file