This is the main documentation for the gora-couchdb module. gora-couchdb module enables Apache CouchDB backend support for Gora.
gora.datastore.default=org.apache.gora.couchdb.store.CouchDBStore
- Implementation of the storage classgora.datastore.couchdb.server=localhost
- Property pointing to the host where the server is runninggora.datastore.couchdb.port=5984
- Property pointing to the port where the server is runninggora.datastore.mapping.file=gora-couchdb-mapping.xml
- The XML mapping file to be used. If no value is used this defaults to.You should then create a gora-couchdb-mapping.xml which will describe how you want to store each of your Gora persistent objects:
<gora-otd>
<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"/>
</class>
</gora-otd>
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;
a parameter containing the Persistent class name e.g. : org.apache.gora.examples.generated.Employee ,
a parameter containing the keyClass e.g. java.lang.String which specifies the keys which map to the field values,
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),