incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r365991 - /incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/impl/ObjectConverterImpl.java
Date Wed, 04 Jan 2006 21:08:14 GMT
Author: clombart
Date: Wed Jan  4 13:08:11 2006
New Revision: 365991

URL: http://svn.apache.org/viewcvs?rev=365991&view=rev
Log:
Apply patchs provided by Alexandru Popescu - see GRFT-82 & GRFT-83

Modified:
    incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/impl/ObjectConverterImpl.java

Modified: incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/impl/ObjectConverterImpl.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/impl/ObjectConverterImpl.java?rev=365991&r1=365990&r2=365991&view=diff
==============================================================================
--- incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/impl/ObjectConverterImpl.java
(original)
+++ incubator/graffito/trunk/jcr/jcr-mapping/src/java/org/apache/portals/graffito/jcr/persistence/objectconverter/impl/ObjectConverterImpl.java
Wed Jan  4 13:08:11 2006
@@ -267,8 +267,12 @@
 			} 
 			else 
 			{
+                Class fieldTypeClass = fieldDescriptor.getFieldTypeClass() != null
+                    ? fieldDescriptor.getFieldTypeClass() 
+                    : PropertyUtils.getPropertyType(object, fieldName);
+                    
 				AtomicTypeConverter converter = (AtomicTypeConverter) atomicTypeConverters
-						.get(PropertyUtils.getPropertyType(object, fieldName));
+						.get(fieldTypeClass);
 				if (node.hasProperty(propertyName)) 
 				{
 					Object fieldValue = converter.getObject(node.getProperty(propertyName).getValue());
@@ -437,7 +441,7 @@
 				String fieldName = fieldDescriptor.getFieldName();
 				String jcrName = fieldDescriptor.getJcrName();
 
-				// Check if the node property is "autocreated"
+				// Check the node properties
 				boolean autoCreated = false;
 
 				if (objectNode.hasProperty(jcrName))
@@ -448,9 +452,12 @@
 				// All auto created JCR properties are ignored
 				if (!autoCreated)
 				{
+					
 					Object fieldValue = PropertyUtils.getNestedProperty(object, fieldName);
-
-					AtomicTypeConverter converter = (AtomicTypeConverter) atomicTypeConverters.get(PropertyUtils.getPropertyType(object,
fieldName));
+					Class fieldTypeClass = fieldDescriptor.getFieldTypeClass() != null
+                        ? fieldDescriptor.getFieldTypeClass()
+                        : PropertyUtils.getPropertyType(object, fieldName);
+					AtomicTypeConverter converter = (AtomicTypeConverter) atomicTypeConverters.get(fieldTypeClass);
 					Value value = converter.getValue(fieldValue);
 					// Check if mandatory property are not null
 					this.checkMandatoryProperty(objectNode, fieldDescriptor, value);



Mime
View raw message