by Vivek Mishra

Feature Kundera GORA Hector
ORM Yes Yes Yes
JPA Compliant Yes No
Annotation Based Yes No Yes
Index Support Yes Yes NO
Second Level Cache Yes(Optional) No No
NoSql Abstraction Yes Yes
Entity relationship


Yes No No
Native query support Yes No No


JPA Compliant& Annotation Based:


Entity Definition:


// makes it an entity class

@ColumnFamily(family="Authors", keyspace="Blog")

// assign ColumnFamily type and name

Public class Author implements Serializable{

/** Theusername. */


// row identifier

String username;

/** The email address. */

@Column(name = "email")

// override column-name

String emailAddress;

/** The country. */


String country;

/** The registered. */

@Column(name = "registeredSince")



Date registered;

/** The name. */

String name;


* Instantiates a new author.


public Author() { // must have a default constructor



@ColumnFamily: Defines column family and keyspace of given entity.

Entity Manager:

Configuration conf = new Configuration();



Persistence and Search Using EntityManager :


     * Test save authors.


     * @throws Exception the exception


Public void testSaveAuthors() throws Exception {

        String key = System.currentTimeMillis() + "-author";

        Author aObj = createAuthor(key, "a@a.org", "India", new Date());


// check if saved?

        Author aObj_db = manager.find(Author.class, key);

        assertEquals(aObj, aObj_db);



     * Creates the author.


     * @param username the user name

     * @param email the email

     * @param country the country

     * @paramregisteredSince the registered since


     * @return the author


Private static Author createAuthor(String username, String email, String country, Date registeredSince) {

        Author author = newAuthor();





       return author;




Entity Definition:

Package com.mycompany.furniture;

Import javax.persistence.Column;

Import javax.persistence.DiscriminatorValue;

Import javax.persistence.Entity;


Public class Chair {


Private Boolean recliner;


Private boolean arms;

Public Boolean isRecliner() {

  return recliner;


Public void setRecliner(boolean recliner) {

  this.recliner = recliner;


Public boolean isArms() {

  return arms;


Public void setArms(boolean arms) {

  this.arms = arms;




Entity Manager:


EntityManagerFactory entityManagerFactory;

entityManagerFactory = Persistence.createEntityManagerFactory(“unit-name”); 

EntityManagerem = entityManagerFactory.createEntityManager();



Persistence and Search Using EntityManager :

    Chair stb = new Chair();





However,HECTOR and KUNDERA both are JPA complined. Additionally Kundera provides a way to search for entities by executing native query(i.e. search by any key)


Native Query(Search by any value):

Query q = entityManager.createQuery(“select a from Author a where         

          a.countrylike :country”);

          q.setParameter(“country”, country);

          List<Author> authors = q.getResultList();


Secondry Index support:Secondry index support is built with in Kundera for Cassandra and as well as for HBase using Lucene.

NoSql abstraction:

With respect to a developer, Kundera and Hector are drop dead simple to use and hides complexity of underlying APIs.

Additional Supports:

1)  Additionally Kundera provides support for relationship between entities.

2)  Second level cache support is provided by Kundera. (Which might be useful for other NoSqls).

Hector looks to me more than Object Mapper. But Kundera is designed and developed keeping ORM and JPA in mind.