Perfect!  Thanks Milosz.

Not sure about the return address, shouldn't the list server do this for me 
automatically?

-----Original Message-----
From: Miłosz Tylenda [mailto:[email protected]] 
Sent: Saturday, 3 October 2009 4:27 AM
To: [email protected]
Subject: Re: Result limit

Chris,

Have you tried Query.setMaxResults(int)? This should be what you are looking
for.

The mentioned hint has currently effect only with DB2. It appends to the
generated SQL some DB2-specific syntax so that the database knows we are
expecting from the query N rows. The database then can optimize its query plan. 
The
hint does not however change the number of rows returned.

BTW, your mail has Reply-To set to your address, not the list.

Cheers,
Milosz


> Is there any way to limit the size of a result set so that you an specify
> the maximum number of records returned?
> 
>  
> 
> I tried:
> 
>  
> 
> Query.setHint("openjpa.hint.OptimizeResultCount",new Integer(100))
> 
>  
> 
> But the generated SQL has no sign of it. I was expecting the generated SQL
> to include the LIMIT keyword however it doesn't.
> 
>  
> 
> Using OpenJPA 1.2.1 and MySQL 5.
> 
>  
> 
> Chris
> 
> 

Reply via email to