@Transactional( value = "jamiTransactionManager", readOnly = true, propagation = Propagation.REQUIRED) public IntactSource reloadFullyInitialisedSource(IntactSource cv) { if (cv == null) { return null; } IntactSource reloaded = null; if (areSourceCollectionsLazy(cv) && cv.getAc() != null && !getIntactDao().getEntityManager().contains(cv)) { reloaded = loadSourceByAc(cv.getAc()); } // we need first to merge with reloaded complex if (reloaded != null) { // detach reloaded now so not changes will be committed getIntactDao().getEntityManager().detach(reloaded); InstitutionCloner cloner = new InstitutionCloner(); cloner.copyInitialisedProperties(cv, reloaded); cv = reloaded; } // initialise xrefs because are first tab visible initialiseXrefs(cv.getDbXrefs()); // initialise annotations because needs caution initialiseAnnotations(cv.getDbAnnotations()); // initialise aliases initialiseAliases(cv.getSynonyms()); return cv; }
@Transactional( value = "jamiTransactionManager", readOnly = true, propagation = Propagation.REQUIRED) public IntactSource loadSourceByAc(String ac) { IntactSource cv = getIntactDao().getEntityManager().find(IntactSource.class, ac); if (cv != null) { // initialise xrefs because are first tab visible initialiseXrefs(cv.getDbXrefs()); // initialise annotations because needs caution, url, etc initialiseAnnotations(cv.getDbAnnotations()); // initialise aliases initialiseAliases(cv.getSynonyms()); } return cv; }