I used linq, and basically, the query does this:

  * Find me [messages], but add a column that has the last [message-hiastory] 
note for this message that is not null.
  * Then apply query parameters, including searches on the notes column.

This query, even when passed no search params, and limited to 500 rows using 
LINQ takes 70 to 120 seconds.

I am (as I have said) a newbie to LINQ and NHibernate, so that's why I am kind 
of floundering here.  I am however, very
good aty Oracle SQL, so I wrote the query in SQL and it runs in 0.6 seconds. 

I came across CreateSQLQuery in the forums, and it seemed like the way to go, I 
just can't get any data back from it.

---
I tried the page Ricardo Googled for me yesterday, but am a little baffled 
because nowhere in that page does it say
anything like myObject.Propertry = MyISQLQuery.Fieldname.value;  In fact I see 
no way to get any data out of an
ISQLQuery at all.  Unlike with OracleDataReader or SQLDataReader, which just 
works for me.

Whatever is the path of least resistance (and by that I mean that this should 
have taken 4 hours total, not a week), I
will be happy to adjust my approach.





On 1/21/2015 1:02 AM, Oskar Berggren wrote:
> 2015-01-20 19:30 GMT+01:00 Bryan Valencia <[email protected]>:
>
>> property, and NONE of them explain how to go from CreateSqlQuery to
>> List<myObject>.  Perhaps it's my newness to NH, or poor google skills, but I
>> am just getting more mired here.
> Just to check - you do know about the other query methods right? Linq,
> HQL and Criteria queries.
> Using SQL is generally a last-resort for very complex queries.
>
> Do you have your mappings in order?
>
> /Oskar
>


-- 
*Bryan Valencia*
/Owner/
Software Services
916-572-6166 ph.
209-470-5728 cell
http://209software.com/


---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com

-- 
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.
For more options, visit https://groups.google.com/d/optout.

<<attachment: 209software.vcf>>

Reply via email to