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

Hi,

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
collectionConverter="org.apache.portals.graffito.jcr.persistence.collectionconverter.impl.MultiValueCollectionConverterImpl"/>
</class-descriptor>

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

Example

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,
Raji
-- 
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.


Mime
View raw message