rootChildNode.addChild(grandChildNode);
- polytomousKeyNodeService.merge(grandChildNode);
+ polytomousKeyNodeService.merge(grandChildNode, true);
Assert.assertFalse(pKey.getRoot().getChildAt(0).getChildAt(0).getId() == 0);
Taxon taxon = CdmBase.deproxy(taxonService.find(taxon1Uuid),Taxon.class);
pkeynode.getChildAt(1).setTaxon(taxon);
- polytomousKeyService.merge(pkey);
+ polytomousKeyService.merge(pkey, true);
pkey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
Assert.assertEquals(pkeynode.getChildAt(1).getTaxon(), taxon);
- polytomousKeyService.merge(pkey);
+ polytomousKeyService.merge(pkey, true);
pkey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
Assert.assertSame(subkey1, subkey2);
- polytomousKeyService.merge(pkey);
+ polytomousKeyService.merge(pkey, true);
}
@Test
Assert.assertSame(subkey1, subkey2);
- polytomousKeyService.merge(pkey);
+ polytomousKeyService.merge(pkey, true);
}
label2.size();
- polytomousKeyService.merge(pkey);
+ polytomousKeyService.merge(pkey, true);
}
@Test
newTerm.setLabel("CreateTest");
try {
- if(termService.findByRepresentationText("UpdateTest", Feature.class, null, null) != null) {
- Pager<Feature> terms = termService.findByRepresentationText("UpdateTest", Feature.class, null, null);
- if (!terms.getRecords().isEmpty()){
- termService.delete(terms.getRecords().get(0).getUuid());
+ List<Feature> features = termService.list(Feature.class, 100, 0, null, null);
+ List<UUID> updateTerms = new ArrayList<UUID>();
+ for (Feature feature:features){
+ if (feature.getLabel().equals("UpdateTest")){
+ updateTerms.add(feature.getUuid());
}
- }
+ }
+ termService.delete(updateTerms);
+
+// if(termService.findByRepresentationText("UpdateTest", Feature.class, null, null) != null) {
+// Pager<Feature> terms = termService.findByRepresentationText("UpdateTest", Feature.class, null, null);
+// if (!terms.getRecords().isEmpty()){
+// termService.delete(terms.getRecords().get(0).getUuid());
+// }
+// }
Assert.assertNotNull(newTerm);
TermVocabulary vocNameFeature = vocabularyService.find(vocNameFeatureUuid);
vocNameFeature.addTerm(newTerm);
- vocs = vocabularyService.merge(vocs);
- for(TermVocabulary voc : vocs) {
+ List<MergeResult<TermVocabulary>> mergeResults = vocabularyService.merge(vocs, true);
+
+ for(MergeResult<TermVocabulary> result : mergeResults){
+ TermVocabulary voc = result.getMergedEntity();
if(voc.getUuid().equals(vocNameFeatureUuid)) {
vocNameFeature = voc;
}
// Test for #5138
Person person = (Person) CdmApplicationState.getCurrentAppConfig().getAgentService().load(personUuid);
person.setFirstname("Me");
- CdmApplicationState.getCurrentAppConfig().getAgentService().merge(person);
+ CdmApplicationState.getCurrentAppConfig().getAgentService().merge(person, true);
}
person = (Person) CdmApplicationState.getCurrentAppConfig().getAgentService().merge(person);
person = (Person) CdmApplicationState.getCurrentAppConfig().getAgentService().load(person.getUuid());
person.setFirstname("Some");
- CdmApplicationState.getCurrentAppConfig().getAgentService().merge(person);
+ CdmApplicationState.getCurrentAppConfig().getAgentService().merge(person, true);
}
@Test