This is the main documentation for the gora-couchdb module. gora-couchdb module enables Apache CouchDB backend support for Gora.


Gora CouchDB mappings

You should then create a gora-couchdb-mapping.xml which will describe how you want to store each of your Gora persistent objects:

    <class name="org.apache.gora.examples.generated.Employee" keyClass="java.lang.String" table="Employee">
   		<field name="name"/>
		<field name="dateOfBirth"/>
		<field name="ssn"/>
		<field name="salary"/>
		<field name="boss"/>
		<field name="webpage"/>

Here you can see that we require the definition of two child elements within the gora-otd mapping configuration, namely;

The class element where we specify of persistent fields which values should map to. This contains;

  1. a parameter containing the Persistent class name e.g. : org.apache.gora.examples.generated.Employee ,

  2. a parameter containing the keyClass e.g. java.lang.String which specifies the keys which map to the field values,

  3. finally nested child element(s) mapping fields which are to be persisted into CouchDB. These fields need to be configured such that they receive; a parameter containing the name e.g. (name, dateOfBirth, ssn and salary respectively),