About setFirstResult

manual

Setting and Tuning of JPA Queries

Explains various JPA query settings - result range, flush and lock.... the following topics: Result Range (setFirstResult, setMaxResults) Flush Mode (setFlushMode) ... Query Hints Result Range (setFirstResult, setMaxResults) The setFirstResult ...

 
api-jpa

setFirstResult(startPosition)

Set the position of the first result to retrieve.(Method of javax.persistence.TypedQuery)

 
api-jpa

setFirstResult(startPosition)

Set the position of the first result to retrieve.(Method of javax.persistence.Query)

 
forum_thread

Selecting random rows

Hello is there way to get random rows? Functions line rand(), random(), newid() doesn't work ;/ for example: em.createQuery("SELECT s FROM StawkaVat s ORDER BY rand()").setMaxResults(5).getResultList(); gives exception: ... You may use setFirstResult with a random number. ObjectDB ...

 
forum_thread

About LIMIT and OFFSET as query tokens

Hi,   I would like to know why the query tokens OFFSET AND LIMIT are not available and if they will be in a near future. Is there any equivalent way to get, from the database, the object at given position i as well as a given number of objects that follow such object? Thanks you in advance   MiguelGT       Thanks you in advance ... In JPA you specify a result range using setFirstResult and setMaxResults . ObjectDB ...

 
forum_thread

LIMIT or TOP functions

Is there LIMIT or TOP functions in object db? If so can you provide some examples? ... You can set query result range by using the setFirstResult setFirstResult(startPosition) TypedQuery's method Set the position ...

 
api-jpa

javax.persistence.TypedQuery

Interface used to control the execution of typed queries.(Interface of JPA)

 
forum_thread

JPA and handling large data sets

This is not a rellay ObjectDB problem, rather a JPA problem. Our web-based DB supports Hibernate or JPA (ElicpseLink/ObjectDB). We implemented a export/import class to export the whole database or single datasets (domains) in a persistence layer/database independent format. This class works fine - DB exports form a Hibernate/MySQL base via the independent formt to ObjectDB is possible. But exporting large binary data sets is very slow. To avoid memory problems the binary data type is read step by step during the export with the  query/setFirstResult() & setMaxResults().... read step by step during the export with the  query/setFirstResult() & setMaxResults(). But for large data sets the way is ... Using query result range ( setFirstResult , setMaxResults ) for this purpose is indeed inefficient, ...

 
api-jpa

javax.persistence.Query

Interface used to control query execution.(Interface of JPA)

 
forum_thread

Caching/Paging Questions...

Greetings ObjectDB team, All below questions assume a very large database (~1,000,000,000 objects): Q1: Two queries with a big overlap between their result sets. If I query the first set and hold the results in memory somehow, would that speed up the execution of the second query since many of its result objects already created and reside in memory ?... context ? Q4: Would paging result sets via setFirstResult and setMaxResult speed up the query execution since there are ... is no limit on the maximum size of the L2 cache. Using setFirstResult and setMaxResults could improve performance, but the effect is ...