File tree Expand file tree Collapse file tree 4 files changed +26
-1
lines changed
NHibernate.DomainModel/Northwind Expand file tree Collapse file tree 4 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ public class Animal
19
19
public abstract class Reptile : Animal
20
20
{
21
21
public virtual double BodyTemperature { get ; set ; }
22
+
23
+ public virtual EnumStoredAsString Enum1 { get ; set ; }
22
24
}
23
25
24
26
public class Lizard : Reptile { }
Original file line number Diff line number Diff line change 19
19
<joined-subclass name =" Reptile" >
20
20
<key column =" Animal" />
21
21
<property name =" BodyTemperature" />
22
+ <property name =" Enum1" type =" NHibernate.DomainModel.Northwind.Entities.EnumStoredAsStringType, NHibernate.DomainModel"
23
+ formula =" ('Unspecified')" insert =" false" update =" false" >
24
+ </property >
22
25
23
26
<joined-subclass name =" Lizard" >
24
27
<key column =" Reptile" />
39
42
</joined-subclass >
40
43
</joined-subclass >
41
44
</class >
42
- </hibernate-mapping >
45
+ </hibernate-mapping >
Original file line number Diff line number Diff line change @@ -84,6 +84,19 @@ public void EqualStringEnumTest()
84
84
) ;
85
85
}
86
86
87
+ [ Test ]
88
+ public void SubClassStringEnumTest ( )
89
+ {
90
+ AssertResults (
91
+ new Dictionary < string , Predicate < IType > >
92
+ {
93
+ { "0" , o => o is EnumStoredAsStringType }
94
+ } ,
95
+ db . Animals . Where ( o => o . Children . OfType < Reptile > ( ) . Any ( r => r . Enum1 == EnumStoredAsString . Unspecified ) ) ,
96
+ db . Animals . Where ( o => o . Children . OfType < Reptile > ( ) . Any ( r => EnumStoredAsString . Unspecified == r . Enum1 ) )
97
+ ) ;
98
+ }
99
+
87
100
[ Test ]
88
101
public void EqualsMethodStringTest ( )
89
102
{
Original file line number Diff line number Diff line change 16
16
using NHibernate . Type ;
17
17
using Remotion . Linq . Clauses ;
18
18
using Remotion . Linq . Clauses . Expressions ;
19
+ using Remotion . Linq . Clauses . ResultOperators ;
19
20
using Remotion . Linq . Parsing ;
20
21
21
22
namespace NHibernate . Util
@@ -716,6 +717,12 @@ protected override Expression VisitQuerySourceReference(QuerySourceReferenceExpr
716
717
717
718
protected override Expression VisitSubQuery ( SubQueryExpression expression )
718
719
{
720
+ var ofTypeOperator = expression . QueryModel . ResultOperators . OfType < OfTypeResultOperator > ( ) . FirstOrDefault ( ) ;
721
+ if ( ofTypeOperator != null )
722
+ {
723
+ _convertType = ofTypeOperator . SearchedItemType ;
724
+ }
725
+
719
726
base . Visit ( expression . QueryModel . SelectClause . Selector ) ;
720
727
return expression ;
721
728
}
You can’t perform that action at this time.
0 commit comments