I had the same problem passing from 1.2 to 2.1

I solved using the old hql translator
<property
name="query.factory_class">NHibernate.Hql.Classic.ClassicQueryTranslatorFactory,
NHibernate</property>

I guess that is a Nhibernate limit

On 16 Mag, 23:36, Ryan <[email protected]> wrote:
> Hello all,
>
> I am attempting to upgrade our product from NHibernate 1.2 to
> NHibernate 3.1 and ran into an issue with the translator.
>
> The following HQL is translated into the resulting sql.
>
> HQL
> select b.Property.Name
> from BuildingVO b
> left outer join b.Property
>
> SQL
> select propertyvo2_.NAME as col_0_0_
> from BLDG buildingvo0_
> left outer join Property propertyvo1_ on
> buildingvo0_.PROPERTY_ID=propertyvo1_.ID
> , Property propertyvo2_
> where buildingvo0_.REF_TYPE='B' and
> buildingvo0_.PROPERTY_ID=propertyvo2_.ID
>
> When I rewrite the HQL to this it translates as I would expect.
>
> HQL
> select p.Name
> from BuildingVO b
> left outer join b.Property p
>
> SQL
> select propertyvo1_.NAME as col_0_0_
> from BLDG buildingvo0_
> left outer join Property propertyvo1_ on
> buildingvo0_.PROPERTY_ID=propertyvo1_.ID
> where buildingvo0_.REF_TYPE='B'
>
> This would not be an issue if the HQL product was designed with this
> in mind but now there are potentially thousands of hql statements that
> might have this issue with no way to find the problem without looking
> through all of the HQL's individually.
>
> Is this an issue that could potentially get patched or is there
> another work around besides manually finding and fixing all of the
> queries?

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to