private void updateSynonyms(InvSynonymVoCollection synColl) { if (!form.getLocalContext().getOldSynonymsIsNotNull()) return; InvSynonymVoCollection oldSynColl = form.getLocalContext().getOldSynonyms(); for (int i = 0; i < oldSynColl.size(); i++) { if (!isSynonymInCollection(oldSynColl.get(i), synColl)) { InvSynonymVo synVo = oldSynColl.get(i); synVo.setActiveStatus(Boolean.FALSE); synColl.add(synVo); } } }
public InvestigationIndexVo getInvestigationIndex(Integer recordId) { if(recordId == null) return null; DomainFactory factory = getDomainFactory(); InvestigationIndexVo voInvestigationIndex = InvestigationIndexVoAssembler.create((InvestigationIndex) factory.getDomainObject(InvestigationIndex.class,recordId)); //WDEV-16994 if (voInvestigationIndex == null) return null; if(voInvestigationIndex.getSynonymsIsNotNull() && voInvestigationIndex.getSynonyms().size() > 0) { InvSynonymVoCollection coll = new InvSynonymVoCollection(); for(int i = 0; i < voInvestigationIndex.getSynonyms().size(); i++) { InvSynonymVo syn = voInvestigationIndex.getSynonyms().get(i); if(syn.getActiveStatusIsNotNull() && syn.getActiveStatus().equals(Boolean.TRUE)) coll.add(syn); } voInvestigationIndex.setSynonyms(coll); } return voInvestigationIndex; }
private boolean isSynonymInCollection(InvSynonymVo vo, InvSynonymVoCollection synColl) { if (vo == null || !vo.getID_InvSynonymIsNotNull()) return false; for (int i = 0; i < synColl.size(); i++) { InvSynonymVo synVo = synColl.get(i); if (synVo.equals(vo)) return true; } return false; }