|
From: <fab...@us...> - 2009-10-18 21:16:58
|
Revision: 4792
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4792&view=rev
Author: fabiomaulo
Date: 2009-10-18 21:16:47 +0000 (Sun, 18 Oct 2009)
Log Message:
-----------
Fix NH-1969
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaQueryTranslator.cs
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1969/Fixture.cs
Modified: trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaQueryTranslator.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaQueryTranslator.cs 2009-10-18 20:51:03 UTC (rev 4791)
+++ trunk/nhibernate/src/NHibernate/Loader/Criteria/CriteriaQueryTranslator.cs 2009-10-18 21:16:47 UTC (rev 4792)
@@ -620,12 +620,12 @@
public TypedValue GetTypedValue(ICriteria subcriteria, string propertyName, object value)
{
// Detect discriminator values...
- if (value is System.Type)
+ var entityClass = value as System.Type;
+ if (entityClass != null)
{
- System.Type entityClass = (System.Type)value;
IQueryable q = helper.FindQueryableUsingImports(entityClass.FullName);
- if (q != null)
+ if (q != null && q.DiscriminatorValue != null)
{
// NH Different implementation : We are using strongly typed parameter for SQL query (see DiscriminatorValue comment)
return new TypedValue(q.DiscriminatorType, q.DiscriminatorValue, EntityMode.Poco);
Modified: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1969/Fixture.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1969/Fixture.cs 2009-10-18 20:51:03 UTC (rev 4791)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1969/Fixture.cs 2009-10-18 21:16:47 UTC (rev 4792)
@@ -41,7 +41,7 @@
}
}
- [Test, Ignore]
+ [Test]
public void TestMappedTypeCriteria()
{
using (ISession s = OpenSession())
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|