org.apache.jackrabbit.ocm.manager.collectionconverter.impl
Class DefaultCollectionConverterImpl

java.lang.Object
  extended by org.apache.jackrabbit.ocm.manager.collectionconverter.impl.AbstractCollectionConverterImpl
      extended by org.apache.jackrabbit.ocm.manager.collectionconverter.impl.DefaultCollectionConverterImpl
All Implemented Interfaces:
CollectionConverter

public class DefaultCollectionConverterImpl
extends AbstractCollectionConverterImpl

Default Collection Mapping/convertion implementation. This collection mapping strategy maps a collection under an extra JCR node (specify by the jcrName in the CollectionDescriptor). It is usefull when the node type "nt:unstructured" is applied to the collection elements. By this way, it is possible to distinguish the collection elements from the other main object fields. If the collection element class contains an id (see the ID FieldDescriptor definition), this id value is used to build the collection element node. Otherwise, the element node name is a simple constant. Example - without an id attribute: /test (Main object containing the collection field ) /mycollection (extra node used to store the entire collection) /collection-element (node used to store the first collection element) /item-prop .... /collection-element (node used to store the second collection element) ... Example - with an id attribute: /test (Main object containing the collection field ) /mycollection (extra node used to store the entire collection) /aValue (id value assigned to the first element) /item-prop .... /anotherValue (id value assigned to the first element) ...

Author:
Christophe Lombart, Alexandru Popescu

Field Summary
protected static String COLLECTION_ELEMENT_NAME
           
 
Fields inherited from class org.apache.jackrabbit.ocm.manager.collectionconverter.impl.AbstractCollectionConverterImpl
atomicTypeConverters, mapper, objectConverter
 
Constructor Summary
DefaultCollectionConverterImpl(Map atomicTypeConverters, ObjectConverter objectConverter, Mapper mapper)
          Constructor
 
Method Summary
protected  ManageableObjects doGetCollection(Session session, Node parentNode, CollectionDescriptor collectionDescriptor, Class collectionFieldClass)
           
protected  void doInsertCollection(Session session, Node parentNode, CollectionDescriptor collectionDescriptor, ManageableObjects objects)
           
protected  boolean doIsNull(Session session, Node parentNode, CollectionDescriptor collectionDescriptor, Class collectionFieldClass)
           
protected  void doUpdateCollection(Session session, Node parentNode, CollectionDescriptor collectionDescriptor, ManageableObjects objects)
           
 
Methods inherited from class org.apache.jackrabbit.ocm.manager.collectionconverter.impl.AbstractCollectionConverterImpl
getCollection, getCollectionJcrName, insertCollection, isNull, updateCollection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COLLECTION_ELEMENT_NAME

protected static final String COLLECTION_ELEMENT_NAME
See Also:
Constant Field Values
Constructor Detail

DefaultCollectionConverterImpl

public DefaultCollectionConverterImpl(Map atomicTypeConverters,
                                      ObjectConverter objectConverter,
                                      Mapper mapper)
Constructor

Parameters:
atomicTypeConverters -
objectConverter -
mapper -
Method Detail

doInsertCollection

protected void doInsertCollection(Session session,
                                  Node parentNode,
                                  CollectionDescriptor collectionDescriptor,
                                  ManageableObjects objects)
                           throws RepositoryException
Specified by:
doInsertCollection in class AbstractCollectionConverterImpl
Throws:
RepositoryException
See Also:
AbstractCollectionConverterImpl#doInsertCollection(Session, Node, CollectionDescriptor, ManageableCollection)

doUpdateCollection

protected void doUpdateCollection(Session session,
                                  Node parentNode,
                                  CollectionDescriptor collectionDescriptor,
                                  ManageableObjects objects)
                           throws RepositoryException
Specified by:
doUpdateCollection in class AbstractCollectionConverterImpl
Throws:
RepositoryException
See Also:
AbstractCollectionConverterImpl#doUpdateCollection(Session, Node, CollectionDescriptor, ManageableCollection)

doGetCollection

protected ManageableObjects doGetCollection(Session session,
                                            Node parentNode,
                                            CollectionDescriptor collectionDescriptor,
                                            Class collectionFieldClass)
                                     throws RepositoryException
Specified by:
doGetCollection in class AbstractCollectionConverterImpl
Throws:
RepositoryException
See Also:
AbstractCollectionConverterImpl.doGetCollection(Session, Node, CollectionDescriptor, Class)

doIsNull

protected boolean doIsNull(Session session,
                           Node parentNode,
                           CollectionDescriptor collectionDescriptor,
                           Class collectionFieldClass)
                    throws RepositoryException
Specified by:
doIsNull in class AbstractCollectionConverterImpl
Throws:
RepositoryException
See Also:
AbstractCollectionConverterImpl.doIsNull(Session, Node, CollectionDescriptor, Class)


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.