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: unable to load map via ocm from repository
Date Thu, 02 Jul 2009 10:17:13 GMT
Can you put the log on debug to get more information on the retrieve
process. Do you have getter & setter on  someMap ?

2009/7/1 Andreas Mucha <singtur@gmx.net>

> Hello all,
>
> i used OCM with annotations to save instances of class like this:
>
> @Node
> public class MyClass1
> {
>   @Field (path=true) private String path;
>   @Field private String id;
>   @Bean private MyClass2 mc2;
>   ...
> }
>
> @Node
> public class MyClass2
> {
>   @Field private String someName;
>   @Collection private Map<String,MyClass3> someMap;
>   ...
> }
>
> @Node
> 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 = ...
> c1.setMc2(...);
> c1.setId("someID");
> c1.setPath(/a/b/c);
> ...
> AnnotationMapperImpl mapper = new AnnotationMapperImpl( ...
> MyClass1.class,MyClass2.class,MyClass3.class ... );
> ocm = new ObjectContentManagerImpl(session,mapper);
> ocm.insert(c1);
> ocm.save();
>
> 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
>

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