jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boni Gopalan \(BioImagene\)" <Bon...@bioimagene.com>
Subject RE: OCM:Mapping List<Object>
Date Wed, 24 Sep 2008 13:38:15 GMT
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.

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
View raw message