Hi All,
I commit new features in the JCR Mapping prototype (with some
limitations see the todos below) :
* Get/insert/update any kind of POJO.
* Manage simple/primitive bean attributes.
* Manage object graph persistence (1..1 association and 1..n
association) - with some limitation - see the todos here. I made this
code quickly, we have to review it in order to support different
mapping strategies for collection/map based field.
What are the most important files to read ?
----------------------------------------------------------
* The mapping file used for the unit tests : src\test\jcrmapping.xml
* The mapping object model : see the pck :
org.apache.portals.graffito.jcr.mapper.model
* The unit test :
src\test\org\apache\portals\graffito\jcr\session\impl\JcrSessionTest.java
* The session object & the generic converter : see the pck
org.apache.portals.graffito.jcr.session.impl and the class
org.apache.portals.graffito.jcr.converter.impl.GenericConverter
Here is the "todos" :
------------------------------
* Define the DTD and write the mapping file doc. The prototype should
help to build the final DTD.
* Simple fields : support all kind of object (String, Long, Double,
Date, ... and primitive data types).
* Better management for collection/Map fields :
- Support any kind of Collection & Map
- Support different mapping strategies - I can explain in more details.
- Collection update :
* Update existing elements
* Remove nodes matching to dropped collection items
* Add new nodes matching to new collection items.
* proxy / Lazy loading
* auto-update for bean field and collection fields.
* cache management.
* Fine grained access control (has to check how Jackrabbit manages
access control).
* Add referenceDescriptor (in order to link to parent path, ...)
* Tools :
* The node type registration - generate node type from the
mapping file (could be an external tools).
* generate pojo java files from the mapping file (could be an external
tools).