private Collection<Confidence> synchronizeConfidences( Collection<Confidence> confidencesToSynchronize, Interaction parentInteraction ) { List<Confidence> confidences = new ArrayList<Confidence>(confidencesToSynchronize.size()); for ( Confidence confidence : confidencesToSynchronize ) { if (confidence.getAc() != null && IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getConfidenceDao().isTransient(confidence)) { confidence = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getConfidenceDao().getByAc(confidence.getAc()); } confidence.setCvConfidenceType( synchronize (confidence.getCvConfidenceType())); confidence.setInteraction((InteractionImpl)parentInteraction); confidences.add(confidence); } return confidences; }
/** * Retrieves the confidences from an interaction, initializing them if necessary. * Do not set the initialized collection of confidences because confidences cannot be orphan * @param interaction the interaction * @return The returned confidences are ensured to be initialized * @since 2.4.0 */ public static Collection<Confidence> ensureInitializedConfidences(Interaction interaction) { Collection<Confidence> confidences; if (IntactCore.isInitialized(interaction.getConfidences())) { confidences = interaction.getConfidences(); } else { confidences = IntactContext.getCurrentInstance().getDaoFactory().getConfidenceDao().getByInteractionAc(interaction.getAc()); } return confidences; }
/** * Retrieves the confidences from an interaction, initializing them if necessary. * Do not set the initialized collection of confidences because confidences cannot be orphan * @param interaction the interaction * @return The returned confidences are ensured to be initialized * @since 2.4.0 */ public static Collection<Confidence> ensureInitializedConfidences(Interaction interaction) { Collection<Confidence> confidences; if (IntactCore.isInitialized(interaction.getConfidences())) { confidences = interaction.getConfidences(); } else { confidences = IntactContext.getCurrentInstance().getDaoFactory().getConfidenceDao().getByInteractionAc(interaction.getAc()); } return confidences; }
private Collection<Confidence> synchronizeConfidences( Collection<Confidence> confidencesToSynchronize, Interaction parentInteraction ) { List<Confidence> confidences = new ArrayList<Confidence>(confidencesToSynchronize.size()); for ( Confidence confidence : confidencesToSynchronize ) { if (confidence.getAc() != null && IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getConfidenceDao().isTransient(confidence)) { confidence = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getConfidenceDao().getByAc(confidence.getAc()); } confidence.setCvConfidenceType( synchronize (confidence.getCvConfidenceType())); confidence.setInteraction((InteractionImpl)parentInteraction); confidences.add(confidence); } return confidences; }