Please wait before reading the doc because it is obsolete.
I would like to start with a small tutorial before getting all the technical
details.
What do you thing ?
Christophe
On Jan 28, 2008 2:57 PM, muriel elhaik <[EMAIL PROTECTED]> wrote:
> Thanks a lot.
> I will try to use directly the class ObjectCentManager
> and I come back later to read the documentation
>
> Best Regards
> Muriel
>
> Christophe Lombart wrote:
> > Hi,
> >
> > The documentation is obsolete. I'm going to review it but it will take
> time.
> > the class PersistenceManager was renamed into ObjectContentManager. The
> > ObjectContentManager is the main component in Jackrabbit OCM. It can be
> used
> > to make some CRUD operations on pojos. Thanks to this component, you can
> > add, delete, update or retrieve pojos from a JCR repository. For doing
> this,
> > it has to know how to map a pojo into jcr nodes & properties. This kind
> of
> > mapping is done with the annotations defined on the pojos or in a XML
> > descriptor.
> >
> >
> > 1/ If you want to instantiate a ObjectContentManager with the annotation
> > support :
> >
> >
> > Session session = .... // get a JCR session
> >
> > List<Class> classes = new ArrayList<Classes>();
> > classes.add(...); // Call this method for each pojo to register
> > Mapper mapper = new AnnotationMapperImpl(classes).
> > ObjectContentManager ocm = new ObjectContentManagerImpl(session,
> mapper);
> >
> >
> > 2/ If you want to instantiate an ObjectContentManager with the XML file
> > support :
> >
> > Session session = .... // get a JCR session
> > String[] files = { "mappingfile1.xml", "mappingfile2.xml"}
> > ObjectContentManager ocm = new ObjectContentManagerImpl(session, files);
> >
> > Now, you can chek the ObjectContentManager interface to see the complete
> > API.
> > I advise you to review the unit tests which contain many examples. Let's
> > start with the classes AnnotationTestBase & DigesterTestBase.
> >
> > Hope this help until the doc is better.
> >
> > Christophe
> >
> >
> > On Jan 28, 2008 10:07 AM, muriel elhaik <[EMAIL PROTECTED]>
> wrote:
> >
> >
> >> Hi,
> >>
> >> I think there is something wrong in the code to initialize correctly
> the
> >> Object Manager find in this page :
> >> http://jackrabbit.apache.org/ocm/engine-introduction.html
> >>
> >> // 3. Initialize the PersistenceManager dependencies
> >> Mapper mapper = new DigesterMapperImpl(files).buildMapper();
> >>
> >> But as it is in the src, buildMapper is returning a void and not a
> Mapper
> >>
> >> Has anybody already noticed it?
> >>
> >> Regards
> >> Muriel
> >>
> >>
> >>
> >>
> >
> >
> ---------------------------------------------------------------------------------------
> > Orange vous informe que cet e-mail a ete controle par l'anti-virus
> mail.
> > Aucun virus connu a ce jour par nos services n'a ete detecte.
> >
> >
> >
>
>
>