community-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ricardo Ulate <ricardo.ul...@valtech.de>
Subject OCM - Bug fix - @Collection
Date Wed, 16 Sep 2015 13:07:48 GMT

Hi,

I'm sure I'm not using the right channel, but this page
http://www.apache.org/dev/contrib-email-tips.html
Was too confusing, I don't want to invest 1h time to help out with a simple fix.



When using the @Collection tag on lists (where the element is a node WITH an ID):

The class DefaultCollectionConverterImpl (in version 2.0.0 of the OCM) around lines at line
230:


        while (collectionIterator.hasNext()) {

            Object item = collectionIterator.next();

            String elementJcrName = null;



            if (elementClassDescriptor.hasUUIdField()){

            elementJcrName = collectionDescriptor.getJcrElementName();

            elementJcrName = (elementJcrName == null)? COLLECTION_ELEMENT_NAME : elementJcrName;



Should be:

        while (collectionIterator.hasNext()) {

            Object item = collectionIterator.next();

            String elementJcrName = null;



            if (elementClassDescriptor.hasUUIdField()){

if (elementClassDescriptor.hasIdField()) {

                 String idFieldName = elementClassDescriptor.getIdFieldDescriptor().getFieldName();

                elementJcrName = ReflectionUtils.getNestedProperty(item, idFieldName).toString();

}

else {

            elementJcrName = collectionDescriptor.getJcrElementName();

}

            elementJcrName = (elementJcrName == null)? COLLECTION_ELEMENT_NAME : elementJcrName;


Cheers,

Ricardo

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message