/** * {@inheritDoc} */ @Override public boolean equals( Object o ) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } UniprotProteinTranscript that = ( UniprotProteinTranscript ) o; if ( !primaryAc.equals( that.getPrimaryAc() ) ) { return false; } if ( !organism.equals( that.getOrganism() ) ) { return false; } return true; }
@Override @Transactional( "update" ) public void onSecondaryAcsFound(UpdateCaseEvent evt) throws ProcessorException { // reattach the updateProcess to the entity manager ProteinUpdateProcess updateProcess = IntactUpdateContext.getCurrentInstance().getUpdateFactory().getEntityManager().merge(this.updateProcess); Collection<Protein> secondaryProteins = evt.getSecondaryProteins(); Collection<ProteinTranscript> secondaryIsoforms = evt.getSecondaryIsoforms(); Collection<XrefUpdaterReport> secondaryXrefReports = evt.getXrefUpdaterReports(); for (Protein prot : secondaryProteins){ InteractorXref oldPrimary = ProteinUtils.getUniprotXref(prot); String oldAc = oldPrimary != null ? oldPrimary.getPrimaryId() : null; SecondaryProteinEvent protEvt = new SecondaryProteinEvent(updateProcess, prot, oldAc, evt.getProtein().getPrimaryAc()); IntactUpdateContext.getCurrentInstance().getUpdateFactory().getSecondaryProteinEventDao().persist(protEvt); } for (ProteinTranscript protTrans : secondaryIsoforms){ Protein prot = protTrans.getProtein(); InteractorXref oldPrimary = ProteinUtils.getUniprotXref(prot); String oldAc = oldPrimary != null ? oldPrimary.getPrimaryId() : null; SecondaryProteinEvent protEvt = new SecondaryProteinEvent(updateProcess, prot, oldAc, protTrans.getUniprotVariant().getPrimaryAc()); IntactUpdateContext.getCurrentInstance().getUpdateFactory().getSecondaryProteinEventDao().persist(protEvt); } }