SetEntity

On Thu, Feb 17, 2011 at 1:15 PM, Jason Meckley <[email protected]>wrote:

> criteria (and linq for that matter) work this way. if you want only to
> query Main without part use HQL instead.
>
> var part = session.Load<Part>(partid);
> var main = session
>                     .CreateQuery("from Main where FirstPart = :part")
>                     .SetParameter("part", part)
>                     .SetMaxResults(1)
>                     .UniqueResult<Main>();
>
> also note, i'm using load instead of get for the part. This will reduce the
> number of remote calls by issuing a single query for Main. Not 2 queries: 1
> for part and 1 for main.
>
>  --
> 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.
>



-- 
Fabio Maulo

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