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 Re: jcr-mapping contribution
Date Tue, 12 Sep 2006 14:50:18 GMT
Hi Artem,

Sorry for the delay - Here some comments.

On 8/9/06, Artem Melentyev <amelentev@gmail.com> wrote:

> I'm using ObjectConverter directly without PersistenceManager (it is too
> high-level, and I don't want to add jcrpath field to beens).

Right - Some users want to define the path field and others not.
We should try to solve the solution on the PersistenceManager level
(not on ObjectConverter level). The PeristenceManager API is more
stable. ObjectConverter will maybe changes to support new features.

I'm just wondering why it is not acceptable to add an ID in your
"main" objects. I'm ok that aggregated objects do not need an ID (path
and later UUID) but not the main objects.

Can you clarrify this point - thanks ?

>
> I would like to contribute my small changes. patch relatively svn trunk
> is attached.
>
>  Interface problems if same name siblings used (1,2):
>   1) ObjectConverter.insert method don't returns created Node and
> impossible find it, if where are many nodes with same name.
> I offer:
> public Node insert(Session session, Node parentNode, String nodeName,
> Object object);
>
This is not necessary if we solve your problem on the
PersistenceManager level but that's not a problem to return the
inserted node.

>   2) ObjectConverter.update method uses "parentNode.getNode(nodeName)",
> but if there are many nodes with same name?
> I added following method:
> public void update(Session session, Node objectNode, Object object)
>
>
Is it not working with nodename like 'mynode[2] ?

>  3) I want to store descendants of some class A, the same as A, without
> putting descendants classes in mappings. How to make it?
> I write in ObjectConverterImpl additional methods insert and update with
> additional parameter Class objclass. Maybe there is a way better?
>

In this case, how to map the fields/beans and collections defined in
the descendant class ? We can use the reflection to get the ancestor
and see if a class descriptor exists . If defined, we can use the
ancestor classdescriptor otherwise loop on the ancestor hierarchy
until we found a class descriptor (just an idea).


>   Bugs:
>  4) ObjectConverter.retrieveSimpleFields method:
> in if (classDescriptor.usesNodeTypePerHierarchyStrategy() &&
> classDescriptor.hasDiscriminator())
> writed:
>   String value = node.getProperty(propertyName).getValue().getString();
>
> Why only String? I have a exceptions because it. I think should be:
>

Right your code is more robust. I will apply this patch
For which field type and value you get the exception ?


>
>
>  5) ManageableCollectionUtil.getManageableCollection:
> Why I can't store non standard, but Collection or Set compatible
> classes? (ex: from org.apache.commons.collections)

Not yet used by the team :-) I will apply this patch thanks
-- 
Best regards,

Christophe

Mime
View raw message