You can only perform outer joins in HQL with mapped properties, not with 
arbitrary HQL. For example, if you have a Person and this Person has a 
possible null Address, you can perform a left join with this Address 
property.

RP


On Friday, May 10, 2013 2:57:44 PM UTC+1, Teja Puppala wrote:
>
> select * from tempdata tmp
> left outer join (select * from datalist dl where dl.lang = 'fr') datalst 
> on tmp.Id = datalst.Id
> inner join datalist dlist on tmp.Id = dlist.Id
> where dlist.lang='en'                                           
>
> this query returns my expected result and i wrote the same in HQL 
> nHibernate in asp.net c#
>
> from tempdata tmp
> left outer join fetch (from datalist dl where dl.lang='fr') datalst 
> inner join fetch tmp.datalists dlist 
> where dlist.lang='en'
>
> this query throws me an exception "failed: 
> NHibernate.Hql.Ast.ANTLR.QuerySyntaxException : Exception of type 
> 'Antlr.Runtime.NoViableAltException' was thrown."
>
> Any suggestions please.
>
> On Thursday, May 9, 2013 3:02:27 PM UTC-4, Ricardo Peres wrote:
>>
>> But where are the queries?
>>
>> On Thursday, May 9, 2013 5:23:13 PM UTC+1, Teja Puppala wrote:
>>>
>>> Hi all,
>>>
>>> I am trying to write an HQL(Hibernate Query Language) in NHibernate 
>>> which should return both null and not null records. I tried a SQL statement 
>>> which satisfies the conditions and tried to implement the same in LINQ in 
>>> NHibernate(RESULT:- Failure)
>>> And the same with HQL in NHibernate(RESULT:- Failure)
>>>
>>> Any suggestions please.
>>>
>>> Note:- I am using left outer join(has a condition that should satisfy) 
>>> and inner join(has a different condition) on a single table.
>>>
>>

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


Reply via email to