jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1342688 - in /jackrabbit/commons/ocm/trunk/src: main/java/org/apache/jackrabbit/ocm/mapper/impl/annotation/ test/java/org/apache/jackrabbit/ocm/mapper/ test/java/org/apache/jackrabbit/ocm/testmodel/ test/test-config/
Date Fri, 25 May 2012 15:39:05 GMT
Author: ard
Date: Fri May 25 15:39:04 2012
New Revision: 1342688

URL: http://svn.apache.org/viewvc?rev=1342688&view=rev
Log:
OCM-50 use the jcrType annotation from the collection annotation or description instead of
from the elements in the collection. If the jcrType is empty, the collection node will be
treated according the cnd definition

Modified:
    jackrabbit/commons/ocm/trunk/src/main/java/org/apache/jackrabbit/ocm/mapper/impl/annotation/AnnotationDescriptorReader.java
    jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/mapper/AnnotationMapperImplTest.java
    jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/mapper/DigesterMapperImplTest.java
    jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/testmodel/A.java
    jackrabbit/commons/ocm/trunk/src/test/test-config/jcrmapping-testdigester.xml
    jackrabbit/commons/ocm/trunk/src/test/test-config/jcrmapping.xml

Modified: jackrabbit/commons/ocm/trunk/src/main/java/org/apache/jackrabbit/ocm/mapper/impl/annotation/AnnotationDescriptorReader.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/ocm/trunk/src/main/java/org/apache/jackrabbit/ocm/mapper/impl/annotation/AnnotationDescriptorReader.java?rev=1342688&r1=1342687&r2=1342688&view=diff
==============================================================================
--- jackrabbit/commons/ocm/trunk/src/main/java/org/apache/jackrabbit/ocm/mapper/impl/annotation/AnnotationDescriptorReader.java
(original)
+++ jackrabbit/commons/ocm/trunk/src/main/java/org/apache/jackrabbit/ocm/mapper/impl/annotation/AnnotationDescriptorReader.java
Fri May 25 15:39:04 2012
@@ -243,7 +243,6 @@ public class AnnotationDescriptorReader 
 		   collectionDescriptor.setJcrName(field.getName());
 		}
 
-		Node annotationNode = (Node) targetClass.getAnnotation(Node.class);
 		collectionDescriptor.setProxy(collectionAnnotation.proxy());
 
 		collectionDescriptor.setAutoInsert(collectionAnnotation.autoInsert());
@@ -267,10 +266,7 @@ public class AnnotationDescriptorReader 
 		}
 
 		collectionDescriptor.setCollectionConverter(collectionAnnotation.collectionConverter().getName());
-		if (annotationNode != null)
-		{
-		    collectionDescriptor.setJcrType(annotationNode.jcrType());
-		}
+		collectionDescriptor.setJcrType(collectionAnnotation.jcrType());
 		collectionDescriptor.setJcrSameNameSiblings(collectionAnnotation.jcrSameNameSiblings());
 		collectionDescriptor.setJcrAutoCreated(collectionAnnotation.jcrAutoCreated());
 		collectionDescriptor.setJcrProtected(collectionAnnotation.jcrProtected());

Modified: jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/mapper/AnnotationMapperImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/mapper/AnnotationMapperImplTest.java?rev=1342688&r1=1342687&r2=1342688&view=diff
==============================================================================
--- jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/mapper/AnnotationMapperImplTest.java
(original)
+++ jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/mapper/AnnotationMapperImplTest.java
Fri May 25 15:39:04 2012
@@ -203,7 +203,7 @@ public class AnnotationMapperImplTest ex
 			CollectionDescriptor collectionDescriptor = classDescriptor2
 					.getCollectionDescriptor("collection");
 			assertNotNull(collectionDescriptor);
-			assertEquals(collectionDescriptor.getJcrType(), "ocm:C");
+			assertEquals(collectionDescriptor.getJcrType(), "nt:unstructured");
 			assertFalse(collectionDescriptor.isJcrAutoCreated());
 			assertFalse(collectionDescriptor.isJcrMandatory());
 			assertFalse(collectionDescriptor.isJcrProtected());

Modified: jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/mapper/DigesterMapperImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/mapper/DigesterMapperImplTest.java?rev=1342688&r1=1342687&r2=1342688&view=diff
==============================================================================
--- jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/mapper/DigesterMapperImplTest.java
(original)
+++ jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/mapper/DigesterMapperImplTest.java
Fri May 25 15:39:04 2012
@@ -203,7 +203,7 @@ public class DigesterMapperImplTest exte
 			CollectionDescriptor collectionDescriptor = classDescriptor2
 					.getCollectionDescriptor("collection");
 			assertNotNull(collectionDescriptor);
-			assertEquals(collectionDescriptor.getJcrType(), "ocm:C");
+			assertEquals(collectionDescriptor.getJcrType(), "nt:unstructured");
 			assertFalse(collectionDescriptor.isJcrAutoCreated());
 			assertFalse(collectionDescriptor.isJcrMandatory());
 			assertFalse(collectionDescriptor.isJcrProtected());

Modified: jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/testmodel/A.java
URL: http://svn.apache.org/viewvc/jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/testmodel/A.java?rev=1342688&r1=1342687&r2=1342688&view=diff
==============================================================================
--- jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/testmodel/A.java
(original)
+++ jackrabbit/commons/ocm/trunk/src/test/java/org/apache/jackrabbit/ocm/testmodel/A.java
Fri May 25 15:39:04 2012
@@ -39,7 +39,7 @@ public class A
 
     private B emptyB;
 
-    @Collection(elementClassName=C.class, jcrType="ocm:C", jcrOnParentVersion="IGNORE") private
java.util.Collection collection;	
+    @Collection(elementClassName=C.class, jcrType="nt:unstructured", jcrOnParentVersion="IGNORE")
private java.util.Collection collection;
     @Collection(elementClassName=C.class) private java.util.Collection emptyCollection;
 
     public String getPath() {

Modified: jackrabbit/commons/ocm/trunk/src/test/test-config/jcrmapping-testdigester.xml
URL: http://svn.apache.org/viewvc/jackrabbit/commons/ocm/trunk/src/test/test-config/jcrmapping-testdigester.xml?rev=1342688&r1=1342687&r2=1342688&view=diff
==============================================================================
--- jackrabbit/commons/ocm/trunk/src/test/test-config/jcrmapping-testdigester.xml (original)
+++ jackrabbit/commons/ocm/trunk/src/test/test-config/jcrmapping-testdigester.xml Fri May
25 15:39:04 2012
@@ -53,7 +53,7 @@
 		<collection-descriptor fieldName="collection"
 			jcrName="collection" proxy="false"
 			elementClassName="org.apache.jackrabbit.ocm.testmodel.C"
-			jcrType="ocm:C" jcrAutoCreated="false" jcrMandatory="false"
+      jcrType="nt:unstructured" jcrAutoCreated="false" jcrMandatory="false"
 			jcrOnParentVersion="IGNORE" jcrProtected="false"
 			jcrSameNameSiblings="false" />
 

Modified: jackrabbit/commons/ocm/trunk/src/test/test-config/jcrmapping.xml
URL: http://svn.apache.org/viewvc/jackrabbit/commons/ocm/trunk/src/test/test-config/jcrmapping.xml?rev=1342688&r1=1342687&r2=1342688&view=diff
==============================================================================
--- jackrabbit/commons/ocm/trunk/src/test/test-config/jcrmapping.xml (original)
+++ jackrabbit/commons/ocm/trunk/src/test/test-config/jcrmapping.xml Fri May 25 15:39:04 2012
@@ -48,7 +48,7 @@
 
 		-->
 		<collection-descriptor fieldName="collection" jcrName="collection" proxy="false"
-        elementClassName="org.apache.jackrabbit.ocm.testmodel.C" jcrType="ocm:C"
+        elementClassName="org.apache.jackrabbit.ocm.testmodel.C" jcrType="nt:unstructured"
         jcrAutoCreated="false" jcrMandatory="false" jcrOnParentVersion="IGNORE"
         jcrProtected="false" jcrSameNameSiblings="false"/>
 



Mime
View raw message