jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajab57 <rajalaks...@gmail.com>
Subject [jcr:mapping] How do I specify the graffito jcr mapping for classes that extend ArrayList
Date Thu, 31 May 2007 21:34:21 GMT


I was able to map under the following scenarios for collections :
1. When the member of a class is a List, Set.
2. When the member of a class is a Map. I referred to the example HashMap
present in the test directories for graffito.

In this scenario -
Member is not directly a list but extends a List. I am not sure how to
define the mapping for it ? Should I treat the member like a collection and
just define the collection descriptor ? I tried that but I get a bunch of
errors that it could not map 

<class-descriptor className="MainClass"
<collection-descriptor fieldName="elements" jcrName="element"
elementClassName="ElementsList" jc

<class-descriptor className="Element" jcrNodeType="test:elem">
		<field-descriptor fieldName="name" jcrName="name"/>
		<field-descriptor fieldName="id" jcrName="id"/>	


import java.util.ArrayList;
import java.util.ListIterator;

public class MainClass {
   private ElementsList elements;


public class ElementsList extends ArrayList<Elements>  {
  private static final long serialVersionUID = 1L;


public class Element {
   private String name ;
   private String id ;


Thank you for the help,
View this message in context: http://www.nabble.com/-jcr%3Amapping---How-do-I-specify-the-graffito-jcr-mapping-for-classes-that-extend-ArrayList-tf3849032.html#a10902529
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

View raw message