Revision: 4793
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4793&view=rev
Author: fabiomaulo
Date: 2009-10-18 21:21:57 +0000 (Sun, 18 Oct 2009)
Log Message:
-----------
Merge r4792; back port of fix NH-1969 (only the fix, the test is in trunk)
Modified Paths:
--------------
branches/2.1.x/nhibernate/src/NHibernate/Loader/Criteria/CriteriaQueryTranslator.cs
Modified: branches/2.1.x/nhibernate/src/NHibernate/Loader/Criteria/CriteriaQueryTranslator.cs
===================================================================
--- branches/2.1.x/nhibernate/src/NHibernate/Loader/Criteria/CriteriaQueryTranslator.cs 2009-10-18 21:16:47 UTC (rev 4792)
+++ branches/2.1.x/nhibernate/src/NHibernate/Loader/Criteria/CriteriaQueryTranslator.cs 2009-10-18 21:21:57 UTC (rev 4793)
@@ -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);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|