JPOX
JPOX
 Project  |  Ver 1.1  |  Ver 1.2  |  JDO  |  JPA  |  Guides  |  Tools
1.2 | Persistence | JDO ORM | JPA ORM | Runtime | JDO Runtime | JPA Runtime | Extensions | Developer
JPOX Runtime
RDBMS Datastores
DB4O Datastore
DB4O Queries

Using a DB4O datastore JPOX allows you to query the objects in the datastore using the following

  • JDOQL - language based around the objects that are persisted and using Java-type syntax
  • Native - DB4Os own type-safe query language

It is hoped to provide more options in the future.

When using queries with DB4O there are some specific situations where it can be useful to benefit from special treatment. These are listed here.

Flush changes before execution

When using optimistic transactions all updates to data are held until flush()/commit(). This means that executing a query may not take into account changes made during that transaction in some objects. JPOX allows a convenience of calling flush() just before execution of queries so that all updates are taken into account. The property name is org.jpox.query.flushBeforeExecution and defaults to "false".

To do this on a per query basis for JDO2 you would do

query.addExtension("org.jpox.query.flushBeforeExecution","true");

To do this on a per query basis for JPA1 you would do

query.setHint("org.jpox.query.flushBeforeExecution","true");

You can also specify this for all queries using a persistence property org.jpox.query.flushBeforeExecution which would then apply to ALL queries for that PMF/EMF.