jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Jackrabbit: Basic OCM operations (page edited)
Date Fri, 08 Feb 2008 08:35:01 GMT
Basic OCM operations (JCR) edited by Christophe Lombart
      Page: http://cwiki.apache.org/confluence/display/JCR/Basic+OCM+operations
   Changes: http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=75351&originalVersion=1&revisedVersion=2

Comment:
---------------------------------------------------------------------

Replace the PersistenceManager reference by Object Content Manager

Change summary:
---------------------------------------------------------------------

Replace the PersistenceManager reference by Object Content Manager

Change summary:
---------------------------------------------------------------------

Replace the PersistenceManager reference by Object Content Manager

Change summary:
---------------------------------------------------------------------

Replace the PersistenceManager reference by Object Content Manager

Change summary:
---------------------------------------------------------------------

Replace the PersistenceManager reference by Object Content Manager

Content:
---------------------------------------------------------------------

When you have created a new [Object Content Manager] in your application, you can use this
component to insert, update, delete and retrieve objects. The class 'Folder' used in the following
sections has to be annoted or defined in a xml file class descriptor.

This page describes only the main [Object Content Manager] methods. You can see the javadoc
to get more information on the API.
You also read the tutorial [5' with Jackrabbit OCM] to get more information on how to initialize
the [Object Content Manager] (ocm).

h2. Insert

{code}
Folder folder =  new Folder();
folder.setPath("/myfolder");
folder.set...(); // call the setter methods

ocm.insert(myFolder);
{code}

h2. Retrieve and update an object

{code}
Folder folder = (Folder) persistenceManager.getObject(Folder.class, "/myfolder");
folder.set...(); // call the setter methods

ocm.update(myFolder);
{code}

h2. Delete

{code}
ocm.remove("/test");
{code}

h2. Save last changes

After some inserts, deletes and/or updates, you can call the method *ocm.save()* to apply
your changes into the JCR repository.


---------------------------------------------------------------------
CONFLUENCE INFORMATION
This message is automatically generated by Confluence

Unsubscribe or edit your notifications preferences
   http://cwiki.apache.org/confluence/users/viewnotifications.action

If you think it was sent incorrectly contact one of the administrators
   http://cwiki.apache.org/confluence/administrators.action

If you want more information on Confluence, or have a bug to report see
   http://www.atlassian.com/software/confluence



Mime
View raw message