jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ryanv78727 <rvanderw...@gmail.com>
Subject Re: OCM: For some reason the ObjectConverterImpl thinks by Date is a collection
Date Fri, 17 Oct 2008 15:51:36 GMT

I did some more digging through the OCM code and found this is the place
where things go wrong:
(AnnotationDescriptionReader.java:141)private void
addDescriptorsFromFields(MappingDescriptor mappingDescriptor,
ClassDescriptor classDescriptor, Class clazz) {
	    
		java.lang.reflect.Field[] fields = clazz.getDeclaredFields();

Apparently for my date Field, it thinks there is a Collection annotation for
it and a Field annotation - 
so the call to: Field fieldAnnotation =
fields[index].getAnnotation(Field.class); returns a result, and within the
same iteration of the for loop, Collection collectionAnnotation =
fields[index].getAnnotation(Collection.class); also returns a result. It
would seem to be a JDK (Running 1.5.0_13, ubuntu hardy 32bit) thing as far
as I can tell, because class.getDeclaredFields is what is returning the
funky data.

 However I am wondering, why would it not break out of the for loop once it
found a field/collection/bean match. Does OCM support more than one type of
annotation for the same field?


Ryan

ryanv78727 wrote:
> 
> Hi, I am running OCM 1.4 - I am having a strange problem where my bean
> field of type java.util.Date is being interpreted as a collection,
> resulting in a JcrMappingException: Unsupported collection type error. I
> have stepped through the debugger, and
> 
> by the time it gets here:
>>private void insertCollectionFields(Session session, Object object,
ClassDescriptor classDescriptor, Node >objectNode) {
> 

-- 
View this message in context: http://www.nabble.com/OCM%3A-For-some-reason-the-ObjectConverterImpl-thinks-by-Date-is-a-collection-tp20035446p20035984.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Mime
View raw message