You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by karl wettin <ka...@gmail.com> on 2007/07/21 14:18:58 UTC

[ANN] Limax 0.2

Limax is a Java 1.5 @annotation library for object oriented Lucene  
applications,
distributed under the Apache2 Licence.

The API is inspired by the Sleepycat BDB implementation.
It can do pretty much anything Hibernate can, and more.

  * Binds Java classes to the UML 1.4 class model semantics.
  * Mappable in root or static inner interfaces, abstract and  
concrete classes.
  * Lazy loading transactional object persistency using Lucene as  
storage.
  * Tokenization of class attributes.
  * Denormalization of aggregated class associations.

Depends on plain old Lucene, Silvertejp meta models and ASM.

There are no benchmarks available. Hint: <http://images.google.com/ 
images?q=limax>

mvn: <http://www.ginandtonique.org/~kalle/maven2/>
cvs: <http://silvertejp.tigris.org/source/browse/silvertejp/>  
(temporary hosting)
doc: <http://projects.ginandtonique.org/projects/limax> (currently  
outdated)

There are lots of well documented test cases that demonstrate how to  
use the API,
but if you rather ask questions I'll be happy to help you out.

It is still in beta state.


Very simple example:

void test() {
   EntityStore store = new EntityStore(new RAMDirectory());
   Transaction txn = store.newTransaction();
   Company c = new Company("Bluff bros");
   store.getPrimaryEntityIndex(Company.class).put(txn, c);
   Human h = new Human("Johnny");
   h.setEmployer(c);
   store.getPrimaryEntityIndex(Human.class).put(txn, h);

   // queries the transient entities in the transaction
   // and the persistent entities in the store.
   assertEquals(1, txn.getSearcher().search(new TermQuery(new Term 
("name", "Johnny"))).length());

   assertTrue(c.getEmployees().contains(h));
   txn.commit(); // merges transaction index with store index
   txn.close();  // you can also reuse() a transaction to avoid read  
the data.

   txn = store.newTransaction();
   Company d = store.getPrimaryEntityIndex(Company.class).get(txn, 0l);
   assertEquals(c, d);
   txn.close();

}

@Entity
class Company {
   @ObjectIdentity @Attribute
   long oid;

   @Attribute @StandardTokenized
   String name;

   @BinaryAssociationEnd(otherEndName = "employer")
   List<Human> employees = new ArrayList<Human>

   ..getters and setters
}

@Entity
class Human {
   @ObjectIdentity @Attribute
   long oid;

   @Attribute @StandardTokenized
   String name;

   @BinaryAssociationEnd(otherEndName = "employees")
   // adds Company.name in Human instance documents.
   @Denormalization(xpaths = "name")
   Company employer;

   ..getters and setters
}





---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org