jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christophe Lombart" <christophe.lomb...@gmail.com>
Subject Re: OCM support for java.util.Map fields?
Date Thu, 10 Jul 2008 08:53:24 GMT
if subnode is fine for you,just made something like this for the desired
attribute :

@Collection Map<String,MyClass> map;

In this example, MyClass can be any kind of persistent classes. the map key
will be the name of the subnode

This works only with the latest snapshot. If you are using a previous
version, you have to defined a ManageableCollection which is not very
intuitive.

In order to get a better answer,  give me more information on  your content
model.

Christophe


On Thu, Jul 10, 2008 at 9:42 AM, Mario-Leander Reimer <
leander.reimer@vva-networks.de> wrote:

> Hello Christophe,
>
> actually I don't really care how the Map is converted to a JCR structure.
> Subnode is fine by me. I just saw that JCROM could somehow map the contents
> of map to individual properties of a node.
>
> So from the OCM test cases I see that I need to implement the following:
>
> class MyHashMapElement extends HashMap implements ManageableCollection {}
>
> Correct? Do I really need to do this? And then I can use the
> DefaultCollectionConvertImpl to map this element, right?
>
> Thanks for your help!
> Leander
>
>
>
> > -----Urspr√ľngliche Nachricht-----
> > Von: Christophe Lombart [mailto:christophe.lombart@gmail.com]
> > Gesendet: Mittwoch, 9. Juli 2008 19:13
> > An: users@jackrabbit.apache.org
> > Betreff: Re: OCM support for java.util.Map fields?
> >
> > Hi Leander,
> >
> > Map is not supported for the properties. only for subnodes. It should
> > be
> > possible to implement a new CollectionConverter for doing it.
> > I will check if there is a jira issue for this features.
> >
> >
> > Christophe
> >
> >
> > On Wed, Jul 9, 2008 at 3:17 PM, Mario-Leander Reimer <
> > leander.reimer@vva-networks.de> wrote:
> >
> > > Hi,
> > >
> > > does anybody know a way to map the contents of a java.util.Map bean
> > field
> > > using OCM? Haven't found a suitable converter for it. Has anyone done
> > this
> > > yet?
> > > What I would need is a mapping of the key=value pairs, to "dynamic"
> > node
> > > properties with the corresponding value.
> > >
> > > Best regards,
> > > Leander
> > >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message