I want to use HQL or criteria API, but PHBs insist we stick with native SQL.
How difficult would this be to fix in the provider for sql server? Thanks
for your response.

On Tue, Mar 3, 2009 at 3:36 PM, Fabio Maulo <[email protected]> wrote:

> I mean... If you want a pure SQL don't use SetMaxResults or SetFirstResult,
> write the full SQL by your self.
> If you want NH doing something, write the SQL in a way NH can understand
> how work with it.
>
> 2009/3/3 Fabio Maulo <[email protected]>
>
> sure it fail.You should use H-SQL if you want that NH do something with
>> your SQL or you should use HQL or Criteria.
>>
>> SELECT {u.*} FROM USER {u} ORDER BY id desc")
>>
>>  For H-SQL :
>> http://nhforge.org/doc/nh/en/index.html#manipulatingdata-nativesql
>>
>> 2009/3/3 Robin Nadeau <[email protected]>
>>
>> In NHibernate 2.0 using SQL Server 2008, if I create a query such as:
>>> Session.CreateSQLQuery("SELECT * FROM USER ORDER BY id
>>> desc").AddEntity(typeof(User).SetMaxResults(100).SetFirstResult(1).List<User>();
>>>
>>> Then the sql statement fails.
>>>
>>> --
>>> Robin Nadeau, B.Eng.
>>> Software Developer
>>>
>>>
>>>
>>
>>
>> --
>> Fabio Maulo
>>
>
>
>
> --
> Fabio Maulo
>
> >
>


-- 
Robin Nadeau, B.Eng.
Software Developer

--~--~---------~--~----~------------~-------~--~----~
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