If you have an enabled filter on B and you make an explicit join querying A
you will have the result you are looking for.

2009/12/16 Metasharp <[email protected]>

> Hello,
>
> I am trying to use NHibernate to filter access to database data tables
> from different users (technical constraint, I must use a single SQL
> user).
>
> Let say I have a data table A and a datable B.
>
> My user wants to select all on A.... but I want to restrict the
> returned rows only to those where B.A_id = A.id and B.myfield = "test"
>
> I have a lot of data tables and I never know which request my user
> might do using a CreateQuery()...
>
> So I want to preset some filters attached to some data tables that
> should be enabled more or less automatically if those datatables are
> involved. How can I do that?
>
> CreateFilter() seems restricted to a simple where not involving
> another datatable.... not good.
> AddCriteria seems doing a Cartesian product from what I read.... not
> good.
> EnableFilter()..... under investigation...
> SQL parsing when intercepted before execution using IInterceptor
> interface.... but it's just too painful and not elegant.
>
> I tried also to do a posted request "clean" of the data but I can't
> find a method giving me the whole collection before it's returned to
> the user so that I can remove some elements.... and anyway it's not a
> very good idea because my database is huge (more than 2Tb) so it's
> better not to retrieve too many results which could result in "out of
> memory exception".
>
> I can't find any good documentation on this. Any help would be greatly
> appreciated.
>
> --
>
> 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.
>
>
>


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