Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Limiting the returned children in a query selecting the parent

Hi Mike,

This should be a FAQ :)

Please see the recent thread "Conditional LEFT JOIN in JPQL".

I would suggest you vote for



On Sat, 15 May 2010 14:58:52 -0700, you wrote:

>I have the following relationship:
>event->source->transaction, where -> represents a bidirectional
>one-to-many relationship.
>I am trying to select the Event object map for which it's related
>transaction.status field = 'FAILED', with that object map containing
>ONLY the transactions that meet that criteria. The following sql is
>select * from event left join source ON = source.event_id left
>join transaction ON = transaction.source_id where
>transaction.status = 'FAILED';
>The following JPQL ends up returning the correct Event, but it also
>contains all it's Transaction children, not just the ones with
>transaction.status = 'FAILED':
>select e FROM Event e LEFT JOIN e.sources s LEFT JOIN s.transactions t
>where t.status = 'FAILED'
>Any idea's?
>eclipselink-users mailing list

Back to the top