Uploaded image for project: 'Spring Data MongoDB'
  1. Spring Data MongoDB
  2. DATAMONGO-505

Conversion of associations doesn't work for collection values

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1 M2
    • Fix Version/s: 1.1 RC1
    • Component/s: Repository
    • Labels:
      None

      Description

      Assume you have the following scenario:

      class Entity {
      
        Long id;
        @DBRef
        Property property;
      }
      
      class Property {
        Long id;
      }
      
      interface EntityRepository extends Repository<Entity, Long> {
      
        Entity findByPropertyIn(Property... property);
      }
      

      The execution of findByProperty(…) will fail as the given array (or collection) is not correctly translated into a collection of DBRefs. The reason is that ConvertingIterator treats the value as is and wants to create a DBRef from it. We need to unwrap the elements and convert them into DBRef instances one by one.

        Attachments

          Activity

            People

            • Assignee:
              olivergierke Oliver Gierke
              Reporter:
              olivergierke Oliver Gierke
              Last updater:
              Trevor Marshall
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: