You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Vincent Giguère (JIRA)" <ji...@apache.org> on 2008/09/23 16:25:44 UTC

[jira] Issue Comment Edited: (JCR-1645) Add support for Map of referenced beans

    [ https://issues.apache.org/jira/browse/JCR-1645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12633745#action_12633745 ] 

vgiguere edited comment on JCR-1645 at 9/23/08 7:24 AM:
---------------------------------------------------------------

Hi, 

Everything seems to be fine.

However, I was wondering if you would have a better idea on how to implement the BeanReferenceMapConverter. I find that my solution is a bit of a hack.

When persisting a map of reference, we must save the key in the map and the UUID of the referenced node. But, since there are no implementation of javax.jcr.Value that offer the possibility to store 2 strings (the key and the UUID), I was left with encoding the 2 inside a String:

value="MAPKEY:*keyInTheMapMAPVALUE:{color}adjklq3e-rcq45f-4g3579-4fsd-345fsd"

Is there a better way of storing 2 strings as a value in the node?
If no, are you comfortable with this approach?




      was (Author: vgiguere):
    Hi, 

Everything seems to be fine.

However, I was wondering if you would have a better idea on how to implement the BeanReferenceMapConverter. I find that my solution is a bit of a hack.

When persisting a map of reference, we must save the key in the map and the UUID of the referenced node. But, since there are no implementation of javax.jcr.Value that offer the possibility to store 2 strings (the key and the UUID), I was left with encoding the 2 inside a String:

value="{color:red} MAPKEY{color}:*keyInTheMap{color:red} MAPVALUE:{color}adjklq3e-rcq45f-4g3579-4fsd-345fsd"

Is there a better way of storing 2 strings as a value in the node?
If no, are you comfortable with this approach?



  
> Add support for Map of referenced beans
> ---------------------------------------
>
>                 Key: JCR-1645
>                 URL: https://issues.apache.org/jira/browse/JCR-1645
>             Project: Jackrabbit
>          Issue Type: New Feature
>          Components: jackrabbit-ocm
>            Reporter: Vincent Giguère
>            Assignee: Christophe Lombart
>             Fix For: 1.5
>
>         Attachments: BeanReferenceMapConverterImpl.java, BeanReferenceMapConverterImplTest.java, MapReferenceValueEncoder.java, MapReferenceValueEncoderTest.java
>
>
> OCM should support the mapping of maps of referenced beans.
> @Collection(collectionConverter= BeanReferenceCollectionConverterImpl.class)
> private java.util.Map<String, ReferencedBean> aMap;
> BeanReferenceCollectionConverterImpl (mainly the method doGetCollection) needs to be updated to support the interface ManageableMap interface.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.