If you provide your mappings then I can give you a proper example. Without
mappings the idea is to create a criteria to return the Networks object and
alias the UserNetworksXref and then select where UserNetworksXref.User =
User

John Davidson

On Sun, May 2, 2010 at 4:51 PM, Kevin Pang <[email protected]> wrote:

> I have two tables, Users and Networks, with a many-to-many
> relationship table UserNetworks to indicate which Users are in which
> Networks. I do not have a UserNetwork class to correspond to the
> UserNetworks table.
>
> How can I construct a query using the Criteria API to retrieve all
> Networks that belong to a User?
>
> I'm aware that I can simply load up a User first, then traverse over
> its Networks property, but I was wondering how you would do it if you
> wanted to do it via a query instead.
>
> --
> 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]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>
>

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