By default, @Collection is not supporting maps based on <String, String>, the elements have to be beans based classes, not primitive types. If you want to use primitive types or wrapper classes, you have to use the collection converter "MultiValueCollectionConverterImpl".
There is a exemple in the unit test, see the classes : - MultiValueWithObjectCollection, this class contains a collection for String. - AnnotationMultiValueWithObjectCollectionConverterImplTest : this is the unit test. Unfortunatly, we have not unit test with Maps. We should add one. Please, make a test with the converter "MultiValueWithObjectCollection" and let me know if it is not working with maps. br, Christophe 2009/6/30 Andreas Mucha <[email protected]> > Hello all, > > i have the following mapping problem (jackrabbit 1.5.6 , ocm 1.5.3). > My class contains the following map annotated as collection : > > @Node > public class MyClass > { > ... > @Collection private Map<String,String> amap = new > HashMap<String,String>(); > } > > Inserting this via the object content mapper leads to the following > exception : > > org.apache.jackrabbit.ocm.exception.IncorrectPersistentClassException: > Class of type: java.lang.String has no descriptor. > at > org.apache.jackrabbit.ocm.mapper.impl.AbstractMapperImpl.getClassDescriptorByClass(AbstractMapperImpl.java:203) > at > org.apache.jackrabbit.ocm.manager.collectionconverter.impl.DefaultCollectionConverterImpl.doInsertCollection(DefaultCollectionConverterImpl.java:116) > at > org.apache.jackrabbit.ocm.manager.collectionconverter.impl.AbstractCollectionConverterImpl.insertCollection(AbstractCollectionConverterImpl.java:80) > at > org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.insertCollectionFields(ObjectConverterImpl.java:906) > at > org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.insert(ObjectConverterImpl.java:227) > at > org.apache.jackrabbit.ocm.manager.beanconverter.impl.DefaultBeanConverterImpl.insert(DefaultBeanConverterImpl.java:53) > at > org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.insertBeanFields(ObjectConverterImpl.java:844) > at > org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.insert(ObjectConverterImpl.java:226) > at > org.apache.jackrabbit.ocm.manager.objectconverter.impl.ObjectConverterImpl.insert(ObjectConverterImpl.java:155) > at > org.apache.jackrabbit.ocm.manager.impl.ObjectContentManagerImpl.insert(ObjectContentManagerImpl.java:406) > > I don't know where to configure additional mapping for java.lang.String. > Actually i even don't why to configure something for atomic / basic types. > > Can anybody help here ? > > Thanks in advance. > Andreas > -- > Neu: GMX Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate > für nur 19,99 Euro/mtl.!* http://portal.gmx.net/de/go/dsl02 >
