jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r582680 [3/3] - in /jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src: main/java/org/apache/jackrabbit/ocm/manager/objectconverter/impl/ main/java/org/apache/jackrabbit/ocm/mapper/impl/ main/java/org/apache/jackrabbit/ocm/mapp...
Date Sun, 07 Oct 2007 20:54:58 GMT
Copied: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/DigesterResidualNodesCollectionConverterImplTest.java
(from r580157, jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/ResidualNodesCollectionConverterImplTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/DigesterResidualNodesCollectionConverterImplTest.java?p2=jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/DigesterResidualNodesCollectionConverterImplTest.java&p1=jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/ResidualNodesCollectionConverterImplTest.java&r1=580157&r2=582680&rev=582680&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/ResidualNodesCollectionConverterImplTest.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/DigesterResidualNodesCollectionConverterImplTest.java
Sun Oct  7 13:54:52 2007
@@ -34,15 +34,15 @@
  * @author <a href="mailto:fmeschbe[at]apache[dot]com">Felix Meschberger</a>
  * 
  */
-public class ResidualNodesCollectionConverterImplTest extends DigesterTestBase
+public class DigesterResidualNodesCollectionConverterImplTest extends DigesterTestBase
 {
-    private final static Log log = LogFactory.getLog(ResidualNodesCollectionConverterImplTest.class);
+    private final static Log log = LogFactory.getLog(DigesterResidualNodesCollectionConverterImplTest.class);
 
     /**
      * <p>Defines the test case name for junit.</p>
      * @param testName The test case name.
      */
-    public ResidualNodesCollectionConverterImplTest(String testName)  throws Exception
+    public DigesterResidualNodesCollectionConverterImplTest(String testName)  throws Exception
     {
         super(testName);
     }
@@ -50,7 +50,7 @@
     public static Test suite()
     {
         // All methods starting with "test" will be executed in the test suite.
-        return new RepositoryLifecycleTestSetup(new TestSuite(ResidualNodesCollectionConverterImplTest.class));
+        return new RepositoryLifecycleTestSetup(new TestSuite(DigesterResidualNodesCollectionConverterImplTest.class));
     }
 
     
@@ -59,11 +59,7 @@
      */
     public void tearDown() throws Exception
     {
-        if (getObjectContentManager().objectExists("/test"))
-        {
-            getObjectContentManager().remove("/test");
-            getObjectContentManager().save();
-        }        
+    	this.cleanUpRepisotory();          
     	
         super.tearDown();
     }    

Copied: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/DigesterResidualPropertiesCollectionConverterImplTest.java
(from r580157, jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/ResidualPropertiesCollectionConverterImplTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/DigesterResidualPropertiesCollectionConverterImplTest.java?p2=jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/DigesterResidualPropertiesCollectionConverterImplTest.java&p1=jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/ResidualPropertiesCollectionConverterImplTest.java&r1=580157&r2=582680&rev=582680&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/ResidualPropertiesCollectionConverterImplTest.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/manager/collectionconverter/DigesterResidualPropertiesCollectionConverterImplTest.java
Sun Oct  7 13:54:52 2007
@@ -36,15 +36,15 @@
  * @author <a href="mailto:fmeschbe[at]apache[dot]com">Felix Meschberger</a>
  * 
  */
-public class ResidualPropertiesCollectionConverterImplTest extends DigesterTestBase
+public class DigesterResidualPropertiesCollectionConverterImplTest extends DigesterTestBase
 {
-    private final static Log log = LogFactory.getLog(ResidualPropertiesCollectionConverterImplTest.class);
+    private final static Log log = LogFactory.getLog(DigesterResidualPropertiesCollectionConverterImplTest.class);
 
     /**
      * <p>Defines the test case name for junit.</p>
      * @param testName The test case name.
      */
-    public ResidualPropertiesCollectionConverterImplTest(String testName)  throws Exception
+    public DigesterResidualPropertiesCollectionConverterImplTest(String testName)  throws
Exception
     {
         super(testName);
     }
@@ -52,7 +52,7 @@
     public static Test suite()
     {
         // All methods starting with "test" will be executed in the test suite.
-        return new RepositoryLifecycleTestSetup(new TestSuite(ResidualPropertiesCollectionConverterImplTest.class));
+        return new RepositoryLifecycleTestSetup(new TestSuite(DigesterResidualPropertiesCollectionConverterImplTest.class));
     }
 
     
@@ -61,11 +61,7 @@
      */
     public void tearDown() throws Exception
     {
-        if (getObjectContentManager().objectExists("/test"))
-        {
-            getObjectContentManager().remove("/test");
-            getObjectContentManager().save();
-        }        
+    	this.cleanUpRepisotory();          
     	
         super.tearDown();
     }    

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/A.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/A.java?rev=582680&r1=582679&r2=582680&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/A.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/A.java
Sun Oct  7 13:54:52 2007
@@ -17,24 +17,30 @@
 package org.apache.jackrabbit.ocm.testmodel;
 
 import java.util.ArrayList;
-import java.util.Collection;
+
+
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Bean;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Collection;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Field;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node;
 
 /**
  *
  * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe
</a>
  * @version $Id: Exp $
  */
+@Node(jcrMixinTypes="mix:lockable" )
 public class A
 {
-	private String path; 
-    private String a1;
-    private String a2;
-    private B b;
-    private B emptyB;
-    private Collection collection;
-    private Collection emptyCollection; 
-    
+	@Field(path=true) private String path; 
+    @Field private String a1;
+    @Field private String a2;
+    @Bean private B b;
     
+    private B emptyB;
+
+    @Collection(elementClassName=C.class, jcrType="ocm:C") private java.util.Collection collection;

+    @Collection(elementClassName=C.class) private java.util.Collection emptyCollection; 
     
     public String getPath() {
 		return path;
@@ -89,7 +95,7 @@
     /**
      * @return Returns the collection.
      */
-    public Collection getCollection()
+    public java.util.Collection getCollection()
     {
         return collection;
     }
@@ -97,7 +103,7 @@
     /**
      * @param collection The collection to set.
      */
-    public void setCollection(Collection collection)
+    public void setCollection(java.util.Collection collection)
     {
         this.collection = collection;
     }
@@ -111,11 +117,11 @@
        
        collection.add(c);   
     }
-    public Collection getEmptyCollection()
+    public java.util.Collection getEmptyCollection()
     {
         return emptyCollection;
     }
-    public void setEmptyCollection(Collection emptyCollection)
+    public void setEmptyCollection(java.util.Collection emptyCollection)
     {
         this.emptyCollection = emptyCollection;
     }

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/B.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/B.java?rev=582680&r1=582679&r2=582680&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/B.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/B.java
Sun Oct  7 13:54:52 2007
@@ -16,15 +16,19 @@
  */
 package org.apache.jackrabbit.ocm.testmodel;
 
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Field;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node;
+
 /**
  *
  * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe
</a>
  * @version $Id: Exp $
  */
+@Node
 public class B
 {
-     private String b1;
-     private String b2;
+     @Field private String b1;
+     @Field private String b2;
      private A a;
      
      

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/C.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/C.java?rev=582680&r1=582679&r2=582680&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/C.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/C.java
Sun Oct  7 13:54:52 2007
@@ -16,15 +16,20 @@
  */
 package org.apache.jackrabbit.ocm.testmodel;
 
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Field;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node;
+
 /**
  *
  * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe
</a>
  * @version $Id: Exp $
  */
+@Node(jcrType="ocm:C", discriminator=false)
 public class C
 {
-     private String id;
-     private String name;
+	
+	@Field(jcrName="ocm:id", id=true) private String id;
+    @Field(jcrName="ocm:name") private String name;
      
     /**
      * @return Returns the id.

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/D.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/D.java?rev=582680&r1=582679&r2=582680&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/D.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/D.java
Sun Oct  7 13:54:52 2007
@@ -16,14 +16,20 @@
  */
 package org.apache.jackrabbit.ocm.testmodel;
 
+import org.apache.jackrabbit.ocm.manager.beanconverter.impl.InlineBeanConverterImpl;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Bean;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Field;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node;
+
 
 /**
  * @author <a href='mailto:the_mindstorm[at]evolva[dot]ro'>Alexandru Popescu</a>
  */
+@Node
 public class D {
-    private String path;
-    private String d1;
-    private B b1;
+    @Field(path=true) private String path;
+    @Field private String d1;
+    @Bean(converter=InlineBeanConverterImpl.class)private B b1;
 
     /**
      * @return Returns the dB.

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/DFull.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/DFull.java?rev=582680&r1=582679&r2=582680&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/DFull.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/DFull.java
Sun Oct  7 13:54:52 2007
@@ -16,15 +16,19 @@
  */
 package org.apache.jackrabbit.ocm.testmodel;
 
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Field;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node;
+
 
 /**
  * @author <a href='mailto:the_mindstorm[at]evolva[dot]ro'>Alexandru Popescu</a>
  */
+@Node
 public class DFull {
-    private String path;
-    private String d1;
-    private String b1;
-    private String b2;
+    @Field(path=true) private String path;
+    @Field private String d1;
+    @Field private String b1;
+    @Field private String b2;
 
     /**
      * @return Returns the b1.

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/E.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/E.java?rev=582680&r1=582679&r2=582680&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/E.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/E.java
Sun Oct  7 13:54:52 2007
@@ -16,9 +16,62 @@
  */
 package org.apache.jackrabbit.ocm.testmodel;
 
+import org.apache.jackrabbit.ocm.manager.beanconverter.FakeBeanConverter;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Bean;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Field;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node;
+
 
 /**
  * @author <a href='mailto:the_mindstorm[at]evolva[dot]ro'>Alexandru Popescu</a>
  */
-public class E extends D {
+@Node
+public class E 
+{
+    @Field(path=true) private String path;
+    @Field private String d1;
+    @Bean(converter=FakeBeanConverter.class)private B b1;
+
+    /**
+     * @return Returns the dB.
+     */
+    public B getB1() {
+        return this.b1;
+    }
+
+    /**
+     * @param db The dB to set.
+     */
+    public void setB1(B db) {
+        this.b1 = db;
+    }
+
+    /**
+     * @return Returns the dString.
+     */
+    public String getD1() {
+        return this.d1;
+    }
+
+    /**
+     * @param string The dString to set.
+     */
+    public void setD1(String string) {
+        this.d1 = string;
+    }
+
+    /**
+     * @return Returns the path.
+     */
+    public String getPath() {
+        return path;
+    }
+
+    /**
+     * @param path The path to set.
+     */
+    public void setPath(String path) {
+        this.path= path;
+    }
+
 }

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/MultiValue.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/MultiValue.java?rev=582680&r1=582679&r2=582680&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/MultiValue.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/MultiValue.java
Sun Oct  7 13:54:52 2007
@@ -16,7 +16,12 @@
  */
 package org.apache.jackrabbit.ocm.testmodel;
 
-import java.util.Collection;
+
+
+import org.apache.jackrabbit.ocm.manager.collectionconverter.impl.MultiValueCollectionConverterImpl;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Collection;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Field;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node;
 
 /**
  * 
@@ -26,15 +31,18 @@
  *         Christophe </a>
  * @version $Id: Exp $
  */
+@Node
 public class MultiValue
 {
-	private String path;
+	@Field(path=true) private String path;
 	
-	private String name;
+	@Field private String name;
 	
-	private Collection multiValues;
+	@Collection(elementClassName=String.class,  collectionConverter=MultiValueCollectionConverterImpl.class)

+	private java.util.Collection multiValues;
 
-	private Collection nullMultiValues;
+	@Collection(elementClassName=String.class,  collectionConverter=MultiValueCollectionConverterImpl.class)
+	private java.util.Collection nullMultiValues;
 
 	
 	
@@ -65,7 +73,7 @@
 	/**
 	 * @return Returns the multiValues.
 	 */
-	public Collection getMultiValues()
+	public java.util.Collection getMultiValues()
 	{
 		return multiValues;
 	}
@@ -74,7 +82,7 @@
 	 * @param multiValues
 	 *            The multiValues to set.
 	 */
-	public void setMultiValues(Collection multiValues)
+	public void setMultiValues(java.util.Collection multiValues)
 	{
 		this.multiValues = multiValues;
 	}
@@ -82,7 +90,7 @@
 	/**
 	 * @return Returns the nullMultiValues.
 	 */
-	public Collection getNullMultiValues()
+	public java.util.Collection getNullMultiValues()
 	{
 		return nullMultiValues;
 	}
@@ -91,7 +99,7 @@
 	 * @param nullMultiValues
 	 *            The nullMultiValues to set.
 	 */
-	public void setNullMultiValues(Collection nullMultiValues)
+	public void setNullMultiValues(java.util.Collection nullMultiValues)
 	{
 		this.nullMultiValues = nullMultiValues;
 	}

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/Page.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/Page.java?rev=582680&r1=582679&r2=582680&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/Page.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/Page.java
Sun Oct  7 13:54:52 2007
@@ -17,18 +17,26 @@
 package org.apache.jackrabbit.ocm.testmodel;
 
 import java.util.ArrayList;
-import java.util.Collection;
+
+
+import org.apache.jackrabbit.ocm.manager.collectionconverter.impl.NTCollectionConverterImpl;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Collection;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Field;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node;
 
 /** 
  *
  * @author <a href="mailto:christophe.lombart@gmail.com">Christophe Lombart</a>
  * 
  */
+@Node(jcrType="ocm:page", discriminator=false)
 public class Page
 {
-	String path;
-    String title;
-    Collection paragraphs;
+	@Field(path=true) String path;
+    @Field(jcrName="ocm:title") String title;
+    
+    @Collection(elementClassName=Paragraph.class, collectionConverter=NTCollectionConverterImpl.class)

+    java.util.Collection paragraphs;
     
     public String getPath()
     {
@@ -41,14 +49,14 @@
 	/**
      * @return Returns the paragraphs.
      */
-    public Collection getParagraphs()
+    public java.util.Collection getParagraphs()
     {
         return paragraphs;
     }
     /**
      * @param paragraphs The paragraphs to set.
      */
-    public void setParagraphs(Collection paragraphs)
+    public void setParagraphs(java.util.Collection paragraphs)
     {
         this.paragraphs = paragraphs;
     }

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/Paragraph.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/Paragraph.java?rev=582680&r1=582679&r2=582680&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/Paragraph.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/Paragraph.java
Sun Oct  7 13:54:52 2007
@@ -16,17 +16,25 @@
  */
 package org.apache.jackrabbit.ocm.testmodel;
 
+import org.apache.jackrabbit.ocm.manager.beanconverter.impl.ParentBeanConverterImpl;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Bean;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Field;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node;
+
 /** 
  *
  * @author <a href="mailto:christophe.lombart@gmail.com">Christophe Lombart</a>
  * 
  */
+@Node(jcrType="ocm:paragraph", discriminator=false)
 public class Paragraph
 {
-    private String path;
-	private String text;
-    // Simple reference to the page containing this pararaph - cannot be updated
-	private Page page; 
+    @Field(path=true) private String path;
+	@Field(jcrName="ocm:text") private String text;
+	
+    // The converter ParentBeanConverterImpl can be used to have a simple reference 
+	// to the page containing this pararaph (parent node) - cannot be updated
+	@Bean(proxy=true, converter=ParentBeanConverterImpl.class) private Page page; 
 	
     public String getPath() 
     {

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/Residual.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/Residual.java?rev=582680&r1=582679&r2=582680&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/Residual.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/Residual.java
Sun Oct  7 13:54:52 2007
@@ -17,29 +17,28 @@
 package org.apache.jackrabbit.ocm.testmodel;
 
 import org.apache.jackrabbit.ocm.manager.collectionconverter.impl.ManagedHashMap;
+import org.apache.jackrabbit.ocm.manager.collectionconverter.impl.ResidualNodesCollectionConverterImpl;
+import org.apache.jackrabbit.ocm.manager.collectionconverter.impl.ResidualPropertiesCollectionConverterImpl;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Collection;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Field;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node;
 
 /**
  *
  * @author <a href="mailto:fmeschbe[at]apache[dot]com">Felix Meschberger</a>
  * 
+ * Note : 
+ * If the annotation are defined on the field declaration, it is mandatory to register the
ancestor classes.
+ * Otherwise, the annotation mapper will not map the fields defined in the ancester classes.

+ * 
  */
+@Node
 public class Residual
 {
-	private String path;
-    private ManagedHashMap elements;
-    
-    public static class ResidualProperties extends Residual {}
-    public static class ResidualNodes extends Residual {}
-    
-    protected Residual() {}
+	@Field(path=true) private String path;
     
+    private ManagedHashMap elements;
     
-    public String getPath() {
-		return path;
-	}
-	public void setPath(String path) {
-		this.path = path;
-	}
 	/**
      * @return Returns the elements.
      */
@@ -54,4 +53,34 @@
     {
         this.elements = elements;
     }
+
+    
+    @Node(extend=Residual.class) public static class ResidualProperties extends Residual

+    {
+        @Collection( jcrName="value*",elementClassName=String.class,collectionConverter=ResidualPropertiesCollectionConverterImpl.class,

+                collectionClassName=ManagedHashMap.class)
+        private ManagedHashMap elements;        
+        
+        
+    }
+    
+    @Node(extend=Residual.class) public static class ResidualNodes extends Residual 
+    {
+    	
+        @Collection( jcrName="value*",elementClassName=Object.class,collectionConverter=ResidualNodesCollectionConverterImpl.class,

+                collectionClassName=ManagedHashMap.class)
+        private ManagedHashMap elements;
+            
+    	
+    }
+    
+    protected Residual() {}
+    
+    
+    public String getPath() {
+		return path;
+	}
+	public void setPath(String path) {
+		this.path = path;
+	}
 }

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/Element.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/Element.java?rev=582680&r1=582679&r2=582680&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/Element.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/Element.java
Sun Oct  7 13:54:52 2007
@@ -16,16 +16,20 @@
  */
 package org.apache.jackrabbit.ocm.testmodel.collection;
 
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Field;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node;
+
 
 /**
  *
  * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe
</a>
  * @version $Id: Exp $
  */
+@Node(jcrType="ocm:element", discriminator=false)
 public class Element
 {
-    private String id;
-    private String text;
+    @Field(jcrName="ocm:id") private String id;
+    @Field(jcrName="ocm:text") private String text;
     
     
     /**

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/Main.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/Main.java?rev=582680&r1=582679&r2=582680&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/Main.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/collection/Main.java
Sun Oct  7 13:54:52 2007
@@ -16,17 +16,25 @@
  */
 package org.apache.jackrabbit.ocm.testmodel.collection;
 
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Collection;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Field;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node;
+
 
 /**
  *
- * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe
</a>
+ * @author <a href="mailto:christophe.lombart@gmail.com">Lombart Christophe </a>
  * @version $Id: Exp $
  */
+@Node
 public class Main
 {
-	private String path;
-    private String text;
+	@Field(path=true) private String path;
+    @Field private String text;
+    @Collection (elementClassName=Element.class, collectionClassName=HashMapElement.class)

     private HashMapElement hashMap;
+    
+    @Collection (elementClassName=Element.class, collectionClassName=ArrayListElement.class)
     private ArrayListElement list;
     
     public String getPath() {

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/crossreference/A.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/crossreference/A.java?rev=582680&r1=582679&r2=582680&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/crossreference/A.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/crossreference/A.java
Sun Oct  7 13:54:52 2007
@@ -17,23 +17,30 @@
 package org.apache.jackrabbit.ocm.testmodel.crossreference;
 
 import java.util.ArrayList;
-import java.util.Collection;
 
-import org.apache.jackrabbit.ocm.testmodel.C;
+
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Bean;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Collection;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Field;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node;
+
 
 /**
  *
- * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe
</a>
- * @version $Id: Exp $
+ * @author <a href="mailto:christophe.lombart@gmail.com">Lombart Christophe </a>
+ * 
  */
+@Node(jcrType="nt:unstructured", jcrMixinTypes="mix:referenceable")
 public class A
-{
-	private String path; 
-	private String uuid; 
-    private String a1;
-    private String a2;
-    private B b;    
-    private Collection collection;
+{	
+	@Field(path=true) private String path; 
+	@Field(uuid=true) private String uuid; 
+    @Field private String a1;
+    @Field private String a2;
+    @Bean private B b;
+    
+    @Collection(elementClassName=B.class) 
+    java.util.Collection collection;
      
     
     public String getPath() {
@@ -100,7 +107,7 @@
     /**
      * @return Returns the collection.
      */
-    public Collection getCollection()
+    public java.util.Collection getCollection()
     {
         return collection;
     }
@@ -108,7 +115,7 @@
     /**
      * @param collection The collection to set.
      */
-    public void setCollection(Collection collection)
+    public void setCollection(java.util.Collection collection)
     {
         this.collection = collection;
     }

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/crossreference/B.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/crossreference/B.java?rev=582680&r1=582679&r2=582680&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/crossreference/B.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/jcr-mapping/src/test/java/org/apache/jackrabbit/ocm/testmodel/crossreference/B.java
Sun Oct  7 13:54:52 2007
@@ -16,16 +16,23 @@
  */
 package org.apache.jackrabbit.ocm.testmodel.crossreference;
 
+import org.apache.jackrabbit.ocm.manager.beanconverter.impl.ReferenceBeanConverterImpl;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Bean;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Field;
+import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node;
+
 /**
  *
- * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe
</a>
- * @version $Id: Exp $
+ * @author <a href="mailto:christophe.lombart@gmail.com">Lombart Christophe </a>
+ * 
  */
+
+@Node
 public class B
 {
-     private String b1;
-     private String b2;
-     private A a;
+     @Field private String b1;
+     @Field private String b2;
+     @Bean(converter=ReferenceBeanConverterImpl.class)private A a;
      
      
     /**



Mime
View raw message