Ooops - I'm very sorry, the OCM unit tests are in :
/jcr/jcr-mapping/src/test (not in /components/src/test)
I think this week-end will be a great benefit for myself.

Anyway, here is some info :

What is the "folder" instance in this case? Is it a plain data object
or an adapter to an underlying folder concept?


it points to  a plain data object. A usual pojo  with simple
getters/setters.



Can I implement my own Folder class and pass instances of it to the
persistence layer?


yes but you have to specify the interface "Folder" and  the class "MyFolder"
it in the mapping file.

Do you know this page :
http://incubator.apache.org/graffito/jcr-mapping/index.html ? the is the doc
on the OCM tools.  Unfortunatly, this is not complete.

This one show you some basic operations :
http://incubator.apache.org/graffito/jcr-mapping/api/basic-operations.html.




When I retrieve that folder from the persistence layer, will it still
be an instance of the MyFolder class?


Yes. The persistence manager can support interfaces. So, you can make some
queries based on a interface. In this case, you will receive implemented
object which match to the criteria.

I think there are good examples in the unit tests.

Sorry again for the bad reference on the unit test location.  See in
jcr/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence which
contains the API unit tests.
--
Best regards,

Christophe

Reply via email to