jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Jackrabbit: Mapping Collection Fields (page edited)
Date Wed, 20 Feb 2008 20:41:00 GMT
Mapping Collection Fields (JCR) edited by Jukka Zitting
      Page: http://cwiki.apache.org/confluence/display/JCR/Mapping+Collection+Fields
   Changes: http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=75363&originalVersion=0&revisedVersion=1


Change summary:

Change summary:

Change summary:

Change summary:


The collection-descriptor maps a collection attribute into JCR nodes or in a multivalue property.

Based on our model defined here, the following collection-descriptor is used to map the "paragraphs"
field into the JCR node called "paragraphs".

      fieldName="paragraphs" jcrName="paragraphs"
      elementClassName="org.apache.jackrabbit.ocm.testmodel.Paragraph" />
  <!-- other field, bean and collection mapping here !-->

  <field-descriptor fieldName="path" path="true" />
  <field-descriptor fieldName="text" jcrName="my:text"/>

The collection-descriptor contains the elementClassName attribute which specify the collection
element class. A class descriptor for the element class has also to be defined.

h2. The JCR Structure

Following our example, the resulting JCR structure is:

      my:text = "This is the content of para1"
      my:text = "This is the content of para2"
  ... other subnodes for page1 ...

By default, the persistence manager will create a subnode (/mysite/page1/paragraphs). This
one will contains the different paragraphs.

As explained in the following sections, it is possible to map to another JCR structure. It
is also possible to use another name for the jcr node names (see above).

h2. Supported Collection and Map Types

The OCM framework is supporting the following java types:

* *Collections* Collection, List, Set, ArrayList, Vector, HashSet
* *Maps* Map, HashMap

h2. Using Another Collection or Map

It is possible to support other Collection or Map types with the ManageableCollection interface.

h2. Using Another Collection Converter


h2. Predefined Collection Converters


h2. Building your own Collection Converters


This message is automatically generated by Confluence

Unsubscribe or edit your notifications preferences

If you think it was sent incorrectly contact one of the administrators

If you want more information on Confluence, or have a bug to report see

View raw message