Skip to content

Commit

Permalink
Stop storing ref.targetName into repository
Browse files Browse the repository at this point in the history
It seems that storing targetName on references is not a good idea
e.g. because of GUI complications and of general principle of avoiding
data redundancy.

(cherry picked from commit 0e2f9d4)
  • Loading branch information
mederly committed Apr 10, 2018
1 parent 9116c05 commit fa01aa0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Expand Up @@ -134,7 +134,7 @@ public void simpleAddGetTest() throws Exception {
// adhoc check whether reference.targetName is preserved
if ("atestuserX00003".equals(PolyString.getOrig(object.getName()))) {
String personaName = PolyString.getOrig(((UserType) object.asObjectable()).getPersonaRef().get(0).getTargetName());
assertEquals("Wrong personaRef.targetName on atestuserX00003", "u-000", personaName);
assertEquals("Wrong personaRef.targetName on atestuserX00003", null, personaName);
foundAtestuserX00003 = true;
break;
}
Expand Down
Expand Up @@ -260,8 +260,7 @@ public <T extends ObjectType> void updateFullObject(RObject object, PrismObject<
// Its' because we're removing some properties during save operation and if save fails,
// overwrite attempt (for example using object importer) might try to delete existing object
// and then try to save this object one more time.
SerializationOptions options = SerializationOptions.createSerializeReferenceNames();
String xml = prismContext.xmlSerializer().options(options).serialize(savedObject);
String xml = prismContext.xmlSerializer().serialize(savedObject);
savedObject = prismContext.parseObject(xml);

if (FocusType.class.isAssignableFrom(savedObject.getCompileTimeClass())) {
Expand All @@ -272,7 +271,7 @@ public <T extends ObjectType> void updateFullObject(RObject object, PrismObject<
savedObject.removeContainer(AccessCertificationCampaignType.F_CASE);
}

xml = prismContext.xmlSerializer().options(options).serialize(savedObject);
xml = prismContext.xmlSerializer().serialize(savedObject);
byte[] fullObject = RUtil.getByteArrayFromXml(xml, getConfiguration().isUseZip());

LOGGER.trace("Storing full object\n{}", xml);
Expand Down

0 comments on commit fa01aa0

Please sign in to comment.