Trang

7 thg 7, 2009

nodb - The prevalent object repository.

Introduction

NoDB is a prevalent object repository with indexing capabilities. It is a general purpose in memory repository for use in any Java applications.

In a prevalent model, all the objects are kept in memory in native object format. Although NoDB allows to store the objects in a compressed form. The objects stored in a repository can be queried through the use of indexes, so you dont have to iterate over an object graph any more.

NoDB is built on top of Prevayler and Lucene.
An Example of using NoDB

Using NoDB is simple:

/* Create indexes */
repository.createIndex (Person.class, "name");
repository.createIndex (Person.class, "age");
repository.createIndex (Person.class, "addresses.state");

/* Insert persons */
List persons = getPersons();
repository.store(persons, Repository.INDEX_YES);

/* Query the objects */
QueryCriteria criteria = repository.createCriteria (Person.class);
criteria.where ( and( eq("name", "John"), eq("addresses.state", "Milan") ).orderBy ("age");
Result result = criteria.find();
...

Developed by InnovaSoft - Powered by Lucene

Không có nhận xét nào:

Đăng nhận xét