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:Mapping List<Object>
Date Wed, 24 Sep 2008 14:03:28 GMT
On Wed, Sep 24, 2008 at 15:38, Boni Gopalan (BioImagene) <
Boni.G@bioimagene.com> wrote:

> Class Foo{
>        List<Object> children;
> }
>
> I have mapped it as :
>
>        <class-descriptor className="Foo"
>                jcrType="nt:unstructured">
>                <collection-descriptor  fieldName="attrParameters"
> jcrName="attrParameters" proxy="false"
>
> elementClassName="java.lang.String"
> jcrSameNameSiblings="false"/>
>
>                <collection-descriptor  fieldName="children"
> jcrName="children"
> proxy="false"
>
> elementClassName="java.lang.Object"
> jcrSameNameSiblings="false" collectionConverter
> ="org.apache.jackrabbit.ocm.manager.collectionconverter.impl.DefaultColl
> ectionConverterImpl"/>
>        </class-descriptor>
>
> The List<Object> children : Can Hold only simple types : String,
> Integer, Long etc. a finite number of classes I know.
>

almost all collection converters are supported only collection of persistent
classes but I think the converter "MultiValueCollectionConverterImpl" can
help in you case.
Is it not something like the unit test
DigesterMultiValueCollectionConverterImplTest  ?

http://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-ocm/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/DigesterMultiValueCollectionConverterImplTest.java




>
> The conversion fails runtime , when the Object is java.lang.String
>
> I tried with the MultiValueConverter also; It fails with the same
> results
>
> The stacktrace is as below:
>
>        at
> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java
> :980)
> Caused by:
> org.apache.jackrabbit.ocm.exception.IncorrectPersistentClassException:
> Class of type: java.lang.String has no descriptor.
>        at
> org.apache.jackrabbit.ocm.mapper.impl.AbstractMapperImpl.getClassDescrip
> torByClass(AbstractMapperImpl.java:177)
>        at
> org.apache.jackrabbit.ocm.manager.collectionconverter.impl.DefaultCollec
> tionConverterImpl.doInsertCollection(DefaultCollectionConverterImpl.java
> :116)
>        at
> org.apache.jackrabbit.ocm.manager.collectionconverter.impl.AbstractColle
> ctionConverterImpl.insertCollection(AbstractCollectionConverterImpl.java
> :80)
>        at
> org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterIm
> pl.insertCollectionFields(ObjectConverterImpl.java:846)
>        at
> org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterIm
> pl.insert(ObjectConverterImpl.java:225)
>        at
> org.apache.jackrabbit.ocm.manager.collectionconverter.impl.DefaultCollec
> tionConverterImpl.insertManageableCollection(DefaultCollectionConverterI
> mpl.java:147)
>        at
> org.apache.jackrabbit.ocm.manager.collectionconverter.impl.DefaultCollec
> tionConverterImpl.doInsertCollection(DefaultCollectionConverterImpl.java
> :119)
>        at
> org.apache.jackrabbit.ocm.manager.collectionconverter.impl.AbstractColle
> ctionConverterImpl.insertCollection(AbstractCollectionConverterImpl.java
> :80)
>        at
> org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterIm
> pl.insertCollectionFields(ObjectConverterImpl.java:846)
>        at
> org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterIm
> pl.insert(ObjectConverterImpl.java:225)
>        at
> org.apache.jackrabbit.ocm.manager.beanconverter.impl.DefaultBeanConverte
> rImpl.insert(DefaultBeanConverterImpl.java:53)
>        at
> org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterIm
> pl.insertBeanFields(ObjectConverterImpl.java:784)
>        at
> org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterIm
> pl.insert(ObjectConverterImpl.java:224)
>        at
> org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterIm
> pl.insert(ObjectConverterImpl.java:153)
>        at
> org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.insert(O
> bjectContentManagerImpl.java:406)
>        at
> com.bioimagene.iii.dms.pojo.PersistenceDelegateXMLNode.saveItem(Persiste
> nceDelegateXMLNode.java:134)
>
> Thanks
> Boni
>
> -----Original Message-----
> From: Christophe Lombart [mailto:christophe.lombart@gmail.com]
> Sent: 24 September 2008 18:04
> To: users@jackrabbit.apache.org
> Subject: Re: OCM:Mapping List<Object>
>
> Please, give me more details on your desired mapping. Do you want to
> have a
> Collection of primitive types ? Do you want to map to multi val property
> ?
>
>
> Christophe
>
>
> On Wed, Sep 24, 2008 at 14:00, Boni Gopalan (BioImagene) <
> Boni.G@bioimagene.com> wrote:
>
> > Hi : I need to map a collection  by definition is Collection<Object>.
> > However it will be holding only Types convertible by
> AtomicTypeConverter
> > (Or UndefinedTypeConverterImpl).  How can I specify that to map any
> > element from  the Collection OCM need to Use
> UndefinedTypeConverterImpl?
> >
> >
> >
> > Boni Gopalan
> > Manager Engineering
> > BioImagene, Pune
> >
> > +91-206-609-6579(O)
> > +91-992-369-9356(C)
> >
> >
> >
> >
>

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