incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r325963 [1/3] - in /incubator/graffito/trunk/jcr-mapping/src: java/org/apache/portals/graffito/jcr/exception/ java/org/apache/portals/graffito/jcr/mapper/ java/org/apache/portals/graffito/jcr/mapper/impl/ java/org/apache/portals/graffito/jc...
Date Mon, 17 Oct 2005 19:08:06 GMT
Author: clombart
Date: Mon Oct 17 12:07:21 2005
New Revision: 325963

URL: http://svn.apache.org/viewcvs?rev=325963&view=rev
Log:
* Review Exception
* Review javadoc
* rename method persistenceManager.itemExists in objectExists

Added:
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/InitMapperException.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/PersistenceException.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/RepositoryException.java
Modified:
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/CustomNodeTypeCreationException.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/IncorrectAtomicTypeException.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/JcrMappingException.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/Mapper.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterDescriptorReader.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/BeanDescriptor.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/ClassDescriptor.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/CollectionDescriptor.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/FieldDescriptor.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/MappingDescriptor.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/PersistenceManager.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/AtomicTypeConverter.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/AbstractAtomicTypeConverterImpl.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/BinaryTypeConverterImpl.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/BooleanTypeConverterImpl.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/ByteArrayTypeConverterImpl.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/CalendarTypeConverterImpl.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/DoubleTypeConverterImpl.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/IntTypeConverterImpl.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/LongTypeConverterImpl.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/StringTypeConverterImpl.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/TimestampTypeConverterImpl.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/UtilDateTypeConverterImpl.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/CollectionConverter.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/ManageableCollection.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/ManageableCollectionUtil.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/AbstractCollectionConverterImpl.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/DefaultCollectionConverterImpl.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/ManageableArrayList.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/ManageableVector.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/MultiValueCollectionConverterImpl.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/NTCollectionConverterImpl.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/impl/ObjectIterator.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerImpl.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/ObjectConverter.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/impl/ObjectConverterImpl.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/query/Filter.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/query/Query.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/query/QueryManager.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/query/impl/FilterImpl.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/query/impl/QueryImpl.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/query/impl/QueryManagerImpl.java
    incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/repository/RepositoryUtil.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/atomicconverter/AtomicTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/atomicconverter/NullAtomicTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/DefaultCollectionConverterImplTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/HashMapTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/MultiValueCollectionConverterImplTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/NTCollectionConverterImplTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerAtomicQueryTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerIteratorQueryTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerMultiValueQueryTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerRemoveTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerScopeQueryTest.java

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/CustomNodeTypeCreationException.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/CustomNodeTypeCreationException.java?rev=325963&r1=325962&r2=325963&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/CustomNodeTypeCreationException.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/CustomNodeTypeCreationException.java Mon Oct 17 12:07:21 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2004 The Apache Software Foundation.
+ * Copyright 2000-2005 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@
  * @author <a href="mailto:okiessler@apache.org">Oliver Kiessler</a>
  * @version $Id: Exp $
  */
-public class CustomNodeTypeCreationException extends Exception {
+public class CustomNodeTypeCreationException extends JcrMappingException {
     
     /**
      * Default Constructor without information.

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/IncorrectAtomicTypeException.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/IncorrectAtomicTypeException.java?rev=325963&r1=325962&r2=325963&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/IncorrectAtomicTypeException.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/IncorrectAtomicTypeException.java Mon Oct 17 12:07:21 2005
@@ -18,6 +18,8 @@
 package org.apache.portals.graffito.jcr.exception;
 
 /**
+ * Occurs when the jcr mapping converters try to assign or read an incorrect atomic field type.
+ * 
  * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
  *
  */

Added: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/InitMapperException.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/InitMapperException.java?rev=325963&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/InitMapperException.java (added)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/InitMapperException.java Mon Oct 17 12:07:21 2005
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2000-2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.portals.graffito.jcr.exception;
+
+
+/**
+ * Occurs when it is not possible to initialise the Mapper 
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ */
+
+public class InitMapperException extends JcrMappingException
+{
+
+    /**
+     * Default Constructor without information.
+     */
+    public InitMapperException() 
+    {
+        super();
+    }
+    
+    /**
+     * Constructor with message.
+     * 
+     * @param message the message associated to the exception
+     */
+    public InitMapperException(String message) 
+    {
+        super(message);
+    }
+    
+    /**
+     * Constructor with throwable object.
+     * 
+     * @param nested the associated throwable object
+     */    
+    public InitMapperException(Throwable nested)
+    {
+        super(nested);
+    }
+    
+    /**
+     * Constructor with message and throwable object.
+     * 
+     * @param message the message associated to the exception
+     * @param nested the associated throwable object
+     */    
+    public InitMapperException(String message, Throwable nested)
+    {
+        super(message, nested);
+    }
+
+}

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/JcrMappingException.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/JcrMappingException.java?rev=325963&r1=325962&r2=325963&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/JcrMappingException.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/JcrMappingException.java Mon Oct 17 12:07:21 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2004 The Apache Software Foundation.
+ * Copyright 2000-2005 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -17,15 +17,13 @@
 
 
 /**
- * <p>Occurs when anything unexpected happens within the JCR mapping.</p>
  * 
- *
- * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ * Base class of all runtime exceptions used in the JCR mapping.
  * 
- * @version $Id: Exp $
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
  */
 
-public class JcrMappingException extends Exception
+public abstract class JcrMappingException extends RuntimeException
 {
 
     /**

Added: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/PersistenceException.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/PersistenceException.java?rev=325963&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/PersistenceException.java (added)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/PersistenceException.java Mon Oct 17 12:07:21 2005
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2000-2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.portals.graffito.jcr.exception;
+
+
+/**
+ * Occurs when it is not possible to persist an object
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ */
+
+public class PersistenceException extends JcrMappingException
+{
+
+    /**
+     * Default Constructor without information.
+     */
+    public PersistenceException() 
+    {
+        super();
+    }
+    
+    /**
+     * Constructor with message.
+     * 
+     * @param message the message associated to the exception
+     */
+    public PersistenceException(String message) 
+    {
+        super(message);
+    }
+    
+    /**
+     * Constructor with throwable object.
+     * 
+     * @param nested the associated throwable object
+     */    
+    public PersistenceException(Throwable nested)
+    {
+        super(nested);
+    }
+    
+    /**
+     * Constructor with message and throwable object.
+     * 
+     * @param message the message associated to the exception
+     * @param nested the associated throwable object
+     */    
+    public PersistenceException(String message, Throwable nested)
+    {
+        super(message, nested);
+    }
+
+}

Added: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/RepositoryException.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/RepositoryException.java?rev=325963&view=auto
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/RepositoryException.java (added)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/exception/RepositoryException.java Mon Oct 17 12:07:21 2005
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2000-2005 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.portals.graffito.jcr.exception;
+
+
+/**
+ * Occurs when it is not possible to manage the JCR repository (register, login, ...)
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ */
+
+public class RepositoryException extends JcrMappingException
+{
+
+    /**
+     * Default Constructor without information.
+     */
+    public RepositoryException() 
+    {
+        super();
+    }
+    
+    /**
+     * Constructor with message.
+     * 
+     * @param message the message associated to the exception
+     */
+    public RepositoryException(String message) 
+    {
+        super(message);
+    }
+    
+    /**
+     * Constructor with throwable object.
+     * 
+     * @param nested the associated throwable object
+     */    
+    public RepositoryException(Throwable nested)
+    {
+        super(nested);
+    }
+    
+    /**
+     * Constructor with message and throwable object.
+     * 
+     * @param message the message associated to the exception
+     * @param nested the associated throwable object
+     */    
+    public RepositoryException(String message, Throwable nested)
+    {
+        super(message, nested);
+    }
+
+}

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/Mapper.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/Mapper.java?rev=325963&r1=325962&r2=325963&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/Mapper.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/Mapper.java Mon Oct 17 12:07:21 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2004 The Apache Software Foundation.
+ * Copyright 2000-2005 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,8 +19,9 @@
 
 /**
  * This component read the mapping file and gives an access to the ClassDescriptors (the mapping object model)
+ * 
  * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
- * @version $Id: Exp $
+ * 
  */
 public interface Mapper
 {

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterDescriptorReader.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterDescriptorReader.java?rev=325963&r1=325962&r2=325963&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterDescriptorReader.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterDescriptorReader.java Mon Oct 17 12:07:21 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2004 The Apache Software Foundation.
+ * Copyright 2000-20045 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 import java.io.InputStream;
 
 import org.apache.commons.digester.Digester;
-import org.apache.portals.graffito.jcr.exception.JcrMappingException;
+import org.apache.portals.graffito.jcr.exception.InitMapperException;
 import org.apache.portals.graffito.jcr.mapper.model.BeanDescriptor;
 import org.apache.portals.graffito.jcr.mapper.model.ClassDescriptor;
 import org.apache.portals.graffito.jcr.mapper.model.CollectionDescriptor;
@@ -28,83 +28,97 @@
 import org.apache.portals.graffito.jcr.mapper.model.MappingDescriptor;
 
 /**
- * This class read the xml mapping file and load all class descriptors into memory (object graph)
+ * Helper class that reads the xml mapping file and load all class descriptors into memory (object graph)
  * 
  * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
- * @version $Id: Exp $
+ * 
  */
-public class DigesterDescriptorReader {
-    /**
-     * Load all class descriptors found in the xml mapping file.
-     * 
-     * @param xmlFile the xml mapping file reference
-     * @return a {@link MappingDescriptor}
-     * 
-     * @throws JcrMappingException when it is not possible to read the xml mapping file
-     * 
-     */
-    public static MappingDescriptor loadClassDescriptors(InputStream stream) throws JcrMappingException {
-        try {
-            Digester digester = new Digester();
-            digester.setValidating(true);
-
-            digester.addObjectCreate("graffito-jcr", MappingDescriptor.class);
-
-            // --------------------------------------------------------------------------------
-            // Rules used for the class-descriptor element
-            // --------------------------------------------------------------------------------
-
-            digester.addObjectCreate("graffito-jcr/class-descriptor", ClassDescriptor.class);
-            digester.addSetProperties("graffito-jcr/class-descriptor", "className", "className");
-            digester.addSetProperties("graffito-jcr/class-descriptor", "jcrNodeType", "jcrNodeType");
-
-            digester.addSetNext("graffito-jcr/class-descriptor", "addClassDescriptor");
-
-            // --------------------------------------------------------------------------------
-            // Rules used for the field-descriptor element
-            // --------------------------------------------------------------------------------
-
-            digester.addObjectCreate("graffito-jcr/class-descriptor/field-descriptor", FieldDescriptor.class);
-            digester.addSetProperties("graffito-jcr/class-descriptor/field-descriptor", "fieldName", "fieldName");
-            digester.addSetProperties("graffito-jcr/class-descriptor/field-descriptor", "jcrName", "jcrName");
-            digester.addSetProperties("graffito-jcr/class-descriptor/field-descriptor", "id", "id");
-            digester.addSetNext("graffito-jcr/class-descriptor/field-descriptor", "addFieldDescriptor");
-
-            // --------------------------------------------------------------------------------
-            // Rules used for the bean-descriptor element
-            // --------------------------------------------------------------------------------
-
-            digester.addObjectCreate("graffito-jcr/class-descriptor/bean-descriptor", BeanDescriptor.class);
-            digester.addSetProperties("graffito-jcr/class-descriptor/bean-descriptor", "fieldName", "fieldName");
-            digester.addSetProperties("graffito-jcr/class-descriptor/bean-descriptor", "jcrName", "jcrName");
-            digester.addSetProperties("graffito-jcr/class-descriptor/bean-descriptor", "proxy", "proxy");
-            digester.addSetNext("graffito-jcr/class-descriptor/bean-descriptor", "addBeanDescriptor");
-
-            // --------------------------------------------------------------------------------
-            // Rules used for the collection-descriptor element
-            // --------------------------------------------------------------------------------
-
-            digester.addObjectCreate("graffito-jcr/class-descriptor/collection-descriptor", CollectionDescriptor.class);
-            digester.addSetProperties("graffito-jcr/class-descriptor/collection-descriptor", "fieldName", "fieldName");
-            digester.addSetProperties("graffito-jcr/class-descriptor/collection-descriptor", "jcrName", "jcrName");
-            digester.addSetProperties("graffito-jcr/class-descriptor/collection-descriptor", "proxy", "proxy");
-            digester.addSetProperties("graffito-jcr/class-descriptor/collection-descriptor", "elementClassName", "elementClassName");
-            digester.addSetProperties("graffito-jcr/class-descriptor/collection-descriptor", "collectionConverter", "collectionConverterClassName");
-            digester.addSetProperties("graffito-jcr/class-descriptor/collection-descriptor", "collectionClassName", "collectionClassName");
-            digester.addSetNext("graffito-jcr/class-descriptor/collection-descriptor", "addCollectionDescriptor");
-
-            MappingDescriptor mappingDescriptor = (MappingDescriptor) digester.parse(stream);
-            return mappingDescriptor;
-        } catch (Exception e) {
-            throw new JcrMappingException("Impossible to read the xml mapping file", e);
-        }
-    }
-
-    public static MappingDescriptor loadClassDescriptors(String xmlFile) throws JcrMappingException {
-        try {
-            return loadClassDescriptors(new FileInputStream(xmlFile));
-        } catch (FileNotFoundException e) {
-            throw new JcrMappingException(e);
-        }
-    }
+public class DigesterDescriptorReader
+{
+	/**
+	 * Load all class descriptors found in the xml mapping file.
+	 * 
+	 * @param stream the xml mapping file reference
+	 * @return a {@link MappingDescriptor}
+	 * 
+	 */
+	public static MappingDescriptor loadClassDescriptors(InputStream stream)
+	{
+		try
+		{
+			Digester digester = new Digester();
+			digester.setValidating(true);
+
+			digester.addObjectCreate("graffito-jcr", MappingDescriptor.class);
+
+			// --------------------------------------------------------------------------------
+			// Rules used for the class-descriptor element
+			// --------------------------------------------------------------------------------
+
+			digester.addObjectCreate("graffito-jcr/class-descriptor", ClassDescriptor.class);
+			digester.addSetProperties("graffito-jcr/class-descriptor", "className", "className");
+			digester.addSetProperties("graffito-jcr/class-descriptor", "jcrNodeType", "jcrNodeType");
+
+			digester.addSetNext("graffito-jcr/class-descriptor", "addClassDescriptor");
+
+			// --------------------------------------------------------------------------------
+			// Rules used for the field-descriptor element
+			// --------------------------------------------------------------------------------
+
+			digester.addObjectCreate("graffito-jcr/class-descriptor/field-descriptor", FieldDescriptor.class);
+			digester.addSetProperties("graffito-jcr/class-descriptor/field-descriptor", "fieldName", "fieldName");
+			digester.addSetProperties("graffito-jcr/class-descriptor/field-descriptor", "jcrName", "jcrName");
+			digester.addSetProperties("graffito-jcr/class-descriptor/field-descriptor", "id", "id");
+			digester.addSetNext("graffito-jcr/class-descriptor/field-descriptor", "addFieldDescriptor");
+
+			// --------------------------------------------------------------------------------
+			// Rules used for the bean-descriptor element
+			// --------------------------------------------------------------------------------
+
+			digester.addObjectCreate("graffito-jcr/class-descriptor/bean-descriptor", BeanDescriptor.class);
+			digester.addSetProperties("graffito-jcr/class-descriptor/bean-descriptor", "fieldName", "fieldName");
+			digester.addSetProperties("graffito-jcr/class-descriptor/bean-descriptor", "jcrName", "jcrName");
+			digester.addSetProperties("graffito-jcr/class-descriptor/bean-descriptor", "proxy", "proxy");
+			digester.addSetNext("graffito-jcr/class-descriptor/bean-descriptor", "addBeanDescriptor");
+
+			// --------------------------------------------------------------------------------
+			// Rules used for the collection-descriptor element
+			// --------------------------------------------------------------------------------
+
+			digester.addObjectCreate("graffito-jcr/class-descriptor/collection-descriptor", CollectionDescriptor.class);
+			digester.addSetProperties("graffito-jcr/class-descriptor/collection-descriptor", "fieldName", "fieldName");
+			digester.addSetProperties("graffito-jcr/class-descriptor/collection-descriptor", "jcrName", "jcrName");
+			digester.addSetProperties("graffito-jcr/class-descriptor/collection-descriptor", "proxy", "proxy");
+			digester.addSetProperties("graffito-jcr/class-descriptor/collection-descriptor", "elementClassName", "elementClassName");
+			digester.addSetProperties("graffito-jcr/class-descriptor/collection-descriptor", "collectionConverter", "collectionConverterClassName");
+			digester.addSetProperties("graffito-jcr/class-descriptor/collection-descriptor", "collectionClassName", "collectionClassName");
+			digester.addSetNext("graffito-jcr/class-descriptor/collection-descriptor", "addCollectionDescriptor");
+
+			MappingDescriptor mappingDescriptor = (MappingDescriptor) digester.parse(stream);
+			return mappingDescriptor;
+		}
+		catch (Exception e)
+		{
+			throw new InitMapperException("Impossible to read the xml mapping file", e);
+		}
+	}
+
+	/**
+	 * Load all class descriptors found in the xml mapping file.
+	 * 
+	 * @param xmlFile the xml mapping file reference
+	 * @return a {@link MappingDescriptor}
+	 * 
+	 */	
+	public static MappingDescriptor loadClassDescriptors(String xmlFile)
+	{
+		try
+		{
+			return loadClassDescriptors(new FileInputStream(xmlFile));
+		}
+		catch (FileNotFoundException e)
+		{
+			throw new InitMapperException(e);
+		}
+	}
 }

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java?rev=325963&r1=325962&r2=325963&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/impl/DigesterMapperImpl.java Mon Oct 17 12:07:21 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2004 The Apache Software Foundation.
+ * Copyright 2000-2005 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,7 +19,6 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.portals.graffito.jcr.exception.JcrMappingException;
 import org.apache.portals.graffito.jcr.mapper.Mapper;
 import org.apache.portals.graffito.jcr.mapper.model.ClassDescriptor;
 import org.apache.portals.graffito.jcr.mapper.model.MappingDescriptor;
@@ -29,7 +28,6 @@
  * Digester implementation for {@link org.apache.portals.graffito.jcr.mapper.Mapper}
  * 
  * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
- * @version $Id: Exp $
  */
 public class DigesterMapperImpl implements Mapper
 {    
@@ -39,36 +37,57 @@
     /**
      * Constructor
      *  
-     * @param xmlFile
-     * @throws JcrMappingException
+     * @param xmlFile The xml mapping file to read
+     *
      */
-    public DigesterMapperImpl(String xmlFile) throws JcrMappingException
+    public DigesterMapperImpl(String xmlFile)
     {
         log.info("Read the xml mapping file : " +  xmlFile);
         mappingDescriptor = DigesterDescriptorReader.loadClassDescriptors(xmlFile);
     }
     
-    public DigesterMapperImpl(String[] files) throws JcrMappingException
+    /**
+     * Constructor 
+     * 
+     * @param files a set of xml mapping files to read
+     *
+     */
+    public DigesterMapperImpl(String[] files)
     {
+    	log.info("Read the xml mapping file : " +  files[0]);
         mappingDescriptor = DigesterDescriptorReader.loadClassDescriptors(files[0]);
         for (int i=1; i<files.length;i++)
         {
+        	log.info("Read the xml mapping file : " +  files[i]);
             MappingDescriptor anotherMappingDescriptor = DigesterDescriptorReader.loadClassDescriptors(files[i]);
             mappingDescriptor.getClassDescriptors().putAll(anotherMappingDescriptor.getClassDescriptors());
         }
     }
     
-    public DigesterMapperImpl(InputStream stream) throws JcrMappingException
+    /**
+     * Constructor
+     *  
+     * @param stream The xml mapping file to read
+     */
+    public DigesterMapperImpl(InputStream stream)
     {
-        log.info("Read the input stream : " +  stream);
+        log.info("Read the input stream : " +  stream.toString());
         mappingDescriptor = DigesterDescriptorReader.loadClassDescriptors(stream);
     }
 
-    public DigesterMapperImpl(InputStream[] streams) throws JcrMappingException
+    /**
+     * Constructor 
+     * 
+     * @param streams a set of mapping files to read
+     *
+     */
+    public DigesterMapperImpl(InputStream[] streams)
     {
+    	log.info("Read the input stream : " +  streams[0].toString());
         mappingDescriptor = DigesterDescriptorReader.loadClassDescriptors(streams[0]);
         for (int i=1; i<streams.length;i++)
         {
+        	log.info("Read the input stream : " +  streams[i].toString());
             MappingDescriptor anotherMappingDescriptor = DigesterDescriptorReader.loadClassDescriptors(streams[i]);
             mappingDescriptor.getClassDescriptors().putAll(anotherMappingDescriptor.getClassDescriptors());
         }

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/BeanDescriptor.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/BeanDescriptor.java?rev=325963&r1=325962&r2=325963&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/BeanDescriptor.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/BeanDescriptor.java Mon Oct 17 12:07:21 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2004 The Apache Software Foundation.
+ * Copyright 2000-2005 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,12 +16,10 @@
 package org.apache.portals.graffito.jcr.mapper.model;
 
 /**
- * 
- * This class information to map one java bean field (attribute) into subnode
- * 
+ * BeanDescriptor is used by the mapper to read general information on a bean field
  * 
  * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
- * @version $Id: Exp $
+ * 
  */
 public class BeanDescriptor
 {

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/ClassDescriptor.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/ClassDescriptor.java?rev=325963&r1=325962&r2=325963&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/ClassDescriptor.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/ClassDescriptor.java Mon Oct 17 12:07:21 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2004 The Apache Software Foundation.
+ * Copyright 2000-2005 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,10 +20,10 @@
 
 /**
  * 
- * This class contains mapping information for one java bean class
+ * ClassDescriptor is used by the mapper to read general information on a class
  * 
  * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
- * @version $Id: Exp $
+ * 
  */
 public class ClassDescriptor
 {
@@ -128,8 +128,7 @@
     }
     
     
-    /**
-     * 
+    /**     
      * @return all {@link BeanDescriptor} defined in this ClassDescriptor
      */
     public Collection getBeanDescriptors()
@@ -162,7 +161,6 @@
     }
         
     /**
-     * 
      * @return all {@link BeanDescriptor} defined in this ClassDescriptor
      */
     public Collection getCollectionDescriptors()
@@ -170,16 +168,28 @@
         return collectionDescriptors.values();   
     }
     
+    /**
+     * @return the fieldDescriptor ID  
+     */
     public FieldDescriptor getIdFieldDescriptor()
     {
         return idFieldDescriptor;
     }
     
+    /**
+     * Check if this class has an ID 
+     * @return true if the class has an ID
+     */
     public boolean hasIdField()
     {
         return this.idFieldDescriptor != null;
     }
     
+    /**
+     * Get the JCR name used for one of the object attributes
+     * @param fieldName the object attribute name (can be an atomic field, bean field or a collection field)
+     * @return the JCR name found 
+     */
     public String getJcrName(String fieldName)
     {
     	return (String) this.fieldNames.get(fieldName);

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/CollectionDescriptor.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/CollectionDescriptor.java?rev=325963&r1=325962&r2=325963&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/CollectionDescriptor.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/CollectionDescriptor.java Mon Oct 17 12:07:21 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2004 The Apache Software Foundation.
+ * Copyright 2000-2005 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -17,11 +17,10 @@
 
 /**
  * 
- * This class information to map one java bean field (attribute) into subnode
- * 
+ * CollectionDescriptor is used by the mapper to read general information on a collection field
  * 
  * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
- * @version $Id: Exp $
+ * 
  */
 public class CollectionDescriptor
 {
@@ -73,11 +72,12 @@
         return elementClassName;
     }
     /**
-     * @param elementClassName The elementClassName to set.
+     * @param elementClassName The collection element class name to set.
+     *
      */
-    public void setElementClassName(String className)
+    public void setElementClassName(String elementClassName)
     {
-        this.elementClassName = className;
+        this.elementClassName = elementClassName;
     }
 
     /**
@@ -95,28 +95,56 @@
         this.proxy = proxy;
     }
     
+    /**
+     * 
+     * @return The collection converter class name 
+     */
     public String getCollectionConverterClassName()
     {
         return collectionConverterClassName;
     }
     
+    /**
+     * Set the collection converter class name
+     * @param collectionConverterClassName The converter to set
+     */
     public void setCollectionConverterClassName(String collectionConverterClassName)
     {
         this.collectionConverterClassName = collectionConverterClassName;
     }
     
+    /**
+     *  
+     * @return the collection class name (can be also a Map)
+     */
     public String getCollectionClassName()
     {
         return collectionClassName;
     }
-    public void setCollectionClassName(String managableCollectionClassName)
+    
+    /**
+     * Set the collection class name. 
+     * This collection class has to implement {@link org.apache.portals.graffito.jcr.persistence.collectionconverter.ManageableCollection}
+     * @param collectionClassName The collection class name to set
+     */
+    public void setCollectionClassName(String collectionClassName)
     {
-        this.collectionClassName = managableCollectionClassName;
+        this.collectionClassName = collectionClassName;
     }
+    
+    /**
+     * 
+     * @return The associated class descriptor
+     */
     public ClassDescriptor getClassDescriptor()
     {
         return classDescriptor;
     }
+    
+    /**
+     * Set the associated class descriptor
+     * @param classDescriptor the class descriptor to set 
+     */
     public void setClassDescriptor(ClassDescriptor classDescriptor)
     {
         this.classDescriptor = classDescriptor;

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/FieldDescriptor.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/FieldDescriptor.java?rev=325963&r1=325962&r2=325963&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/FieldDescriptor.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/FieldDescriptor.java Mon Oct 17 12:07:21 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2004 The Apache Software Foundation.
+ * Copyright 2000-2005 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -17,11 +17,11 @@
 
 /**
  * 
- * This class contains mapping information for one java bean field (attribute)
- * A FieldDescriptor is used to map a simple attribute to a jcr property
+ *
+ * FieldDescriptor is used by the mapper to read general information on a atomic field
  * 
  * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
- * @version $Id: Exp $
+ *
  */
 public class FieldDescriptor
 {
@@ -62,19 +62,36 @@
         this.jcrName = jcrName;
     }
     
+    /**
+     * 
+     * @return the associated class descriptor
+     */
     public ClassDescriptor getClassDescriptor()
     {
         return classDescriptor;
     }
     
+    /**
+     * Set the associated class descriptor 
+     * @param classDescriptor  the class descriptor to set
+     */
     public void setClassDescriptor(ClassDescriptor classDescriptor)
     {
         this.classDescriptor = classDescriptor;
     }
+    
+    /**    
+     * @return true if the field is the class ID 
+     */
     public boolean isId()
     {
         return id;
     }
+    
+    /**
+     * 
+     * @param id
+     */
     public void setId(boolean id)
     {
         this.id = id;

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/MappingDescriptor.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/MappingDescriptor.java?rev=325963&r1=325962&r2=325963&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/MappingDescriptor.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/mapper/model/MappingDescriptor.java Mon Oct 17 12:07:21 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2004 The Apache Software Foundation.
+ * Copyright 2000-2005 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -29,16 +29,30 @@
 {
     private HashMap classDescriptors = new HashMap();
     
+    /**
+     * Add a new ClassDescriptor
+     * 
+     * @param classDescriptor The class descriptor to add
+     */
     public void addClassDescriptor(ClassDescriptor classDescriptor)
     {
         classDescriptors.put(classDescriptor.getClassName(), classDescriptor);
     }
     
+    /**
+     * Get the classdescriptor to used for the class 
+     * @param className the class name 
+     * @return the class descriptor found or null
+     */
     public ClassDescriptor getClassDescriptor(String className)
     {
         return (ClassDescriptor) classDescriptors.get(className);
     }
     
+    /**
+     * Get all class descriptors 
+     * @return all class descriptors found
+     */
     public Map getClassDescriptors()
     {
     	return classDescriptors;

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/PersistenceManager.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/PersistenceManager.java?rev=325963&r1=325962&r2=325963&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/PersistenceManager.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/PersistenceManager.java Mon Oct 17 12:07:21 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2004 The Apache Software Foundation.
+ * Copyright 2000-2005 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -18,104 +18,111 @@
 import java.util.Collection;
 import java.util.Iterator;
 
-import org.apache.portals.graffito.jcr.exception.JcrMappingException;
+import org.apache.portals.graffito.jcr.exception.PersistenceException;
 import org.apache.portals.graffito.jcr.query.Query;
 
 /**
- * The persistence manager encapsulate a JCR session. 
+ * The persistence manager encapsulates a JCR session. 
  * This is the main component used to manage objects into the JCR repository.
  * 
  * @author Sandro Boehme 
  * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
- * @version $Id: Exp $
+ * 
  */
 public interface PersistenceManager
 {
     
     /**
-     * Check if an item exists
-     * @param path the JCR item path
-     * @throws org.apache.portals.graffito.jcr.exception.JcrMappingException 
+     * Check if an object exists
+     * @param path the JCR item path  
      * @return true if the item exists
+     * @throws PersistenceException when it is not possible to check if the item exist
      */
-    public boolean itemExists(String path) throws JcrMappingException;
+    public boolean objectExists(String path) throws PersistenceException;
 
     /**
      * Insert an object into the JCR repository
      * @param path the target path 
-     * @param object the object to add
-     * @throws org.apache.portals.graffito.jcr.exception.JcrMappingException 
+     * @param object the object to add    
+     * @throws PersistenceException when it is not possible to insert the object 
      */
-    public void insert(String path, Object object) throws JcrMappingException;
+    public void insert(String path, Object object) throws PersistenceException;
 
     /**
      * Update an object 
      * @param path the object paht
-     * @param object the object to update
-     * @throws org.apache.portals.graffito.jcr.exception.JcrMappingException 
+     * @param object the object to update 
+     * @throws PersistenceException when it is not possible to update the object
      */
-    public void update(String path, Object object) throws JcrMappingException;
+    public void update(String path, Object object) throws PersistenceException;
 
     /**
      * Get an object from the JCR repository 
-     * @param pojoClass the object class
-     * @param path the object pagt
-     * @throws org.apache.portals.graffito.jcr.exception.JcrMappingException 
+     * @param objectClass the object class
+     * @param path the object path
      * @return the object found or null
+     * 
+     * @throws PersistenceException when it is not possible to retrieve the object 
      */
-    public Object getObject(Class pojoClass, String path) throws JcrMappingException;
+    public Object getObject(Class objectClass, String path) throws PersistenceException;
 
     /**
      * Remove an object from a JCR repository
-     * @param path the object paht
-     * @throws org.apache.portals.graffito.jcr.exception.JcrMappingException 
+     * @param path the object path
+     * @throws PersistenceException when it is not possible to remove the object 
+     * 
      */
-    public void remove(String path) throws JcrMappingException;
+    public void remove(String path) throws PersistenceException;
     
     /**
      * Remove all objects matching to a query
-     * @param query The query used to find the objects to delete
-     * @throws org.apache.portals.graffito.jcr.exception.JcrMappingException 
+     * @param query The query used to find the objects to remove
+     * @throws PersistenceException when it is not possible to remove all objects 
+     * 
      */
-    public void remove(Query query) throws JcrMappingException;
+    public void remove(Query query) throws PersistenceException;
 
     
     /**
      * Retrieve an object matching to a query     
      * @param query The Graffito Query object used to seach the object
      * @return The object found or null
+     * @throws PersistenceException when it is not possible to retrieve the object 
      * 
      */
-    public Object getObject(Query query) throws JcrMappingException;
+    public Object getObject(Query query) throws PersistenceException;
 
     
     /**
-     * Retrieve some pojo objects matching to a query     
-     * @param query The Graffito Query object used to seach the objects
-     * @return a collection of object found
+     * Retrieve some objects matching to a query     
+     * @param query The query used to seach the objects
+     * @return a collection of objects found
+     * @throws PersistenceException when it is not possible to retrieve the objects 
      * 
      */
-    public Collection getObjects(Query query) throws JcrMappingException;
+    public Collection getObjects(Query query) throws PersistenceException;
     
     
     /**
-     * Retrieve some pojo objects matching to a query. 
+     * Retrieve some objects matching to a query. 
      *  
-     * @param query The Graffito Query object used to seach the objects
+     * @param query The query used to seach the objects
      * @return an iterator of objects found
-     * @throws JcrMappingException
+     * @throws PersistenceException when it is not possible to retrieve the objects 
      */
-    public Iterator getObjectIterator (Query query) throws JcrMappingException;
+    public Iterator getObjectIterator (Query query) throws PersistenceException;
     
     /**
-     * Close the JCR session    
+     * Close the session    
+     * @throws PersistenceException when it is not possible to logout
      */
-    public void logout() throws JcrMappingException;
+    public void logout() throws PersistenceException;
     
     /**
      * Save all modifications made by the persistence manager
      *
+     * @throws PersistenceException when it is not possible to save all pending operation into the JCR repo 
      */
-    public void save() throws JcrMappingException;
+    public void save() throws PersistenceException;
         
 }

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/AtomicTypeConverter.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/AtomicTypeConverter.java?rev=325963&r1=325962&r2=325963&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/AtomicTypeConverter.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/AtomicTypeConverter.java Mon Oct 17 12:07:21 2005
@@ -19,13 +19,11 @@
 
 import javax.jcr.Value;
 
-import org.apache.portals.graffito.jcr.exception.IncorrectAtomicTypeException;
-
 /**
  * 
  * AtomicTypeConverter interface.
  * 
- * The Object converter used atomic type converters to map atomic fields to JCR Value object.
+ * The Object converter used atomic type converters to map atomic fields to JCR Value objects.
  * Amotic fields are primitive java types and their wrapper classes.
  * 
  * 
@@ -38,27 +36,25 @@
 	/**
 	 * Convert an object into a JCR value.
 	 * 
-	 * @param propValue The object to convert
-	 * @return the matching JCR value
-	 * @throws IncorrectAtomicTypeException when the object is not a correct atomic type 
+	 * @param object The object to convert
+	 * @return the corresponding JCR value
+	 *  
 	 */
-	public Value getValue(Object object) throws IncorrectAtomicTypeException;
+	public Value getValue(Object object);
 
 	/**
 	 * Convert a jcr property value into an object
 	 * 
 	 * @param value The JCR property value
-	 * @return the matching object
-	 * @throws IncorrectAtomicTypeException when it is not possible to convert the JCR property
+	 * @return the corresponding object	
 	 */
-	public Object getObject(Value value)  throws IncorrectAtomicTypeException;
+	public Object getObject(Value value);
 	
 	/**
 	 * Get the string converted value
 	 * @param object The object value
-	 * @return The string converted value
-	 * @throws IncorrectAtomicTypeException when it is not possible to convert the object value into String
+	 * @return The string converted value	 
 	 */
-	public String getStringValue(Object object)   throws IncorrectAtomicTypeException;
+	public String getStringValue(Object object);
 
 }

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/AbstractAtomicTypeConverterImpl.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/AbstractAtomicTypeConverterImpl.java?rev=325963&r1=325962&r2=325963&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/AbstractAtomicTypeConverterImpl.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/AbstractAtomicTypeConverterImpl.java Mon Oct 17 12:07:21 2005
@@ -19,7 +19,6 @@
 import javax.jcr.Value;
 import javax.jcr.ValueFactory;
 
-import org.apache.portals.graffito.jcr.exception.IncorrectAtomicTypeException;
 import org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter;
 
 /**
@@ -33,6 +32,10 @@
 
 	private ValueFactory valueFactory;
 
+	/**
+	 * Constructor
+	 * @param factory The JCR Value factory to used
+	 */
 	public AbstractAtomicTypeConverterImpl(ValueFactory factory)
 	{
 		super();
@@ -43,14 +46,14 @@
 	 * 
 	 * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getValue(java.lang.Object)
 	 */
-	public abstract Value getValue(Object propValue)  throws IncorrectAtomicTypeException;
+	public abstract Value getValue(Object propValue);
 
 
     /**
      * 
      * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getObject(javax.jcr.Value)
      */
-	public abstract Object getObject(Value value)  throws IncorrectAtomicTypeException;
+	public abstract Object getObject(Value value);
 
 	/**
 	 * Set the JCR value factory

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/BinaryTypeConverterImpl.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/BinaryTypeConverterImpl.java?rev=325963&r1=325962&r2=325963&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/BinaryTypeConverterImpl.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/BinaryTypeConverterImpl.java Mon Oct 17 12:07:21 2005
@@ -19,6 +19,7 @@
 
 import java.io.InputStream;
 
+import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 import javax.jcr.ValueFactory;
 
@@ -33,19 +34,20 @@
  */
 public class BinaryTypeConverterImpl extends AbstractAtomicTypeConverterImpl
 {
-	
+	/**
+	 * Constructor
+	 * @param factory The JCR Value factory to used
+	 */
 	public BinaryTypeConverterImpl(ValueFactory factory)
 	{
 		super(factory);
-		
 	}
 
-
 	/**
 	 * 
 	 * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getValue(java.lang.Object)
 	 */
-    public Value getValue(Object propValue) throws IncorrectAtomicTypeException
+    public Value getValue(Object propValue)
     {
         if (propValue == null)
         {
@@ -56,15 +58,15 @@
 
     /**
      * 
-     * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getObject(javax.jcr.Node, java.lang.String)
+     * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getObject(javax.jcr.Value)
      */
-    public Object getObject(Value value) throws IncorrectAtomicTypeException
+    public Object getObject(Value value)
     {
     	try
     	{
 		    return value.getStream();
 		}
-		catch (Exception e)
+		catch (RepositoryException e)
 		{
 			throw new IncorrectAtomicTypeException("Impossible to convert the value : " + value.toString()  , e);
 		}
@@ -75,10 +77,9 @@
      * 
      * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
      */
-	public String getStringValue(Object object)  throws IncorrectAtomicTypeException
-	{
-		
-		throw new IncorrectAtomicTypeException("Bynary cannot be convert into string");
+	public String getStringValue(Object object)
+	{		
+		throw new IncorrectAtomicTypeException("Binary cannot be convert into string");
 	}
 
     

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/BooleanTypeConverterImpl.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/BooleanTypeConverterImpl.java?rev=325963&r1=325962&r2=325963&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/BooleanTypeConverterImpl.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/BooleanTypeConverterImpl.java Mon Oct 17 12:07:21 2005
@@ -30,7 +30,10 @@
  */
 public class BooleanTypeConverterImpl extends AbstractAtomicTypeConverterImpl
 {
-
+	/**
+	 * Constructor
+	 * @param factory The JCR Value factory to used
+	 */
 	public BooleanTypeConverterImpl(ValueFactory factory)
 	{
 		super(factory);
@@ -41,7 +44,7 @@
 	 * 
 	 * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getValue(java.lang.Object)
 	 */
-	public Value getValue(Object propValue) throws IncorrectAtomicTypeException
+	public Value getValue(Object propValue)
 	{
 		if (propValue == null)
 		{
@@ -50,12 +53,13 @@
 		boolean value = ((Boolean) propValue).booleanValue();
 		return this.getValueFactory().createValue(value);
 	}
+	
 
     /**
      * 
-     * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getObject(javax.jcr.Node, java.lang.String)
+     * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getObject(javax.jcr.Value)
      */
-    public Object getObject(Value value) throws IncorrectAtomicTypeException
+	public Object getObject(Value value)
     {
     	try
     	{
@@ -71,7 +75,7 @@
 	 * 
 	 * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
 	 */
-	public String getStringValue(Object object)  throws IncorrectAtomicTypeException
+	public String getStringValue(Object object)
 	{
 		
 		return ((Boolean) object).booleanValue() ? "true()" : "false()"; 

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/ByteArrayTypeConverterImpl.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/ByteArrayTypeConverterImpl.java?rev=325963&r1=325962&r2=325963&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/ByteArrayTypeConverterImpl.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/ByteArrayTypeConverterImpl.java Mon Oct 17 12:07:21 2005
@@ -17,6 +17,7 @@
 
 package org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl;
 
+import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 import javax.jcr.ValueFactory;
 
@@ -32,6 +33,10 @@
 public class ByteArrayTypeConverterImpl extends AbstractAtomicTypeConverterImpl
 {
 
+	/**
+	 * Constructor
+	 * @param factory The JCR Value factory to used
+	 */
 	public ByteArrayTypeConverterImpl(ValueFactory factory)
 	{
 		super(factory);
@@ -42,7 +47,7 @@
 	 * 
 	 * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getValue(java.lang.Object)
 	 */
-	public Value getValue(Object propValue) throws IncorrectAtomicTypeException
+	public Value getValue(Object propValue)
 	{
 		if (propValue == null)
 		{
@@ -52,17 +57,18 @@
 		return getValueFactory().createValue(value);
 	}
 
-    /**
-     * 
-     * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getObject(javax.jcr.Node, java.lang.String)
-     */
-    public Object getObject(Value value) throws IncorrectAtomicTypeException	
+
+	/**
+	 * 
+	 * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getObject(javax.jcr.Value)
+	 */
+    public Object getObject(Value value)	
     {
 		try
 		{
 			return value.getString().getBytes();
 		}
-		catch (Exception e)
+		catch (RepositoryException e)
 		{
 			throw new IncorrectAtomicTypeException("Impossible to convert the value : " + value.toString() , e);
 		}
@@ -72,7 +78,7 @@
 	 * 
 	 * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
 	 */
-	public String getStringValue(Object object)  throws IncorrectAtomicTypeException
+	public String getStringValue(Object object)
 	{
 		
 		return  "'" + object.toString() + "'";

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/CalendarTypeConverterImpl.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/CalendarTypeConverterImpl.java?rev=325963&r1=325962&r2=325963&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/CalendarTypeConverterImpl.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/CalendarTypeConverterImpl.java Mon Oct 17 12:07:21 2005
@@ -19,6 +19,7 @@
 
 import java.util.Calendar;
 
+import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 import javax.jcr.ValueFactory;
 
@@ -33,6 +34,10 @@
 public class CalendarTypeConverterImpl extends AbstractAtomicTypeConverterImpl
 {
 
+	/**
+	 * Constructor
+	 * @param factory The JCR Value factory to used
+	 */
 	public CalendarTypeConverterImpl(ValueFactory factory)
 	{
 		super(factory);
@@ -43,7 +48,7 @@
 	 * 
 	 * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getValue(java.lang.Object)
 	 */
-	public Value getValue(Object propValue) throws IncorrectAtomicTypeException
+	public Value getValue(Object propValue)
 	{
 		if (propValue == null)
 		{
@@ -55,9 +60,9 @@
 
     /**
      * 
-     * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getObject(javax.jcr.Node, java.lang.String)
+     * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getObject(javax.jcr.Value)
      */
-    public Object getObject(Value value) throws IncorrectAtomicTypeException
+	public Object getObject(Value value)
 	{
 		try
 		{
@@ -66,7 +71,7 @@
 			calendar.setTimeInMillis(value.getLong());
 			return calendar;
 		}
-		catch (Exception e)
+		catch (RepositoryException e)
 		{
 			throw new IncorrectAtomicTypeException("Impossible to convert the value : " + value.toString(), e);
 		}
@@ -76,7 +81,7 @@
 	 * 
 	 * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
 	 */
-	public String getStringValue(Object object)  throws IncorrectAtomicTypeException
+	public String getStringValue(Object object)
 	{
 		
 		Calendar calendar = (Calendar) object;

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/DoubleTypeConverterImpl.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/DoubleTypeConverterImpl.java?rev=325963&r1=325962&r2=325963&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/DoubleTypeConverterImpl.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/DoubleTypeConverterImpl.java Mon Oct 17 12:07:21 2005
@@ -17,6 +17,7 @@
 
 package org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl;
 
+import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 import javax.jcr.ValueFactory;
 
@@ -30,6 +31,10 @@
  */
 public class DoubleTypeConverterImpl extends AbstractAtomicTypeConverterImpl
 {
+	/**
+	 * Constructor
+	 * @param factory The JCR Value factory to used
+	 */
 
 	public DoubleTypeConverterImpl(ValueFactory factory)
 	{
@@ -41,7 +46,7 @@
 	 * 
 	 * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getValue(java.lang.Object)
 	 */
-	public Value getValue(Object propValue) throws IncorrectAtomicTypeException
+	public Value getValue(Object propValue)
 	{
 		if (propValue == null)
 		{
@@ -53,16 +58,16 @@
 
     /**
      * 
-     * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getObject(javax.jcr.Node, java.lang.String)
+     * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getObject(javax.jcr.Value)
      */
-    public Object getObject(Value value) throws IncorrectAtomicTypeException
+	public Object getObject(Value value)
     {
 		try
 		{
 			double beanPropValue = value.getDouble();
 			return new Double(beanPropValue);	
 		}
-		catch (Exception e)
+		catch (RepositoryException e)
 		{
 			throw new IncorrectAtomicTypeException("Impossible to convert the value : " + value.toString(), e);
 		}
@@ -72,7 +77,7 @@
 	 * 
 	 * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
 	 */
-	public String getStringValue(Object object)  throws IncorrectAtomicTypeException
+	public String getStringValue(Object object)
 	{
 		
 		return object.toString();

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/IntTypeConverterImpl.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/IntTypeConverterImpl.java?rev=325963&r1=325962&r2=325963&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/IntTypeConverterImpl.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/IntTypeConverterImpl.java Mon Oct 17 12:07:21 2005
@@ -17,6 +17,7 @@
 
 package org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl;
 
+import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 import javax.jcr.ValueFactory;
 
@@ -31,6 +32,10 @@
 public class IntTypeConverterImpl extends AbstractAtomicTypeConverterImpl
 {
 
+	/**
+	 * Constructor
+	 * @param factory The JCR Value factory to used
+	 */
 	public IntTypeConverterImpl(ValueFactory factory)
 	{
 		super(factory);
@@ -41,7 +46,7 @@
 	 * 
 	 * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getValue(java.lang.Object)
 	 */
-	public Value getValue(Object propValue) throws IncorrectAtomicTypeException
+	public Value getValue(Object propValue)
 	{
 		if (propValue == null)
 		{
@@ -53,16 +58,16 @@
 
     /**
      * 
-     * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getObject(javax.jcr.Node, java.lang.String)
+     * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getObject(javax.jcr.Value)
      */
-    public Object getObject(Value value) throws IncorrectAtomicTypeException
+	public Object getObject(Value value)
     {
 		try
 		{
 			int beanPropValue = (int) value.getLong();
 			return new Integer(beanPropValue);
 		}
-		catch (Exception e)
+		catch (RepositoryException e)
 		{
 			throw new IncorrectAtomicTypeException("Impossible to convert the value : " + value.toString(), e);
 		}
@@ -72,7 +77,7 @@
 	 * 
 	 * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
 	 */
-	public String getStringValue(Object object)  throws IncorrectAtomicTypeException
+	public String getStringValue(Object object)
 	{
 		
 		return object.toString();

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/LongTypeConverterImpl.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/LongTypeConverterImpl.java?rev=325963&r1=325962&r2=325963&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/LongTypeConverterImpl.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/LongTypeConverterImpl.java Mon Oct 17 12:07:21 2005
@@ -17,6 +17,7 @@
 
 package org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl;
 
+import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 import javax.jcr.ValueFactory;
 
@@ -32,6 +33,10 @@
 public class LongTypeConverterImpl extends AbstractAtomicTypeConverterImpl
 {
 
+	/**
+	 * Constructor
+	 * @param factory The JCR Value factory to used
+	 */
 	public LongTypeConverterImpl(ValueFactory factory)
 	{
 		super(factory);
@@ -42,7 +47,7 @@
 	 * 
 	 * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getValue(java.lang.Object)
 	 */
-	public Value getValue(Object propValue) throws IncorrectAtomicTypeException
+	public Value getValue(Object propValue)
 	{
 		if (propValue == null)
 		{
@@ -55,16 +60,16 @@
 
     /**
      * 
-     * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getObject(javax.jcr.Node, java.lang.String)
+     * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getObject(javax.jcr.Value)
      */
-    public Object getObject(Value value) throws IncorrectAtomicTypeException
+	public Object getObject(Value value)
     {
 		try
 		{
 			long beanPropValue = value.getLong();
 			return new Long(beanPropValue);
 		}
-		catch (Exception e)
+		catch (RepositoryException e)
 		{
 			throw new IncorrectAtomicTypeException("Impossible to convert the value : " + value.toString(), e);
 		}
@@ -74,7 +79,7 @@
 	 * 
 	 * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
 	 */
-	public String getStringValue(Object object)  throws IncorrectAtomicTypeException
+	public String getStringValue(Object object)
 	{
 		
 		return object.toString();

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/StringTypeConverterImpl.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/StringTypeConverterImpl.java?rev=325963&r1=325962&r2=325963&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/StringTypeConverterImpl.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/StringTypeConverterImpl.java Mon Oct 17 12:07:21 2005
@@ -17,6 +17,7 @@
 
 package org.apache.portals.graffito.jcr.persistence.atomictypeconverter.impl;
 
+import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 import javax.jcr.ValueFactory;
 
@@ -31,14 +32,21 @@
  */
 public class StringTypeConverterImpl extends AbstractAtomicTypeConverterImpl
 {
-
+	/**
+	 * Constructor
+	 * @param factory The JCR Value factory to used
+	 */
 	public StringTypeConverterImpl(ValueFactory factory)
 	{
 		super(factory);
 
 	}
 
-	public Value getValue(Object propValue) throws IncorrectAtomicTypeException
+	/**
+	 * 
+	 * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getValue(java.lang.Object)
+	 */
+	public Value getValue(Object propValue)
 	{
 		if (propValue == null)
 		{
@@ -49,15 +57,15 @@
 
     /**
      * 
-     * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getObject(javax.jcr.Node, java.lang.String)
+     * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getObject(javax.jcr.Value)
      */
-    public Object getObject(Value value) throws IncorrectAtomicTypeException
+	public Object getObject(Value value)
     {
 		try
 		{
 			return value.getString();
 		}
-		catch (Exception e)
+		catch (RepositoryException e)
 		{
 			throw new IncorrectAtomicTypeException("Impossible to convert the value : " + value.toString(), e);
 		}
@@ -68,7 +76,7 @@
 	 * 
 	 * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
 	 */
-	public String getStringValue(Object object)  throws IncorrectAtomicTypeException
+	public String getStringValue(Object object)
 	{
 		
 		return "'" + object.toString() + "'";

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/TimestampTypeConverterImpl.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/TimestampTypeConverterImpl.java?rev=325963&r1=325962&r2=325963&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/TimestampTypeConverterImpl.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/TimestampTypeConverterImpl.java Mon Oct 17 12:07:21 2005
@@ -19,6 +19,7 @@
 
 import java.sql.Timestamp;
 
+import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 import javax.jcr.ValueFactory;
 
@@ -33,7 +34,10 @@
  */
 public class TimestampTypeConverterImpl extends AbstractAtomicTypeConverterImpl
 {
-
+	/**
+	 * Constructor
+	 * @param factory The JCR Value factory to used
+	 */
 	public TimestampTypeConverterImpl(ValueFactory factory)
 	{
 		super(factory);
@@ -44,7 +48,7 @@
 	 * 
 	 * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getValue(java.lang.Object)
 	 */
-	public Value getValue(Object propValue) throws IncorrectAtomicTypeException
+	public Value getValue(Object propValue)
 	{
 		if (propValue == null)
 			return null;
@@ -54,16 +58,16 @@
 
     /**
      * 
-     * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getObject(javax.jcr.Node, java.lang.String)
+     * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getObject(javax.jcr.Value)
      */
-    public Object getObject(Value value) throws IncorrectAtomicTypeException
+	public Object getObject(Value value)
     {
 		try
 		{
 			long beanPropValue = value.getLong();
 			return new Timestamp(beanPropValue);
 		}
-		catch (Exception e)
+		catch (RepositoryException e)
 		{
 			throw new IncorrectAtomicTypeException("Impossible to convert the value : " + value.toString(), e);
 		}
@@ -73,7 +77,7 @@
 	 * 
 	 * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
 	 */
-	public String getStringValue(Object object)  throws IncorrectAtomicTypeException
+	public String getStringValue(Object object)
 	{
 		
 		return new Long(((Timestamp) object).getTime()).toString();

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/UtilDateTypeConverterImpl.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/UtilDateTypeConverterImpl.java?rev=325963&r1=325962&r2=325963&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/UtilDateTypeConverterImpl.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/atomictypeconverter/impl/UtilDateTypeConverterImpl.java Mon Oct 17 12:07:21 2005
@@ -19,6 +19,7 @@
 
 import java.util.Date;
 
+import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 import javax.jcr.ValueFactory;
 
@@ -33,6 +34,10 @@
 public class UtilDateTypeConverterImpl extends AbstractAtomicTypeConverterImpl
 {
 
+	/**
+	 * Constructor
+	 * @param factory The JCR Value factory to used
+	 */
 	public UtilDateTypeConverterImpl(ValueFactory factory)
 	{
 		super(factory);
@@ -43,7 +48,7 @@
 	 * 
 	 * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getValue(java.lang.Object)
 	 */
-	public Value getValue(Object propValue)  throws IncorrectAtomicTypeException
+	public Value getValue(Object propValue)
 	{
 		if (propValue == null)
 		{
@@ -52,11 +57,12 @@
 		return this.getValueFactory().createValue(((java.util.Date) propValue).getTime());
 	}
 
-    /**
-     * 
-     * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getObject(javax.jcr.Node, java.lang.String)
-     */
-    public Object getObject(Value value) throws IncorrectAtomicTypeException
+
+	/**
+	 * 
+	 * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getObject(javax.jcr.Value)
+	 */
+	public Object getObject(Value value)
     {
 		try
 		{
@@ -64,7 +70,7 @@
 			return new Date(time);
 
 		}
-		catch (Exception e)
+		catch (RepositoryException e)
 		{
 			throw new IncorrectAtomicTypeException("Impossible to convert the value : " + value.toString(), e);
 		}
@@ -75,7 +81,7 @@
 	 * 
 	 * @see org.apache.portals.graffito.jcr.persistence.atomictypeconverter.AtomicTypeConverter#getStringValue(java.lang.Object)
 	 */
-	public String getStringValue(Object object)  throws IncorrectAtomicTypeException
+	public String getStringValue(Object object)
 	{
 		
 		return new Long(((java.util.Date) object).getTime()).toString();

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/CollectionConverter.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/CollectionConverter.java?rev=325963&r1=325962&r2=325963&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/CollectionConverter.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/CollectionConverter.java Mon Oct 17 12:07:21 2005
@@ -18,7 +18,7 @@
 import javax.jcr.Node;
 import javax.jcr.Session;
 
-import org.apache.portals.graffito.jcr.exception.JcrMappingException;
+import org.apache.portals.graffito.jcr.exception.PersistenceException;
 import org.apache.portals.graffito.jcr.mapper.model.CollectionDescriptor;
 
 /**
@@ -30,10 +30,42 @@
 public interface CollectionConverter
 {
 
-    public void insertCollection(Session session, Node parentNode, CollectionDescriptor collectionDescriptor, ManageableCollection collection) throws JcrMappingException;
+	/**
+	 * Insert/convert collection elements into some JCR nodes
+	 * @param session The JCR session 
+	 * @param parentNode the node which will contains the collection element
+	 * @param collectionDescriptor The collection descriptor
+	 * @param collection the collection to insert
+	 * 
+	 * @throws PersistenceException when it is not possible to insert the collection
+	 * 
+	 */
+	public void insertCollection(Session session, Node parentNode, 
+			                     CollectionDescriptor collectionDescriptor, ManageableCollection collection) throws PersistenceException;
 
-    public void updateCollection(Session session, Node objectNode, CollectionDescriptor collectionDescriptor, ManageableCollection collection) throws JcrMappingException;
+	/**
+	 * Update collection elements already present in the JCR repository
+	 * @param session The JCR session 
+	 * @param parentNode the node which will contains the collection element
+	 * @param collectionDescriptor The collection descriptor
+	 * @param collection the collection to update
+	 * 
+	 * @throws PersistenceException when it is not possible to update the collection
+	 */
+	public void updateCollection(Session session, Node parentNode, 
+			                     CollectionDescriptor collectionDescriptor, ManageableCollection collection) throws PersistenceException;
 
-    public ManageableCollection getCollection(Session session, Node parentNode, CollectionDescriptor collectionDescriptor, Class collectionFieldClass) throws JcrMappingException;
+	/**
+	 * Get a {@link ManageableCollection} from the JCR repository 
+	 * @param session The JCR session 
+	 * @param parentNode the node which contains the collection element
+	 * @param collectionDescriptor The collection descriptor
+	 * @param collectionFieldClass The collection class to used (ArrayList, Vector, ..) 
+	 * @return The collection populates with all elements found in the JCR repository
+	 * 
+	 * @throws PersistenceException when it is not possible to retrieve the collection 
+	 */
+	public ManageableCollection getCollection(Session session, Node parentNode, 
+			                                  CollectionDescriptor collectionDescriptor, Class collectionFieldClass) throws PersistenceException;
 
 }

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/ManageableCollection.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/ManageableCollection.java?rev=325963&r1=325962&r2=325963&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/ManageableCollection.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/collectionconverter/ManageableCollection.java Mon Oct 17 12:07:21 2005
@@ -19,17 +19,28 @@
 import java.util.Iterator;
 
 /** 
- * Common interface used to persist any kind of Collection or Map
+ * Common interface used to persist any kind of Collection or Map.
+ * 
  *
  * @author <a href="mailto:christophe.lombart@gmail.com">Christophe Lombart</a>
  * 
  */
 public interface ManageableCollection
 {
-    public void addObject(Object anObject);
+    /**
+     * Add an object into this ManageableCollection
+     * @param object the object to add
+     */
+	public void addObject(Object object);
    
+	/**
+	 * @return The ManageableCollection iterator
+	 */
     public Iterator getIterator();
     
+    /** 
+     * @return The ManageableCollection size
+     */
     public int getSize();
     
     



Mime
View raw message