jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Mucha" <sing...@gmx.net>
Subject unable to load map via ocm from repository
Date Wed, 01 Jul 2009 13:09:32 GMT
Hello all,

i used OCM with annotations to save instances of class like this:

public class MyClass1
   @Field (path=true) private String path;
   @Field private String id;
   @Bean private MyClass2 mc2;

public class MyClass2
   @Field private String someName;
   @Collection private Map<String,MyClass3> someMap;

public class MyClass3
   @Field private String someID;
   @Field private String someValue;

To save the objects i used code like this :
//create a map which contains instances of MyClass3
//create instance of type MyClass2 and set map
//create instance of type MyClass1 and put all together
MyClass c1 = ...
AnnotationMapperImpl mapper = new AnnotationMapperImpl( ... MyClass1.class,MyClass2.class,MyClass3.class
... );
ocm = new ObjectContentManagerImpl(session,mapper);

Until here everything is fine. If i check the repository content
the entry was inserted successfully. (i use an eclipse plugin)

But if i load the entry in this way : 
Collection c = ocm.getObjects("//c[@id='someID']", Query.XPATH);
MyClass1 c1 = (MyClass1 )nodes.iterator().next();
not all members are loaded.
Member mc2 of c1 is loaded. The 'someName' field of mc2 (see MyClass2)
is loaded.
But the map in MyClass2 which has values of type MyClass3 is still empty.

(jackrabbit 1.5.6, ocm 1.5.3)

Any ideas ??
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

View raw message