Uploaded image for project: 'Grouper'
  1. Grouper
  2. GRP-947

XML import doesn't correctly import assignments with multiple values

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • 2.1.5
    • API
    • None

    Description

      To reproduce:

      Using GSH:

      grouperSession = GrouperSession.startRootSession();
      Stem stem = StemFinder.findByName(grouperSession, "etc", true);
      Group groupA = stem.addChildGroup("groupA", "groupA");
      AttributeDef attributeDef = stem.addChildAttributeDef("attributeDef", AttributeDefType.attr);
      attributeDef.setAssignToGroup(true);
      attributeDef.setValueType(AttributeDefValueType.string);
      attributeDef.setMultiValued(true);
      attributeDef.store();
      AttributeDefName attributeDefName = stem.addChildAttributeDefName(attributeDef, "attribute", "attribute");

      groupA.getAttributeValueDelegate().addValue(attributeDefName.getName(), "value1");
      groupA.getAttributeValueDelegate().addValue(attributeDefName.getName(), "value2");

      $ ./bin/gsh.sh -xmlexport /tmp/export

      File contains the following:

      <attributeAssignValues>
      <XmlExportAttributeAssignValue><attributeAssignId>ae7447cccd474800b1420e38aaa0a23d</attributeAssignId><contextId>bd181141572f4230bd5e57d58b8f1a9a</contextId><createTime>2013/12/26 15:25:25.887</createTime><hibernateVersionNumber>0</hibernateVersionNumber><modifierTime>2013/12/26 15:25:25.887</modifierTime><uuid>00d4da3674ea4e9e92a926a941d85c79</uuid><valueString>value1</valueString></XmlExportAttributeAssignValue>
      <XmlExportAttributeAssignValue><attributeAssignId>ae7447cccd474800b1420e38aaa0a23d</attributeAssignId><contextId>33adc42c5a3d4dd396f913e921d73228</contextId><createTime>2013/12/26 15:25:25.914</createTime><hibernateVersionNumber>0</hibernateVersionNumber><modifierTime>2013/12/26 15:25:25.914</modifierTime><uuid>b833ecf7c19c45c0a3e5bc4e593e66ac</uuid><valueString>value2</valueString></XmlExportAttributeAssignValue>
      </attributeAssignValues>

      Clear the db, import the file, only "value2" is present in the db. Log indicates that the second value overwrote the first instead of adding a new row:

      Insert: AttributeAssignValue: 00d4da3674ea4e9e92a926a941d85c79
      Update: AttributeAssignValue: 00d4da3674ea4e9e92a926a941d85c79

      Attachments

        Activity

          People

            shilen.patel@at.internet2.edu Shilen Patel (duke.edu)
            shilen.patel@at.internet2.edu Shilen Patel (duke.edu)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: