The main component in our framework is the Persistence manager. It converts an object graph into JCR nodes and properties and vice versa.
Thanks to its Mapping Descriptor file, the Persistence Manager can use the more appropriate mapping strategy for each object. This Mapping Descriptor file contains one class descriptor for each mapped class. Each class descriptor contains mapping information for the corresponding class attributes. The descriptor file contains also information on object associations, inheritance mapping strategy, lazy loading, cache strategy, ...
There are 4 attributes/fields "types" :
Of course, all those "mapping types" imply different mapping algorithms.
The mapping descriptor is an xml file with the following structure :
<?xml version="1.0" encoding="UTF-8"?> <graffito-jcr> <class-descriptor className="[Reference to a class to map]" ..."> ... Contains the references to the class attributes ... </class-descriptor> ... other class descritptors .... </graffito-jcr>
The root element is "graffito-jcr" and it contains one or more "class-descriptor". As you can see in the sections "Mapping Strategies" and "Advanced Mapping Strategies", each class-descriptor contains the mapping information used for each class attributes.
It is possible to have severals xml files. See the Sectup section to get more information on how to initialize the Persistence Manager.