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

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


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

./tch



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

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
area.
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
posts.
I never get up to 3500 results?

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

Why is there a difference between these implementations? I should work
the
same because ReportQuery is just a subclass from ReportAllQuery..
--
View this message in context:
http://old.nabble.com/ReportQuery-vs-ReadAllQuery-tp30280826p30280826.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

      
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


    
  

Back to the top