incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r279635 - /incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/ObjectConverter.java
Date Thu, 08 Sep 2005 21:28:25 GMT
Author: clombart
Date: Thu Sep  8 14:28:22 2005
New Revision: 279635

URL: http://svn.apache.org/viewcvs?rev=279635&view=rev
Log:
Work on the CollectionDescriptor. 

Modified:
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/ObjectConverter.java

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/ObjectConverter.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/ObjectConverter.java?rev=279635&r1=279634&r2=279635&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/ObjectConverter.java
(original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/ObjectConverter.java
Thu Sep  8 14:28:22 2005
@@ -38,6 +38,8 @@
 import org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter;
 import org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverterFactory;
 import org.apache.portals.graffito.jcr.persistence.collectionconverter.CollectionConverter;
+import org.apache.portals.graffito.jcr.persistence.collectionconverter.ManageableCollection;
+import org.apache.portals.graffito.jcr.persistence.collectionconverter.ManageableCollectionUtil;
 import org.apache.portals.graffito.jcr.persistence.collectionconverter.impl.DefaultCollectionConverterImpl;
 import org.apache.portals.graffito.jcr.repository.RepositoryUtil;
 
@@ -206,7 +208,7 @@
             CollectionDescriptor collectionDescriptor = (CollectionDescriptor) collectionDescriptorIterator.next();
             CollectionConverter collectionConverter = this.getCollectionConverter(collectionDescriptor);
             Class collectionFieldClass = PropertyUtils.getPropertyDescriptor(object, collectionDescriptor.getFieldName()).getPropertyType();
-            Collection collection = collectionConverter.getCollection(session, node, collectionDescriptor,
collectionFieldClass );
+            ManageableCollection collection = collectionConverter.getCollection(session,
node, collectionDescriptor, collectionFieldClass );
             PropertyUtils.setNestedProperty(object, collectionDescriptor.getFieldName(),
collection);
         }
     }
@@ -324,7 +326,9 @@
             {
                 CollectionDescriptor collectionDescriptor = (CollectionDescriptor) collectionDescriptorIterator.next();
                 CollectionConverter collectionConverter = this.getCollectionConverter(collectionDescriptor);
-                collectionConverter.insertCollection(session, objectNode, collectionDescriptor,object);
+                Object collection = PropertyUtils.getNestedProperty(object, collectionDescriptor.getFieldName());
+                ManageableCollection manageableCollection = ManageableCollectionUtil.getManageableCollection(collection);
+                collectionConverter.insertCollection(session, objectNode, collectionDescriptor,
manageableCollection);
             }
         }
         catch (Exception e)
@@ -343,7 +347,9 @@
             {
                 CollectionDescriptor collectionDescriptor = (CollectionDescriptor) collectionDescriptorIterator.next();
                 CollectionConverter collectionConverter = this.getCollectionConverter(collectionDescriptor);
-                collectionConverter.updateCollection(session, objectNode, collectionDescriptor,
object);
+                Object collection = PropertyUtils.getNestedProperty(object, collectionDescriptor.getFieldName());
+                ManageableCollection manageableCollection = ManageableCollectionUtil.getManageableCollection(collection);
+                collectionConverter.updateCollection(session, objectNode, collectionDescriptor,
manageableCollection);
             }
         }
         catch (Exception e)
@@ -402,7 +408,7 @@
             String className = collectionDescriptor.getCollectionConverterClassName();
              if (className == null)
              {
-                 return new DefaultCollectionConverterImpl(this);
+                 return new DefaultCollectionConverterImpl(this, this.mapper);
              }
              else
              {



Mime
View raw message