incubator-graffito-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christophe Lombart" <christophe.lomb...@gmail.com>
Subject JCR Inheritance mapping : NodeType per hierarchy
Date Tue, 14 Mar 2006 09:03:05 GMT
Alex,

I'm building some unit tests for the inheritance mapping strategies.
For the Node Type per hierarchy, I would like to check with you the
following points. Let me know if you are not agree.

1/ if the path field is defined in the ancestor class, it is not
necessary to redefine it in the descendants.

2/ It is  possible to use an ancestor class to retrieve an object - Eg. :
We have an ancestor  class CmsObject and 2 descendant classes : 
Folder and Content. than we can do :

CmsObject object = (CmsObject)
persistenceManager.getObject(CmsObject.class,"/folder1");

the node "/folder1" is associated to the class Folder, than the
variable "object" point to a object based on the Folder class. Of
course, the getObject will never returns an object build with the
Ancestor class.

Of course, it is also possible to do :
Folder object = (Folder) persistenceManager.getObject(Folder.class,"/folder1");


Same behaviour for collection retrieve. It is possible to make queries like :
"Get a collection of CmsObject which the title contains "JCR".  The
collection items are either build with Folder or Content class (and of
course never with CmsObject).

--
Best regards,

Christophe

Mime
View raw message