private Collection<ComponentConfidence> synchronizeComponentConfidences( Collection<ComponentConfidence> confidencesToSynchronize, Component parentComponent ) { List<ComponentConfidence> confidences = new ArrayList<ComponentConfidence>(confidencesToSynchronize.size()); for ( ComponentConfidence confidence : confidencesToSynchronize ) { if (confidence.getAc() != null && IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getComponentConfidenceDao().isTransient(confidence)) { confidence = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getComponentConfidenceDao().getByAc(confidence.getAc()); } confidence.setCvConfidenceType( synchronize (confidence.getCvConfidenceType())); confidence.setComponent(parentComponent); confidences.add(confidence); } return confidences; }
/** * Retrieves the confidences from a participant, initializing them if necessary. * Do not set the initialized collection of confidences because confidences cannot be orphan * @param component the component * @return The returned confidences are ensured to be initialized * @since 2.4.0 */ public static Collection<ComponentConfidence> ensureInitializedComponentConfidences(Component component) { Collection<ComponentConfidence> confidences; if (IntactCore.isInitialized(component.getConfidences())) { confidences = component.getConfidences(); } else { confidences = IntactContext.getCurrentInstance().getDaoFactory().getComponentConfidenceDao().getByComponentAc(component.getAc()); } return confidences; }
/** * Retrieves the confidences from a participant, initializing them if necessary. * Do not set the initialized collection of confidences because confidences cannot be orphan * @param component the component * @return The returned confidences are ensured to be initialized * @since 2.4.0 */ public static Collection<ComponentConfidence> ensureInitializedComponentConfidences(Component component) { Collection<ComponentConfidence> confidences; if (IntactCore.isInitialized(component.getConfidences())) { confidences = component.getConfidences(); } else { confidences = IntactContext.getCurrentInstance().getDaoFactory().getComponentConfidenceDao().getByComponentAc(component.getAc()); } return confidences; }
private Collection<ComponentConfidence> synchronizeComponentConfidences( Collection<ComponentConfidence> confidencesToSynchronize, Component parentComponent ) { List<ComponentConfidence> confidences = new ArrayList<ComponentConfidence>(confidencesToSynchronize.size()); for ( ComponentConfidence confidence : confidencesToSynchronize ) { if (confidence.getAc() != null && IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getComponentConfidenceDao().isTransient(confidence)) { confidence = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getComponentConfidenceDao().getByAc(confidence.getAc()); } confidence.setCvConfidenceType( synchronize (confidence.getCvConfidenceType())); confidence.setComponent(parentComponent); confidences.add(confidence); } return confidences; }