public GeneratedEntry addInteractionWithAc(String ac) { Interaction interaction = intactContext.getDataContext().getDaoFactory() .getInteractionDao().getByAc(ac); checkResult(interaction, ac, "interaction"); return addInteraction(interaction); }
Interaction result = getDaoFactory().getInteractionDao().getByAc( ac ); if ( result == null ) {
Interaction result = getDaoFactory().getInteractionDao().getByAc(ac); if ( result == null ) {
public GeneratedEntry addInteractionWithShortLabel(String shortLabel) { Interaction interaction = intactContext.getDataContext().getDaoFactory() .getInteractionDao().getByShortLabel(shortLabel); checkResult(interaction, shortLabel, "interaction"); return addInteraction(interaction); }
public static Collection<Interaction> getInteractionsForExperimentListItem(ExperimentListItem eli) { Integer firstInteraction = null; Integer maxInteractions = null; // if there is pagination, get the first and the max result if (eli.getLargeScaleChunkSize() != null) { firstInteraction = (eli.getChunkNumber() - 1) * eli.getLargeScaleChunkSize(); maxInteractions = eli.getLargeScaleChunkSize(); } Collection<String> experimentLabels = eli.getExperimentLabels(); return IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getInteractionDao() .getInteractionByExperimentShortLabel(experimentLabels.toArray(new String[experimentLabels.size()]), firstInteraction, maxInteractions); }
System.out.println( "Search interaction by label: " + label ); Collection interactions = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getInteractionDao().getByShortLabelLike(label);
System.out.println( "Search interaction by label: " + label ); Collection interactions = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getInteractionDao().getByShortLabelLike(label);
public static Collection<Interaction> getInteractionsForExperimentListItem(ExperimentListItem eli) { Integer firstInteraction = null; Integer maxInteractions = null; // if there is pagination, get the first and the max result if (eli.getLargeScaleChunkSize() != null) { firstInteraction = (eli.getChunkNumber() - 1) * eli.getLargeScaleChunkSize(); maxInteractions = eli.getLargeScaleChunkSize(); } Collection<String> experimentLabels = eli.getExperimentLabels(); return IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getInteractionDao() .getInteractionByExperimentShortLabel(experimentLabels.toArray(new String[experimentLabels.size()]), firstInteraction, maxInteractions); }
System.out.println( "Search interaction by label: " + label ); Collection interactions = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getInteractionDao().getByShortLabelLike(label);
public static Collection<Interaction> getInteractionsForExperimentListItem(ExperimentListItem eli) { Integer firstInteraction = null; Integer maxInteractions = null; // if there is pagination, get the first and the max result if (eli.getLargeScaleChunkSize() != null) { firstInteraction = (eli.getChunkNumber() - 1) * eli.getLargeScaleChunkSize(); maxInteractions = eli.getLargeScaleChunkSize(); } Collection<String> experimentLabels = eli.getExperimentLabels(); return IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getInteractionDao() .getInteractionByExperimentShortLabel(experimentLabels.toArray(new String[experimentLabels.size()]), firstInteraction, maxInteractions); }
public void exportEntries() throws IndexerException { int current = 0; log.debug( "Starting export of " + count + " interaction(s)." ); while ( current < count ) { DaoFactory daoFactory = IntactContext.getCurrentInstance().getDataContext().getDaoFactory(); InteractionDao idao = daoFactory.getInteractionDao(); IntactContext.getCurrentInstance().getDataContext().beginTransaction(); List<InteractionImpl> interactions = idao.getAll( current, CHUNK_SIZE ); if ( log.isDebugEnabled() ) { log.debug( "Exporting interaction range " + current + ".." + Math.min( count, current + CHUNK_SIZE ) + " out of " + count ); } for ( Interaction interaction : interactions ) { current++; exportEntry( interaction ); } try { IntactContext.getCurrentInstance().getDataContext().commitTransaction(); } catch ( IntactTransactionException e ) { throw new IndexerException( e ); } } }
InteractionDao idao = daoFactory.getInteractionDao(); int interactionCount = idao.countAll(); idao = null; idao = daoFactory.getInteractionDao();
/** * Calculates the next available suffix using a short label - which is * the highest suffix + 1 * * @param shortLabel the label to use * * @return the next available suffix. */ protected static Integer calculateNextSuffix(String shortLabel) { String labelWithoutSuffix = removeSuffix(shortLabel); // we get all the labels with the same bait-prey combination List<String> shortLabelsWithSuffix = IntactContext.getCurrentInstance().getDataContext().getDaoFactory() .getInteractionDao().getShortLabelsLike(labelWithoutSuffix + "%"); int maxSuffix = -1; for (String labelWithSuffix : shortLabelsWithSuffix) { InteractionShortLabel label = new InteractionShortLabel(labelWithSuffix); Integer suffix = label.getSuffix(); if (suffix != null) { maxSuffix = Math.max(maxSuffix, suffix); } else { maxSuffix = 0; } } if (maxSuffix == -1) { return null; } return maxSuffix + 1; }
IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getInteractionDao().persist((InteractionImpl) interaction ); IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getInteractionDao().update( (InteractionImpl) interaction );
IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getInteractionDao().persist((InteractionImpl) interaction ); IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getInteractionDao().update( (InteractionImpl) interaction );
IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getInteractionDao().persist((InteractionImpl) interaction ); IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getInteractionDao().update( (InteractionImpl) interaction );
public int getEntryCount() throws IndexerException { if ( count == null ) { DaoFactory daoFactory = IntactContext.getCurrentInstance().getDataContext().getDaoFactory(); InteractionDao idao = daoFactory.getInteractionDao(); IntactContext.getCurrentInstance().getDataContext().beginTransaction(); // TODO do not take into account interactor that do not interact. count = idao.countAll(); try { IntactContext.getCurrentInstance().getDataContext().commitTransaction(); } catch ( IntactTransactionException e ) { throw new IndexerException( e ); } } return count; } }