Product overview > Tutorials, examples, and samples



ObjectQuery tutorial

With the following steps, you can develop a local in-memory ObjectGrid that can store order information for a Web site, and demonstrate how to use ObjectQuery to query the data in the grid.


Before you begin

Be sure to have objectgrid.jar file in the classpath.

Each step in the tutorial builds on the previous step. Follow each of the steps to build a simple Java™ Platform, Standard Edition v1.4 (or later) application that uses an in-memory, local ObjectGrid.


Procedure

  1. ObjectQuery tutorial - step 1

    • How to create a local ObjectGrid

    • How to define a schema for a single object using field-access

    • How to store the object

    • How to query the object with ObjectQuery

  2. ObjectQuery tutorial - step 2

    • How to create an index that the query can use

  3. ObjectQuery tutorial - step 3

    • How to create a schema with two related entities

    • How to store objects with a foreign-key reference between them

    • How to query the objects using a single query with a JOIN

  4. ObjectQuery tutorial - step 4

    • How to create a schema with multiple related entities

    • How to use method or property access instead of field access

  1. ObjectQuery tutorial - step 1
    With the following steps, you can continue to develop a local, in-memory ObjectGrid that stores order information for an online retail store using the ObjectMap APIs. You define a schema for the map and run a query against the map.

  2. ObjectQuery tutorial - step 2
    With the following steps, you can continue to create an ObjectGrid with one map and an index, along with a schema for the map. Then you can insert an object into the cache and later retrieve it using a simple query.

  3. ObjectQuery tutorial - step 3
    With the following step, you can create an ObjectGrid with two maps and a schema for the maps with a relationship, then insert objects into the cache and later retrieve them using a simple query.

  4. ObjectQuery tutorial - step 4
    The following step shows how to create an ObjectGrid with four maps and a schema for the maps with multiple uni-directional and bi-directional relationships. Then you can insert objects into the cache and later retrieve them using several queries.


Parent topic:

Tutorials, examples, and samples


Related concepts

Java object caching concepts

Maps

Interacting with an ObjectGrid using the ObjectGridManager

Cache objects with no relationships involved (ObjectMap API)

Cache objects and their relationships (EntityManager API)


Related tasks

Connect to a distributed ObjectGrid

Configure grids

Configure entities