incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r331594 - in /incubator/graffito/trunk/jcr-mapping/src: dtd/ java/org/apache/portals/graffito/jcr/mapper/impl/ java/org/apache/portals/graffito/jcr/mapper/model/ java/org/apache/portals/graffito/jcr/persistence/ java/org/apache/portals/graf...
Date Mon, 07 Nov 2005 20:24:47 GMT
Author: clombart
Date: Mon Nov  7 12:24:19 2005
New Revision: 331594

URL: http://svn.apache.org/viewcvs?rev=331594&view=rev
Log:
Jira Issue GRFT-59

Modified:
    incubator/graffito/trunk/jcr-mapping/src/dtd/graffito-jcr-mapping.dtd
    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/model/ClassDescriptor.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/persistence/PersistenceManager.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/test-config/jcrmapping-atomic.xml
    incubator/graffito/trunk/jcr-mapping/src/test-config/jcrmapping.xml
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/mapper/DigesterMapperImplTest.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/PersistenceManagerBasicVersionningTest.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/PersistenceManagerSameNameSiblingTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerScopeQueryTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerSimpleQueryTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerTest.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/A.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/Atomic.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/MultiValue.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/Page.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/Paragraph.java
    incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/hashmap/Main.java

Modified: incubator/graffito/trunk/jcr-mapping/src/dtd/graffito-jcr-mapping.dtd
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/dtd/graffito-jcr-mapping.dtd?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/dtd/graffito-jcr-mapping.dtd (original)
+++ incubator/graffito/trunk/jcr-mapping/src/dtd/graffito-jcr-mapping.dtd Mon Nov  7 12:24:19 2005
@@ -33,14 +33,16 @@
     Field descriptor - A field descriptor maps one atomic object attribute (primitive types, String, Long, ...)  into a JCR property
     * fieldName : the field/attribute name
     * jcrName : the jcr property name (optional). If it is not defined, fieldname is used to specify the jcr property name
-    * id : specifies if the column is an id column. Id is optional. If the class contains an id field, some process can run faster
+    * id : specifies if the field is an id. Id is optional. If the class contains an id field, some process can run faster
+    * path : specified if the fiels is the object path
 -->
 
 <!ELEMENT field-descriptor EMPTY>
 <!ATTLIST field-descriptor
 	fieldName CDATA #REQUIRED
 	jcrName CDATA #IMPLIED 
-	id (true | false) "false"
+	id (true | false) "false"
+	path (true | false) "false"
 >
 
 <!--

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=331594&r1=331593&r2=331594&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 Nov  7 12:24:19 2005
@@ -69,6 +69,7 @@
 			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.addSetProperties("graffito-jcr/class-descriptor/field-descriptor", "path", "path");
 			digester.addSetNext("graffito-jcr/class-descriptor/field-descriptor", "addFieldDescriptor");
 
 			// --------------------------------------------------------------------------------

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=331594&r1=331593&r2=331594&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 Nov  7 12:24:19 2005
@@ -31,6 +31,7 @@
      private String className;
      private String jcrNodeType;
      private FieldDescriptor idFieldDescriptor;
+     private FieldDescriptor pathFieldDescriptor;
      
      private HashMap fieldDescriptors = new HashMap();
      private HashMap beanDescriptors = new HashMap();
@@ -81,6 +82,11 @@
            this.idFieldDescriptor = fieldDescriptor;
         }
         
+        if (fieldDescriptor.isPath())
+        {
+        	this.pathFieldDescriptor = fieldDescriptor;
+        }
+        
         fieldDescriptors.put(fieldDescriptor.getFieldName(), fieldDescriptor);
         fieldNames.put(fieldDescriptor.getFieldName(), fieldDescriptor.getJcrName());
     }
@@ -174,6 +180,14 @@
     public FieldDescriptor getIdFieldDescriptor()
     {
         return idFieldDescriptor;
+    }
+    
+    /**
+     * @return the fieldDescriptor path  
+     */
+    public FieldDescriptor getPathFieldDescriptor()
+    {
+        return pathFieldDescriptor;
     }
     
     /**

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=331594&r1=331593&r2=331594&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 Nov  7 12:24:19 2005
@@ -30,6 +30,7 @@
      private String jcrName;
      private ClassDescriptor classDescriptor;
      private boolean id;
+     private boolean path;
      
     
     
@@ -96,4 +97,21 @@
     {
         this.id = id;
     }
+	/**
+	 * @return Returns true if the field is the object JCR path.
+	 */
+	public boolean isPath()
+	{
+		return path;
+	}
+	/**
+	 * @param path The path to set.
+	 */
+	public void setPath(boolean path)
+	{
+		this.path = path;
+	}
+    
+    
+    
 }

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=331594&r1=331593&r2=331594&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 Nov  7 12:24:19 2005
@@ -56,11 +56,11 @@
      
     /**
      * Insert an object into the JCR repository
-     * @param path the target path 
+     * 
      * @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 PersistenceException;
+    public void insert(Object object) throws PersistenceException;
 
     /**
      * Update an object 
@@ -68,7 +68,7 @@
      * @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 PersistenceException;
+    public void update(Object object) throws PersistenceException;
 
     /**
      * Get an object from the JCR repository 
@@ -100,6 +100,15 @@
      */
     public void remove(String path) throws PersistenceException;
     
+    
+    /**
+     * Remove an object from a JCR repository
+     * @param object the object to remove
+     * @throws PersistenceException when it is not possible to remove the object 
+     * 
+     */
+    public void remove(Object object) throws PersistenceException;
+    
     /**
      * Remove all objects matching to a query
      * @param query The query used to find the objects to remove
@@ -209,7 +218,12 @@
      */
     public Version getRootVersion(String path) throws VersionException;
     
-    
+    /**
+     * Get the lastest object version 
+     * @param path the object path
+     * @return the last version found 
+     * @throws VersionException when it is not possible to get the last version 
+     */
     public Version getBaseVersion(String path) throws VersionException;
     /**
      * Get a particular version

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerImpl.java?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerImpl.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerImpl.java Mon Nov  7 12:24:19 2005
@@ -140,12 +140,14 @@
 	}
 
 	/**
-	 * @see org.apache.portals.graffito.jcr.persistence.PersistenceManager#insert(java.lang.String, java.lang.Object)
+	 * @see org.apache.portals.graffito.jcr.persistence.PersistenceManager#insert(java.lang.Object)
 	 */
-	public void insert(String path, Object object)
+	public void insert(Object object)
 	{
+		String path = objectConverter.getPath(session, object);
 		try
 		{
+			
 			if (session.itemExists(path))
 			{
 				Item item = session.getItem(path);
@@ -168,15 +170,16 @@
 			throw new PersistenceException("Impossible to insert the object at " + path, e);
 		}
 
-		objectConverter.insert(session, path, object);
+		objectConverter.insert(session, object);
 
 	}
 
 	/**
-	 * @see org.apache.portals.graffito.jcr.persistence.PersistenceManager#update(java.lang.String, java.lang.Object)
+	 * @see org.apache.portals.graffito.jcr.persistence.PersistenceManager#update(java.lang.Object)
 	 */
-	public void update(String path, Object object)
+	public void update(Object object)
 	{
+		String path = objectConverter.getPath(session, object);
 		try
 		{
 			if (!session.itemExists(path))
@@ -189,7 +192,7 @@
 			throw new PersistenceException("Impossible to update", e);
 		}
 
-		objectConverter.update(session, path, object);
+		objectConverter.update(session, object);
 	}
 
 	/**
@@ -209,6 +212,12 @@
 		{
 			throw new PersistenceException("Impossible to remove the object at " + path);
 		}
+	}
+
+	
+	public void remove(Object object) throws PersistenceException 
+	{
+          this.remove(objectConverter.getPath(session, object));
 	}
 
 	/**

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=331594&r1=331593&r2=331594&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 Mon Nov  7 12:24:19 2005
@@ -32,23 +32,21 @@
 	/**
 	 * Insert the object 
 	 * 
-	 * @param session the JCR session 
-	 * @param path the JCR path 
+	 * @param session the JCR session  
 	 * @param object the object to insert
 	 * @throws PersistenceException when it is not possible to insert the object
 	 * 
 	 */
-    public void insert(Session session, String path, Object object) throws PersistenceException;
+    public void insert(Session session, Object object) throws PersistenceException;
     
 	/**
 	 * Update the object 
 	 * 
 	 * @param session the JCR session 
-	 * @param path the JCR path 
 	 * @param object the object to update
 	 * @throws PersistenceException when it is not possible to update the object
 	 */    
-    public void update(Session session, String path, Object object) throws PersistenceException;
+    public void update(Session session, Object object) throws PersistenceException;
     
     /**
      * Retrieve an object from the JCR repo
@@ -86,5 +84,14 @@
     public void update(Session session, Node parentNode, String nodeName, Object object) throws PersistenceException;
     
    
+    /**
+     * Get the object JCR path 
+     * 
+     * @param session the JCR session 
+     * @param object the object for which the path has to be retrieve 
+     * @return the object JCR path 
+     * @throws PersistenceException when it is not possible to retrieve the object path
+     */
+    public String getPath(Session session , Object object)  throws PersistenceException;
 
 }

Modified: incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/impl/ObjectConverterImpl.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/impl/ObjectConverterImpl.java?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/impl/ObjectConverterImpl.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/impl/ObjectConverterImpl.java Mon Nov  7 12:24:19 2005
@@ -73,10 +73,11 @@
 	}
 
 	/**
-	 * @see org.apache.portals.graffito.jcr.persistence.objectconverter.ObjectConverter#insert(javax.jcr.Session, java.lang.String, java.lang.Object)
+	 * @see org.apache.portals.graffito.jcr.persistence.objectconverter.ObjectConverter#insert(javax.jcr.Session, java.lang.Object)
 	 */
-	public void insert(Session session, String path, Object object)
+	public void insert(Session session, Object object)
 	{
+		String path = this.getPath(session, object);
 		try
 		{
 			String parentPath = RepositoryUtil.getParentPath(path);
@@ -128,10 +129,11 @@
 	}
 
 	/**
-	 * @see org.apache.portals.graffito.jcr.persistence.objectconverter.ObjectConverter#update(javax.jcr.Session, java.lang.String, java.lang.Object)
+	 * @see org.apache.portals.graffito.jcr.persistence.objectconverter.ObjectConverter#update(javax.jcr.Session, java.lang.Object)
 	 */
-	public void update(Session session, String path, Object object) 
+	public void update(Session session, Object object) 
 	{
+		String path = this.getPath(session, object);
 		try
 		{
 			String parentPath = RepositoryUtil.getParentPath(path);
@@ -216,6 +218,29 @@
 		}
 	}
 
+
+	public String getPath(Session session, Object object)
+	{
+		try
+		{
+			ClassDescriptor classDescriptor = mapper.getClassDescriptor(object.getClass());
+			if (classDescriptor == null)
+			{
+				throw new PersistenceException("Class of type: " + object.getClass().getName() + " is not JCR persistable. Maybe element 'class-descriptor' for this type in mapping file is missing");
+			}
+			
+			String pathField = classDescriptor.getPathFieldDescriptor().getFieldName();
+			return (String) PropertyUtils.getNestedProperty(object, pathField);
+
+
+		}
+		catch (Exception e)
+		{
+			throw new PersistenceException("Impossible to get the path", e);
+		}
+
+	}	
+	
 	/**
 	 * Retrieve simple fields (atomic fields)
 	 */
@@ -227,14 +252,23 @@
 		while (fieldDescriptorIterator.hasNext())
 		{
 			FieldDescriptor fieldDescriptor = (FieldDescriptor) fieldDescriptorIterator.next();
+			
 			String fieldName = fieldDescriptor.getFieldName();
 			String propertyName = fieldDescriptor.getJcrName();
-
-			AtomicTypeConverter converter = (AtomicTypeConverter) atomicTypeConverters.get(PropertyUtils.getPropertyType(object, fieldName));
-			if (node.hasProperty(propertyName))
+			
+			if (fieldDescriptor.isPath())
 			{
-				Object fieldValue = converter.getObject(node.getProperty(propertyName).getValue());
-				PropertyUtils.setNestedProperty(object, fieldName, fieldValue);
+				PropertyUtils.setNestedProperty(object, fieldName, node.getPath());
+			} 
+			else 
+			{
+				AtomicTypeConverter converter = (AtomicTypeConverter) atomicTypeConverters
+						.get(PropertyUtils.getPropertyType(object, fieldName));
+				if (node.hasProperty(propertyName)) 
+				{
+					Object fieldValue = converter.getObject(node.getProperty(propertyName).getValue());
+					PropertyUtils.setNestedProperty(object, fieldName, fieldValue);
+				}
 			}
 		}
 	}
@@ -385,8 +419,16 @@
 
 			Iterator fieldDescriptorIterator = classDescriptor.getFieldDescriptors().iterator();
 			while (fieldDescriptorIterator.hasNext())
-			{
+			{				 
+				
 				FieldDescriptor fieldDescriptor = (FieldDescriptor) fieldDescriptorIterator.next();
+				
+				//Of course, Path field is not updated as property				
+				if (fieldDescriptor.isPath())
+				{
+				   continue;	
+				}
+				
 				String fieldName = fieldDescriptor.getFieldName();
 				String jcrName = fieldDescriptor.getJcrName();
 

Modified: incubator/graffito/trunk/jcr-mapping/src/test-config/jcrmapping-atomic.xml
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test-config/jcrmapping-atomic.xml?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test-config/jcrmapping-atomic.xml (original)
+++ incubator/graffito/trunk/jcr-mapping/src/test-config/jcrmapping-atomic.xml Mon Nov  7 12:24:19 2005
@@ -4,7 +4,7 @@
 <graffito-jcr>
     <class-descriptor
 		className="org.apache.portals.graffito.jcr.testmodel.Atomic" jcrNodeType="nt:unstructured">
-
+		<field-descriptor fieldName="path" path="true" />
 		<field-descriptor fieldName="string" jcrName="string" />
 		<field-descriptor fieldName="booleanObject" jcrName="booleanObject" />
 		<field-descriptor fieldName="booleanPrimitive" jcrName="booleanPrimitive" />
@@ -21,6 +21,7 @@
 
     <class-descriptor
 		className="org.apache.portals.graffito.jcr.testmodel.MultiValue" jcrNodeType="nt:unstructured">
+		<field-descriptor fieldName="path" path="true" />
 		<field-descriptor fieldName="name" jcrName="name" />
 		<collection-descriptor fieldName="multiValues" jcrName="multiValue" proxy="false" 
 		                       elementClassName="java.lang.String" 

Modified: incubator/graffito/trunk/jcr-mapping/src/test-config/jcrmapping.xml
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test-config/jcrmapping.xml?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test-config/jcrmapping.xml (original)
+++ incubator/graffito/trunk/jcr-mapping/src/test-config/jcrmapping.xml Mon Nov  7 12:24:19 2005
@@ -6,6 +6,7 @@
   
 	<class-descriptor className="org.apache.portals.graffito.jcr.testmodel.Folder" jcrNodeType="nt:unstructured">
 		<!-- Field-descriptor is used to map simple attributes to jcr property -->
+		<field-descriptor fieldName="path" path="true" />
 		<field-descriptor fieldName="name" jcrName="name" />
 		<field-descriptor fieldName="description" jcrName="description" />
 		<field-descriptor fieldName="title" jcrName="title" />
@@ -23,7 +24,8 @@
 	<class-descriptor
 		className="org.apache.portals.graffito.jcr.testmodel.A"
 		jcrNodeType="nt:unstructured">
-		<!-- Field-descriptor is used to map simple attributes to jcr property -->
+		<!-- Field-descriptor is used to map simple attributes to jcr property -->
+		<field-descriptor fieldName="path" path="true" />
 		<field-descriptor fieldName="a1" jcrName="a1" />
 		<field-descriptor fieldName="a2" jcrName="a2" />
 
@@ -46,6 +48,7 @@
 
 	<class-descriptor className="org.apache.portals.graffito.jcr.testmodel.B"  jcrNodeType="nt:unstructured">
 		<!-- Field-descriptor is used to map simple attributes to jcr property -->
+
 		<field-descriptor fieldName="b1" jcrName="b1" />
 		<field-descriptor fieldName="b2" jcrName="b2" />
 
@@ -59,6 +62,7 @@
 
 
 	<class-descriptor className="org.apache.portals.graffito.jcr.testmodel.Page" jcrNodeType="graffito:page">
+		<field-descriptor fieldName="path" path="true" />
 		<field-descriptor fieldName="title" jcrName="graffito:title" />
 		<collection-descriptor fieldName="paragraphs" proxy="false" 
 		                       elementClassName="org.apache.portals.graffito.jcr.testmodel.Paragraph" 
@@ -66,11 +70,13 @@
 	</class-descriptor>
 
 	<class-descriptor className="org.apache.portals.graffito.jcr.testmodel.Paragraph" jcrNodeType="graffito:paragraph">
+		<field-descriptor fieldName="path" path="true" />
 		<field-descriptor fieldName="text" jcrName="graffito:text"/>
 	</class-descriptor>
 
 
 	<class-descriptor className="org.apache.portals.graffito.jcr.testmodel.hashmap.Main" jcrNodeType="nt:unstructured">
+		<field-descriptor fieldName="path" path="true" />
 		<field-descriptor fieldName="text" jcrName="text" />
 		<collection-descriptor fieldName="elements" proxy="false" 
 		                       elementClassName="org.apache.portals.graffito.jcr.testmodel.hashmap.Element" 

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/mapper/DigesterMapperImplTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/mapper/DigesterMapperImplTest.java?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/mapper/DigesterMapperImplTest.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/mapper/DigesterMapperImplTest.java Mon Nov  7 12:24:19 2005
@@ -82,6 +82,7 @@
             ClassDescriptor classDescriptor = mapper.getClassDescriptor(A.class);
             assertNotNull("ClassDescriptor is null", classDescriptor);
             assertTrue("Invalid classname", classDescriptor.getClassName().equals(A.class.getName()));
+            assertTrue("Invalid path field", classDescriptor.getPathFieldDescriptor().getFieldName().equals("path"));
             
             FieldDescriptor fieldDescriptor = classDescriptor.getFieldDescriptor("a1");
             assertNotNull("FieldDescriptor is null", fieldDescriptor);
@@ -94,6 +95,7 @@
             CollectionDescriptor collectionDescriptor = classDescriptor.getCollectionDescriptor("collection");
             assertNotNull("CollectionDescriptor is null", collectionDescriptor);
             assertTrue("Invalid jcrName for field collection", collectionDescriptor.getJcrName().equals("collection"));
+            
             
         }
         catch (JcrMappingException e)

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/atomicconverter/AtomicTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/atomicconverter/AtomicTest.java?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/atomicconverter/AtomicTest.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/atomicconverter/AtomicTest.java Mon Nov  7 12:24:19 2005
@@ -79,6 +79,7 @@
             // Create and store an object graph in the repository
             // --------------------------------------------------------------------------------
             Atomic a = new Atomic();
+            a.setPath("/test");
             a.setBooleanObject(new Boolean(true));
             a.setBooleanPrimitive(true);
             a.setIntegerObject(new Integer(100));
@@ -96,7 +97,7 @@
             ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream("Test Stream".getBytes());
             a.setInputStream(byteArrayInputStream);
             
-            persistenceManager.insert("/test", a);
+            persistenceManager.insert(a);
             persistenceManager.save();
 
              

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/atomicconverter/NullAtomicTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/atomicconverter/NullAtomicTest.java?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/atomicconverter/NullAtomicTest.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/atomicconverter/NullAtomicTest.java Mon Nov  7 12:24:19 2005
@@ -79,7 +79,7 @@
             // Create and store an object graph in the repository
             // --------------------------------------------------------------------------------
             Atomic a = new Atomic();
-            
+            a.setPath("/test");
             a.setIntegerObject(new Integer(100));            
             a.setDate(new Date());
             byte[] content = "Test Byte".getBytes();
@@ -91,7 +91,7 @@
             ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream("Test Stream".getBytes());
             a.setInputStream(byteArrayInputStream);
             
-            persistenceManager.insert("/test", a);
+            persistenceManager.insert(a);
             persistenceManager.save();
              
             // --------------------------------------------------------------------------------

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/DefaultCollectionConverterImplTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/DefaultCollectionConverterImplTest.java?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/DefaultCollectionConverterImplTest.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/DefaultCollectionConverterImplTest.java Mon Nov  7 12:24:19 2005
@@ -78,7 +78,7 @@
             // Create and store an object graph in the repository
             // --------------------------------------------------------------------------------
             A a = new A();
-            
+            a.setPath("/test");
             C c1 = new C();
             c1.setId("first");
             c1.setName("First Element");
@@ -98,7 +98,7 @@
             
             a.setCollection(collection);
             
-            persistenceManager.insert("/test", a);
+            persistenceManager.insert(a);
             persistenceManager.save();
             
             // --------------------------------------------------------------------------------
@@ -125,7 +125,7 @@
             collection.add(c2);
             a.setCollection(collection);
             
-            persistenceManager.update("/test", a);
+            persistenceManager.update(a);
             persistenceManager.save();
 
             // --------------------------------------------------------------------------------
@@ -162,7 +162,7 @@
             // Create and store an object graph in the repository
             // --------------------------------------------------------------------------------
             A a = new A();
-            
+            a.setPath("/test");
             C c1 = new C();
             c1.setId("first");
             c1.setName("First Element");
@@ -182,7 +182,7 @@
             
             a.setCollection(collection);
             
-            persistenceManager.insert("/test", a);
+            persistenceManager.insert(a);
             persistenceManager.save();
             
             // --------------------------------------------------------------------------------
@@ -218,7 +218,7 @@
             collection.add(c4);
             a.setCollection(collection);
             
-            persistenceManager.update("/test", a);
+            persistenceManager.update(a);
             persistenceManager.save();
 
             // --------------------------------------------------------------------------------

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/HashMapTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/HashMapTest.java?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/HashMapTest.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/HashMapTest.java Mon Nov  7 12:24:19 2005
@@ -16,8 +16,6 @@
  */
 package org.apache.portals.graffito.jcr.persistence.collectionconverter.impl;
 
-import java.util.ArrayList;
-
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
@@ -25,8 +23,6 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.portals.graffito.jcr.TestBase;
 import org.apache.portals.graffito.jcr.persistence.PersistenceManager;
-import org.apache.portals.graffito.jcr.testmodel.Page;
-import org.apache.portals.graffito.jcr.testmodel.Paragraph;
 import org.apache.portals.graffito.jcr.testmodel.hashmap.Element;
 import org.apache.portals.graffito.jcr.testmodel.hashmap.HashMapElement;
 import org.apache.portals.graffito.jcr.testmodel.hashmap.Main;
@@ -82,6 +78,7 @@
             // --------------------------------------------------------------------------------
 
             Main main = new Main();
+            main.setPath("/test");
             main.setText("Main text");
             
             HashMapElement hashMapElement = new HashMapElement();
@@ -97,7 +94,7 @@
             
             main.setElements(hashMapElement);
             
-            persistenceManager.insert("/test", main);
+            persistenceManager.insert(main);
             persistenceManager.save();
             
             // --------------------------------------------------------------------------------
@@ -128,7 +125,7 @@
             hashMapElement.addObject(e3);
             main.setElements(hashMapElement);
             
-            persistenceManager.update("/test", main);
+            persistenceManager.update(main);
             persistenceManager.save();
 
             // --------------------------------------------------------------------------------

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/MultiValueCollectionConverterImplTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/MultiValueCollectionConverterImplTest.java?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/MultiValueCollectionConverterImplTest.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/MultiValueCollectionConverterImplTest.java Mon Nov  7 12:24:19 2005
@@ -82,6 +82,8 @@
             // --------------------------------------------------------------------------------
 
             MultiValue multiValue = new MultiValue();
+            multiValue.setPath("/test");
+            
             ArrayList values = new ArrayList();
             values.add("Value1");
             values.add("Value2");
@@ -89,7 +91,7 @@
             values.add("Value4");
             multiValue.setMultiValues(values);
             
-            persistenceManager.insert("/test", multiValue);
+            persistenceManager.insert(multiValue);
             persistenceManager.save();
             
             // --------------------------------------------------------------------------------
@@ -112,7 +114,7 @@
             values.add("Value5");
             multiValue.setMultiValues(values);
             
-            persistenceManager.update("/test", multiValue);
+            persistenceManager.update(multiValue);
             persistenceManager.save();
 
             // --------------------------------------------------------------------------------

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/NTCollectionConverterImplTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/NTCollectionConverterImplTest.java?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/NTCollectionConverterImplTest.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/collectionconverter/impl/NTCollectionConverterImplTest.java Mon Nov  7 12:24:19 2005
@@ -81,6 +81,7 @@
             // --------------------------------------------------------------------------------
 
             Page page = new Page();
+            page.setPath("/test");
             page.setTitle("Page Title");
             
             ArrayList paragraphs = new ArrayList();
@@ -90,7 +91,7 @@
             paragraphs.add(new Paragraph("Para 3"));
             page.setParagraphs(paragraphs);
             
-            persistenceManager.insert("/test", page);
+            persistenceManager.insert(page);
             persistenceManager.save();
             
             // --------------------------------------------------------------------------------
@@ -113,7 +114,7 @@
             paragraphs.add(new Paragraph("Para 5"));
             page.setParagraphs(paragraphs);
             
-            persistenceManager.update("/test", page);
+            persistenceManager.update(page);
             persistenceManager.save();
 
             // --------------------------------------------------------------------------------

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerAtomicQueryTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerAtomicQueryTest.java?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerAtomicQueryTest.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerAtomicQueryTest.java Mon Nov  7 12:24:19 2005
@@ -200,6 +200,7 @@
 			for (int i = 1; i <= 100; i++)
 			{
 				Atomic a = new Atomic();
+				a.setPath("/test" + i);
 				a.setBooleanObject(new Boolean(i%2==0));
 				a.setBooleanPrimitive(true);
 				a.setIntegerObject(new Integer(100 * i));
@@ -223,7 +224,7 @@
 					 a.setByteArray("This is small object stored in a Graffito repository".getBytes());
 					 a.setInputStream(new ByteArrayInputStream("Another Stream".getBytes()));
 				}
-				persistenceManager.insert("/test" + i, a);
+				persistenceManager.insert(a);
 				
 				
 			}

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerBasicVersionningTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerBasicVersionningTest.java?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerBasicVersionningTest.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerBasicVersionningTest.java Mon Nov  7 12:24:19 2005
@@ -57,22 +57,23 @@
              {
             	 
             	 Page page = new Page();
+            	 page.setPath("/page");
             	 page.setTitle("Page Title");            	 
             	 page.addParagraph(new Paragraph("para1"));
             	 page.addParagraph(new Paragraph("para2"));
-            	 persistenceManager.insert("/page", page);
+            	 persistenceManager.insert(page);
             	 persistenceManager.save();
             	 
                  
             	 page.addParagraph(new Paragraph("para3"));
             	 persistenceManager.checkout("/page");
-            	 persistenceManager.update("/page", page);
+            	 persistenceManager.update(page);
             	 persistenceManager.save();
             	 persistenceManager.checkin("/page");
             	 
             	 page.addParagraph(new Paragraph("para4"));
             	 persistenceManager.checkout("/page");
-            	 persistenceManager.update("/page", page);
+            	 persistenceManager.update(page);
             	 persistenceManager.save();
             	 persistenceManager.checkin("/page");            	 
 
@@ -116,22 +117,23 @@
              {
             	 
             	 Page page = new Page();
+            	 page.setPath("/page");
             	 page.setTitle("Page Title");            	 
             	 page.addParagraph(new Paragraph("para1"));
             	 page.addParagraph(new Paragraph("para2"));
-            	 persistenceManager.insert("/page", page);
+            	 persistenceManager.insert(page);
             	 persistenceManager.save();
             	 
                  
             	 page.addParagraph(new Paragraph("para3"));
             	 persistenceManager.checkout("/page");
-            	 persistenceManager.update("/page", page);
+            	 persistenceManager.update(page);
             	 persistenceManager.save();
             	 persistenceManager.checkin("/page", new String[] {"A", "B"});
             	 
             	 page.addParagraph(new Paragraph("para4"));
             	 persistenceManager.checkout("/page");
-            	 persistenceManager.update("/page", page);
+            	 persistenceManager.update(page);
             	 persistenceManager.save();
             	 persistenceManager.checkin("/page", new String[] {"C", "D"});         	 
 

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerIteratorQueryTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerIteratorQueryTest.java?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerIteratorQueryTest.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerIteratorQueryTest.java Mon Nov  7 12:24:19 2005
@@ -146,6 +146,7 @@
 			root.save();
 			
 			Page page = new Page();
+			page.setPath("/test/node1/page1");
 			page.setTitle("Page 1 Title");
 			
 			ArrayList paragraphs = new ArrayList();
@@ -156,10 +157,11 @@
 			paragraphs.add(new Paragraph("Another Para "));
 			page.setParagraphs(paragraphs);
 			
-			persistenceManager.insert("/test/node1/page1", page);
+			persistenceManager.insert(page);
 						
 			
 			page = new Page();
+			page.setPath("/test/node1/page2");
 			page.setTitle("Page 2 Title");
 			
 			paragraphs = new ArrayList();
@@ -170,9 +172,10 @@
 			paragraphs.add(new Paragraph("Another Para"));
 			page.setParagraphs(paragraphs);
 			
-			persistenceManager.insert("/test/node1/page2", page);
+			persistenceManager.insert(page);
 			
 			page = new Page();
+			page.setPath("/test/node2/page1");
 			page.setTitle("Page 3 Title");
 			
 			paragraphs = new ArrayList();
@@ -183,9 +186,10 @@
 			paragraphs.add(new Paragraph("Another Para"));
 			page.setParagraphs(paragraphs);
 			
-			persistenceManager.insert("/test/node2/page1", page);
+			persistenceManager.insert(page);
 
 			page = new Page();
+			page.setPath("/test/node2/page2");
 			page.setTitle("Page 4 Title");
 			
 			paragraphs = new ArrayList();
@@ -196,7 +200,7 @@
 			paragraphs.add(new Paragraph("Another Para"));
 			page.setParagraphs(paragraphs);
 			
-			persistenceManager.insert("/test/node2/page2", page);
+			persistenceManager.insert(page);
 			
 			persistenceManager.save();
 			

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerMultiValueQueryTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerMultiValueQueryTest.java?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerMultiValueQueryTest.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerMultiValueQueryTest.java Mon Nov  7 12:24:19 2005
@@ -125,6 +125,7 @@
 			root.addNode("test");
 
             MultiValue multiValue = new MultiValue();
+            multiValue.setPath("/test/m1");
             multiValue.setName("m1");
             ArrayList values = new ArrayList();
             values.add("Value1");
@@ -132,9 +133,10 @@
             values.add("Value3");
             values.add("Value4");
             multiValue.setMultiValues(values);
-            persistenceManager.insert("/test/m1", multiValue);
+            persistenceManager.insert(multiValue);
             
             multiValue = new MultiValue();
+            multiValue.setPath("/test/m2");
             multiValue.setName("m2");
             values = new ArrayList();
             values.add("Value1");
@@ -142,9 +144,10 @@
             values.add("Value6");
             values.add("Value7");            
             multiValue.setMultiValues(values);
-            persistenceManager.insert("/test/m2", multiValue);
+            persistenceManager.insert(multiValue);
             
             multiValue = new MultiValue();
+            multiValue.setPath("/test/m3");
             multiValue.setName("m3");
             values = new ArrayList();
             values.add("Value1");
@@ -153,7 +156,7 @@
             values.add("Value9");
             
             multiValue.setMultiValues(values);
-            persistenceManager.insert("/test/m3", multiValue);
+            persistenceManager.insert(multiValue);
                                    
             persistenceManager.save();
             

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerRemoveTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerRemoveTest.java?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerRemoveTest.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerRemoveTest.java Mon Nov  7 12:24:19 2005
@@ -130,6 +130,7 @@
 			for (int i = 1; i <= 10; i++)
 			{
 				Atomic a = new Atomic();
+				a.setPath("/test" + i);
 				a.setBooleanObject(new Boolean(i % 2 == 0));
 				a.setBooleanPrimitive(true);
 				a.setIntegerObject(new Integer(100 * i));
@@ -153,7 +154,7 @@
 					a.setByteArray("This is small object stored in a Graffito repository".getBytes());
 					a.setInputStream(new ByteArrayInputStream("Another Stream".getBytes()));
 				}
-				persistenceManager.insert("/test" + i, a);
+				persistenceManager.insert(a);
 
 			}
 			persistenceManager.save();

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerSameNameSiblingTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerSameNameSiblingTest.java?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerSameNameSiblingTest.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerSameNameSiblingTest.java Mon Nov  7 12:24:19 2005
@@ -89,7 +89,7 @@
             
             // Update the object 
             atomic.setString("Modified Test String 10");
-            persistenceManager.update("/test[10]", atomic);
+            persistenceManager.update(atomic);
             persistenceManager.save();
 
             // Query on the attribute "string"
@@ -132,14 +132,18 @@
              {
             	 
             	 Page page = new Page();
+            	 page.setPath("/page");
             	 page.setTitle("Page Title");            	 
-            	 persistenceManager.insert("/page", page);
+            	 persistenceManager.insert(page);
             	 persistenceManager.save();
             	 
             	 Paragraph p1 = new Paragraph("para1");
-            	 persistenceManager.insert("/page/paragraph", p1);
+            	 p1.setPath("/page/paragraph");
+            	 persistenceManager.insert(p1);
+            	 
             	 Paragraph p2 = new Paragraph("para1");
-            	 persistenceManager.insert("/page/paragraph", p2);
+            	 p2.setPath("/page/paragraph");
+            	 persistenceManager.insert(p2);
                  fail();            	 
             	 
              }
@@ -162,6 +166,7 @@
 			for (int i = 1; i <= 10; i++)
 			{
 				Atomic a = new Atomic();
+				a.setPath("/test");
 				a.setBooleanObject(new Boolean(i%2==0));
 				a.setBooleanPrimitive(true);
 				a.setIntegerObject(new Integer(100 * i));
@@ -185,7 +190,7 @@
 					 a.setByteArray("This is small object stored in a Graffito repository".getBytes());
 					 a.setInputStream(new ByteArrayInputStream("Another Stream".getBytes()));
 				}
-				persistenceManager.insert("/test", a);
+				persistenceManager.insert(a);
 				
 				
 			}

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerScopeQueryTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerScopeQueryTest.java?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerScopeQueryTest.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerScopeQueryTest.java Mon Nov  7 12:24:19 2005
@@ -169,6 +169,7 @@
 			root.save();
 			
 			Page page = new Page();
+			page.setPath("/test/node1/page1");
 			page.setTitle("Page 1 Title");
 			
 			ArrayList paragraphs = new ArrayList();
@@ -179,10 +180,11 @@
 			paragraphs.add(new Paragraph("Another Para "));
 			page.setParagraphs(paragraphs);
 			
-			persistenceManager.insert("/test/node1/page1", page);
+			persistenceManager.insert(page);
 						
 			
 			page = new Page();
+			page.setPath("/test/node1/page2");
 			page.setTitle("Page 2 Title");
 			
 			paragraphs = new ArrayList();
@@ -193,9 +195,10 @@
 			paragraphs.add(new Paragraph("Another Para"));
 			page.setParagraphs(paragraphs);
 			
-			persistenceManager.insert("/test/node1/page2", page);
+			persistenceManager.insert(page);
 			
 			page = new Page();
+			page.setPath("/test/node2/page1");
 			page.setTitle("Page 3 Title");
 			
 			paragraphs = new ArrayList();
@@ -206,9 +209,10 @@
 			paragraphs.add(new Paragraph("Another Para"));
 			page.setParagraphs(paragraphs);
 			
-			persistenceManager.insert("/test/node2/page1", page);
+			persistenceManager.insert( page);
 
 			page = new Page();
+			page.setPath("/test/node2/page2");
 			page.setTitle("Page 4 Title");
 			
 			paragraphs = new ArrayList();
@@ -219,7 +223,7 @@
 			paragraphs.add(new Paragraph("Another Para"));
 			page.setParagraphs(paragraphs);
 			
-			persistenceManager.insert("/test/node2/page2", page);
+			persistenceManager.insert(page);
 			persistenceManager.save();
 
 			

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerSimpleQueryTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerSimpleQueryTest.java?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerSimpleQueryTest.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerSimpleQueryTest.java Mon Nov  7 12:24:19 2005
@@ -259,6 +259,7 @@
     	PersistenceManager persistenceManager = getPersistenceManager();
 
         Page page = new Page();
+        page.setPath("/test");
         page.setTitle("Page Title");
         
         ArrayList paragraphs = new ArrayList();
@@ -269,7 +270,7 @@
         paragraphs.add(new Paragraph("Another Para "));
         page.setParagraphs(paragraphs);
         
-        persistenceManager.insert("/test", page);  
+        persistenceManager.insert(page);  
         persistenceManager.save();
                 
 

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerTest.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerTest.java?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerTest.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/persistence/impl/PersistenceManagerTest.java Mon Nov  7 12:24:19 2005
@@ -79,6 +79,7 @@
             // Create and store an object graph in the repository
             // --------------------------------------------------------------------------------
             A a = new A();
+            a.setPath("/test");
             a.setA1("a1");
             a.setA2("a2");
             B b = new B();
@@ -105,7 +106,7 @@
             
             a.setCollection(collection);
             
-            persistenceManager.insert("/test", a);
+            persistenceManager.insert(a);
             persistenceManager.save();
             
 
@@ -130,7 +131,7 @@
             a.setB(newB);
             
             
-            persistenceManager.update("/test", a);
+            persistenceManager.update(a);
             persistenceManager.save();
 
             // --------------------------------------------------------------------------------

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/A.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/A.java?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/A.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/A.java Mon Nov  7 12:24:19 2005
@@ -25,6 +25,7 @@
  */
 public class A
 {
+	private String path; 
     private String a1;
     private String a2;
     private B b;
@@ -33,7 +34,14 @@
     private Collection emptyCollection; 
     
     
-    /**
+    
+    public String getPath() {
+		return path;
+	}
+	public void setPath(String path) {
+		this.path = path;
+	}
+	/**
      * @return Returns the a1.
      */
     public String getA1()

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/Atomic.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/Atomic.java?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/Atomic.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/Atomic.java Mon Nov  7 12:24:19 2005
@@ -30,6 +30,7 @@
  */
 public class Atomic
 {
+	private String path;
     private String string;
     private Boolean booleanObject;
     private boolean booleanPrimitive;
@@ -45,7 +46,14 @@
     private Collection multiValue;
     
     
-    public Boolean getBooleanObject()
+    
+    public String getPath() {
+		return path;
+	}
+	public void setPath(String path) {
+		this.path = path;
+	}
+	public Boolean getBooleanObject()
     {
         return booleanObject;
     }

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/MultiValue.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/MultiValue.java?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/MultiValue.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/MultiValue.java Mon Nov  7 12:24:19 2005
@@ -27,6 +27,8 @@
  */
 public class MultiValue
 {
+	private String path;
+	
 	private String name;
 	
 	private Collection multiValues;
@@ -35,6 +37,14 @@
 
 	
 	
+	public String getPath() {
+		return path;
+	}
+
+	public void setPath(String path) {
+		this.path = path;
+	}
+
 	/**
 	 * @return Returns the name.
 	 */

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/Page.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/Page.java?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/Page.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/Page.java Mon Nov  7 12:24:19 2005
@@ -26,10 +26,19 @@
  */
 public class Page
 {
+	String path;
     String title;
     Collection paragraphs;
     
-    /**
+    public String getPath()
+    {
+		return path;
+	}
+	public void setPath(String path) 
+	{
+		this.path = path;
+	}
+	/**
      * @return Returns the paragraphs.
      */
     public Collection getParagraphs()

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/Paragraph.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/Paragraph.java?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/Paragraph.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/Paragraph.java Mon Nov  7 12:24:19 2005
@@ -23,10 +23,22 @@
  */
 public class Paragraph
 {
-    private String text;
+    private String path;
+	private String text;
 
 
-    public Paragraph()
+	
+    public String getPath() 
+    {
+		return path;
+	}
+
+	public void setPath(String path) 
+	{
+		this.path = path;
+	}
+
+	public Paragraph()
     {
         this.text = "Default text";
     }

Modified: incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/hashmap/Main.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/hashmap/Main.java?rev=331594&r1=331593&r2=331594&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/hashmap/Main.java (original)
+++ incubator/graffito/trunk/jcr-mapping/src/test/org/apache/portals/graffito/jcr/testmodel/hashmap/Main.java Mon Nov  7 12:24:19 2005
@@ -24,9 +24,19 @@
  */
 public class Main
 {
+	private String path;
     private String text;
     private HashMapElement elements;
-    /**
+    
+    
+    
+    public String getPath() {
+		return path;
+	}
+	public void setPath(String path) {
+		this.path = path;
+	}
+	/**
      * @return Returns the elements.
      */
     public HashMapElement getElements()



Mime
View raw message