Hi Ramiro,

I think you can build your Expression such that the relationship from A to
B is null:

ExpressionFactory.matchExp(A.TO_B_PROPERTY, null)

(change the name of the entity/property as appropriate)

mrg



On Wed, Jan 30, 2013 at 12:01 PM, Ramiro Aparicio <
[email protected]> wrote:

> Hi,
>
> An easy question, I want to know all elements of table A that does NOT
> have a relationship with table B
> A->B 1:N so A id is stored on B
>
> In plain SQL I am using:
> "select * from A where idA not in (select idA from B);"
> It is not really nice, but works
>
> But using a Expressions seems a lot harder, I don't find anything like
> that, sure we have notInExp but I don't see a way to set the path to the
> entity it self, and having to extract all idA to use it with notInDbExp
> seems very ugly (if idA is exposed on A).
>
> I know I can go and just use plain SQL, just for knowledge I would want to
> now if something as "simple" is impossible to be queried using Expressions
>
> Ramiro Aparicio
>

Reply via email to