jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r563635 - in /jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/annotation/src: main/java/org/apache/jackrabbit/ocm/annotation/ main/java/org/apache/jackrabbit/ocm/annotation/mapper/ test/java/org/apache/jackrabbit/ocm/annotation/model/
Date Tue, 07 Aug 2007 19:36:08 GMT
Author: clombart
Date: Tue Aug  7 12:36:08 2007
New Revision: 563635

URL: http://svn.apache.org/viewvc?view=rev&rev=563635
Log:
Fix for issue 1054 - 2 different attributes are used in BeanDescriptor and CollectionDescriptor
to store the jcr type (jcrType and jcrNodeType).
Use the same name in the annotations

Modified:
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/annotation/src/main/java/org/apache/jackrabbit/ocm/annotation/Node.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/annotation/src/main/java/org/apache/jackrabbit/ocm/annotation/mapper/AnnotatedObjectMapper.java
    jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/annotation/src/test/java/org/apache/jackrabbit/ocm/annotation/model/Address.java

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/annotation/src/main/java/org/apache/jackrabbit/ocm/annotation/Node.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/annotation/src/main/java/org/apache/jackrabbit/ocm/annotation/Node.java?view=diff&rev=563635&r1=563634&r2=563635
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/annotation/src/main/java/org/apache/jackrabbit/ocm/annotation/Node.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/annotation/src/main/java/org/apache/jackrabbit/ocm/annotation/Node.java
Tue Aug  7 12:36:08 2007
@@ -28,7 +28,7 @@
 @Retention(RetentionPolicy.RUNTIME)
 public @interface Node {
     
-	String jcrNodeType() default "nt:unstructured";
+	String jcrType() default "nt:unstructured";
 	String jcrSuperTypes() default "";
 	String jcrMixinTypes() default "";
     // Define the extend setting in the mapping descriptor - Provide less flexibility if
we use the java instrospection	

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/annotation/src/main/java/org/apache/jackrabbit/ocm/annotation/mapper/AnnotatedObjectMapper.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/annotation/src/main/java/org/apache/jackrabbit/ocm/annotation/mapper/AnnotatedObjectMapper.java?view=diff&rev=563635&r1=563634&r2=563635
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/annotation/src/main/java/org/apache/jackrabbit/ocm/annotation/mapper/AnnotatedObjectMapper.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/annotation/src/main/java/org/apache/jackrabbit/ocm/annotation/mapper/AnnotatedObjectMapper.java
Tue Aug  7 12:36:08 2007
@@ -164,7 +164,7 @@
 			ClassDescriptor classDescriptor = buildClassDescriptor(clazz);
 			try {
 				session.getWorkspace().getNodeTypeManager().getNodeType(
-						classDescriptor.getJcrNodeType());
+						classDescriptor.getJcrType());
 				log.info("Class " + className + " already registered");
 			} catch (NoSuchNodeTypeException e) {
 				log.info("Class " + className + " will be registered");
@@ -174,7 +174,7 @@
 			}
 
 			descriptorMap.put(clazz, classDescriptor);
-			nodeTypeMap.put(classDescriptor.getJcrNodeType(), classDescriptor);
+			nodeTypeMap.put(classDescriptor.getJcrType(), classDescriptor);
 		}
 
 		return classDescriptorsToRegister;
@@ -184,7 +184,7 @@
 		Node annotationNode =  (Node) clazz.getAnnotation(Node.class);
 		ClassDescriptor descriptor = new ClassDescriptor();
 		descriptor.setClassName(clazz.getName());
-		descriptor.setJcrNodeType(annotationNode.jcrNodeType());
+		descriptor.setJcrType(annotationNode.jcrType());
 		descriptor.setJcrSuperTypes(annotationNode.jcrSuperTypes());		
 		descriptor.setJcrMixinTypes(annotationNode.jcrMixinTypes());
 		descriptor.setExtend(annotationNode.extend());		
@@ -228,7 +228,7 @@
 				}
 				
 				Node annotationNode = (Node) targetClass.getAnnotation(Node.class);
-				collectionDescriptor.setDefaultPrimaryType(annotationNode.jcrNodeType());
+				collectionDescriptor.setDefaultPrimaryType(annotationNode.jcrType());
 				collectionDescriptor.setJcrSameNameSiblings(jcrChildNode.sameNameSiblings());
 				collectionDescriptor.setJcrAutoCreated(jcrChildNode.autoCreate());
 				collectionDescriptor.setJcrProtected(jcrChildNode.protect());
@@ -242,7 +242,7 @@
 				collectionDescriptor.setCollectionConverter(jcrChildNode.converter().getName());
 				collectionDescriptor.setFieldName(propertyDescriptor.getName());
 
-				collectionDescriptor.setJcrNodeType(annotationNode.jcrNodeType());
+				collectionDescriptor.setJcrType(annotationNode.jcrType());
 				collectionDescriptor.setJcrSameNameSiblings(jcrChildNode.sameNameSiblings());
 				collectionDescriptor.setProxy(jcrChildNode.proxy());
 
@@ -281,7 +281,7 @@
 				beanDescriptor.setAutoInsert(jcrChildNode.autoInsert());
 				beanDescriptor.setAutoRetrieve(jcrChildNode.autoRetrieve());
 				beanDescriptor.setAutoUpdate(jcrChildNode.autoUpdate());
-				beanDescriptor.setJcrNodeType(jcrChildNode.jcrType());
+				beanDescriptor.setJcrType(jcrChildNode.jcrType());
 				beanDescriptor.setJcrAutoCreated(jcrChildNode.jcrAutoCreated());
 				beanDescriptor.setJcrMandatory(jcrChildNode.jcrMandatory());
 				beanDescriptor.setJcrOnParentVersion(jcrChildNode.jcrOnParentVersion());

Modified: jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/annotation/src/test/java/org/apache/jackrabbit/ocm/annotation/model/Address.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/annotation/src/test/java/org/apache/jackrabbit/ocm/annotation/model/Address.java?view=diff&rev=563635&r1=563634&r2=563635
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/annotation/src/test/java/org/apache/jackrabbit/ocm/annotation/model/Address.java
(original)
+++ jackrabbit/trunk/contrib/jackrabbit-jcr-mapping/annotation/src/test/java/org/apache/jackrabbit/ocm/annotation/model/Address.java
Tue Aug  7 12:36:08 2007
@@ -8,7 +8,7 @@
  * 
  * @author Philip Dodds
  */
-@Node(jcrNodeType="ocm:Adress")
+@Node(jcrType="ocm:Adress")
 public class Address {
 
     private String path; 



Mime
View raw message