Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Re portQuery vs ReadAllQuery

Hello Daniel,

There is no difference in the queries other than what is being returned.  The problem is the object you are querying also is using fetch joins to other tables(probably on the mappings), which affects the number of rows that are to be returned.  Your query requested to limit the number of rows to 3500, and that is what the SQL is doing, but unfortunately because of the joins, 3500 rows does not mean 3500 DWELLING objects, as some of those returned will be duplicate dwelling rows due to the joins.
This will only work as you expect if you remove the fetch joins that are occurring so that the ReadQuery only selects Dwelling objects.

Best Regards,

On 24/11/2010 6:32 AM, Daniel Rickardsson wrote:
I updated the first post with separate sql.

tch wrote:
What's the SQL that's generated from each look like?


On Mon, Nov 22, 2010 at 12:34 PM, Daniel Rickardsson
<daniel.rickardsson@xxxxxxxxx> wrote:

I have a problem using ReadAllQuery with its pagination functionality.
Let's say that we have 5000 entities in a db over a specific geographic
And if I query with a spatial _expression_ that covers that area and limits
the query (setFirstResult = 1, setMaxRows=3500) then a receive to few
I never get up to 3500 results?

But if I do the same query as above with ReportQuery, but just gets the
of the entities, then the query works fine?

Why is there a difference between these implementations? I should work
same because ReportQuery is just a subclass from ReportAllQuery..
View this message in context:
Sent from the EclipseLink - Users mailing list archive at

eclipselink-users mailing list

eclipselink-users mailing list


Back to the top