Codota Logo
Relation
Code IndexAdd Codota to your IDE (free)

How to use
Relation
in
pl.edu.icm.yadda.service2.browse.facade

Best Java code snippets using pl.edu.icm.yadda.service2.browse.facade.Relation (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: pl.edu.icm.yadda/bwmeta-import

       .withPageSize(pageSize)
       .select(Query.fields(ElementView.FIELDS_IDX_EXT_ID)
             .where(Condition.eq(ElementView.FIELD_EXTID, rootExtId))),
pageSize);
origin: pl.edu.icm.yadda/yaddaweb-lite-core

try {
  Relation rel = browserFacade.relation(ContributorView.CONTRIBUTOR_VIEW_NAME, requiredTags)
                .withPageSize(pageSize);
  if (aggregationType.ordinal() > rel.getInfo().getViews().length)
    throw new SystemException(Modules.BROWSER,
        "No such aggreagation type: "
        clauses.add(filteredCondition(entry.getKey(), entry.getValue(), rel.getInfo()));
  f = rel.aggregate(
      rel.getAggregatingView(aggregationType.getAggregationName())
          .getUuid(), query.where(new ComplexClause(
          ComplexClause.Operator.AND, clauses)), false);
origin: pl.edu.icm.yadda/yadda-aas2

@Override
protected void saveEntry(short position, String licenceId)
    throws ServiceException {
  
  try {
    Relation relation = getDirectoryRelation();
    relation.addOrUpdate(
        Condition.eq("position", position), 
        new Serializable[]{position, licenceId});
  } catch (BrowseException e) {
    throw new ServiceException(e);
  }
  
  
}
origin: pl.edu.icm.yadda/yadda-client-common

  public static void markAsReady(Relation relation) {
    Set<String> tags = new HashSet<String>();
    tags = new HashSet<String>();
    for (String tag : relation.getInfo().getTags()) tags.add(tag);		
    tags.add(TAG_READY);
    relation.updateTags(tags.toArray(new String[tags.size()]));
  }
}
origin: pl.edu.icm.yadda/yaddaweb-lite-core

            .withPageSize(pageSize);
    clauses.add(filteredCondition(entry.getKey(), entry.getValue(), rel.getInfo()));
contrViewFetcher = rel.select(query.where(new ComplexClause(
    ComplexClause.Operator.AND, clauses)));
contrViewFetcher = rel.select(query);
origin: pl.edu.icm.yadda/bwmeta-process

@Override
protected void finishProcess(final ProcessContext context) {
  try {
    browserFacade.relation(ElementPublisherView.ELEMENT_PUBLISHER_VIEW_NAME).setAggregatingEnabled(true, true);
          browserFacade.relation(ElementPublisherView.ELEMENT_PUBLISHER_VIEW_NAME).getInfo().getViews();
      if (views != null) {
        for (final AggregatingView view : views) {
          if (view.getMaterializationStrategy() != AggregatingView.MaterializationStrategy.NONE) {
            browserFacade.relation(ElementPublisherView.ELEMENT_PUBLISHER_VIEW_NAME).aggregate(view.getUuid(), Query.fields("*"), false);
origin: pl.edu.icm.yadda/yadda-analysis-impl

@Override
public void removeReference(String sourceId, int position) throws AnalysisException {
  log.debug("Relation manager: Removing a reference: " + sourceId + ", " + position);
  Relation refsRelation = getRefsRelation();
  Relation dirtyRelation = getDirtyRelation();
  try {
    waitForSource(sourceId);
  } catch (InterruptedException ex) {
    throw new AnalysisException(ex);
  }
  try {
    refsRelation.delete(getRefsSourcePosCondition(sourceId, position));
    dirtyRelation.addOrUpdate(getDirtySourceCondition(sourceId), new Serializable[]{sourceId});
  } catch (NoSuchFieldInRelationException ex) {
    notifyForSource(sourceId);
    throw new AnalysisException(ex);
  } catch (NoSuchRelationException ex) {
    notifyForSource(sourceId);
    throw new AnalysisException(ex);
  }
  notifyForSource(sourceId);
}
origin: pl.edu.icm.yadda/bwmeta-process

@Override
protected Chunk doProcessChunk(Chunk data, Map<String, Serializable> context, IProcessListener processListener, ProcessingStats stats) throws Exception {
  final Batch batch = browserFacade.relation(ElementPublisherView.ELEMENT_PUBLISHER_VIEW_NAME).batch();
  for (final CatalogElement catalogElement : data.getItems()) {
    try {
      batch.delete(Condition.eq(ElementPublisherView.FIELD_PUBLISHED_ELEMENT_EXTID, catalogElement.getExtId()));
      if (!catalogElement.isDeleted() && catalogElement.getElement() != null && hasRelatedPublisher(catalogElement)) {
        final List<Serializable[]> tuples = ElementPublisherView.asTuples(catalogElement, contributorInfoBuilder, bwmetaSource);
        for (final Serializable[] tuple : tuples) {
          batch.add(tuple);
        }
      }
    } catch (final Exception e) {
      if (context.containsKey(Constants.PARAM_DISABLE_AGGREGATIONS_DURING_REBUILD)) {
        browserFacade.relation(ElementPublisherView.ELEMENT_PUBLISHER_VIEW_NAME).setAggregatingEnabled(false, false);
      }
      if (processListener != null) {
        processListener.notifyEvent("elementPublisherViewGenerator.process", new String[]{catalogElement.getExtId()}, EventResultCode.ERROR, StackTraceUtil.getStackTrace(e));
      }
      log.error("Exception processing element " + catalogElement.getExtId());
      throw e;
    }
  }
  batch.run();
  return data;
}
origin: pl.edu.icm.yadda/bwmeta-process

@Override
protected Chunk doProcessChunk(final Chunk data,
    final Map<String, Serializable> context,
    final IProcessListener processListener, final ProcessingStats stats)
    throws Exception {
  final Batch batch = browserFacade.relation(SubscriberView.VIEW_NAME).batch();
  for (final CatalogElement ce : data.getItems()) {
    try {
      batch.delete(Condition.eq(SubscriberView.FIELD_ELEMENT_ID, ce.getExtId()));
      if (!ce.isDeleted() && ce.getElement() != null) {
        final Serializable[][] tuples=SubscriberView.asTuples(ce);
        for (final Serializable[] tuple : tuples) {
          batch.add(tuple);
        }
      }
    } catch (final Exception e) {
      if (processListener != null) {
        processListener.notifyEvent("subscriberViewGenerator.process", new String[]{ce.getExtId()}, EventResultCode.ERROR, StackTraceUtil.getStackTrace(e));
      }
      log.error("Exception processing element " + ce.getExtId());
      throw e;
    }
  }
  batch.run();
  return data;
}
origin: pl.edu.icm.yadda/bwmeta-process

@Override
protected void finishProcess(final ProcessContext context) {
  try {
    browserFacade.relation(ContributorView.CONTRIBUTOR_VIEW_NAME).setAggregatingEnabled(true, true);
        browserFacade.relation(ContributorView.CONTRIBUTOR_VIEW_NAME).getInfo().getViews();
      if (views != null) {
        for (final AggregatingView view : views) {
          if (view.getMaterializationStrategy() != MaterializationStrategy.NONE) {
            browserFacade.relation(ContributorView.CONTRIBUTOR_VIEW_NAME).aggregate(view.getUuid(), Query.fields("*"), false);
origin: pl.edu.icm.yadda/bwmeta-process

@Override
protected Chunk doProcessChunk(final Chunk data,
    final Map<String, Serializable> context,
    final IProcessListener processListener, final ProcessingStats stats)
    throws Exception {
  final Batch batch = browserFacade.relation(ContributorView.CONTRIBUTOR_VIEW_NAME).batch();
  for (final CatalogElement ce : data.getItems()) {
    try {
      batch.delete(Condition.eq(ContributorView.FIELD_ELEMENT_ID, ce.getExtId()));
      if (!ce.isDeleted() && ce.getElement() != null) {
        final Serializable[][] tuples=ContributorView.asTuples(ce.getElement(), contributorInfoBuilder);
        for (final Serializable[] tuple : tuples) {
          batch.add(tuple);
        }
      }
    } catch (final Exception e) {
      if (context.containsKey(Constants.PARAM_DISABLE_AGGREGATIONS_DURING_REBUILD)) {
        browserFacade.relation(ContributorView.CONTRIBUTOR_VIEW_NAME).setAggregatingEnabled(false, false);
      }
      if (processListener != null) {
        processListener.notifyEvent("contributorViewGenerator.process", new String[]{ce.getExtId()}, EventResultCode.ERROR, StackTraceUtil.getStackTrace(e));
      }
      log.error("Exception processing element " + ce.getExtId());
      throw e;
    }
  }
  batch.run();
  return data;
}
origin: pl.edu.icm.yadda/bwmeta-process

  throws Exception {
final Batch elementViewBath = browserFacade.relation(ElementView.ELEMENT_VIEW_NAME).batch();
final Batch journalViewBatch = browserFacade.relation(JournalView.JOURNAL_VIEW_NAME).batch();
final Batch publisherViewBatch = browserFacade.relation(PublisherView.PUBLISHER_VIEW_NAME).batch();
final Batch bookPublisherViewBatch = browserFacade.relation(BookPublisherView.PUBLISHER_VIEW_NAME).batch();
final Batch institutionEntityViewBatch = browserFacade.relation(InstitutionEntityView.VIEW_NAME).batch();
origin: pl.edu.icm.yadda/yadda-analysis-impl

@Override
public Map<Integer, String> getFromReferences(String sourceId) throws AnalysisException {
  try {
    Map<Integer, String> references = new HashMap<Integer, String>();
    Relation refsRelation = getRefsRelation().withPageSize(PAGE_SIZE);
    Selection selection = Query.fields(REFS_RELATION_POSITION_FIELD, REFS_RELATION_TARGET_FIELD)
                  .where(getRefsSourceCondition(sourceId));
    
    FetcherIterator fetcherIterator = new FetcherIterator(refsRelation.select(selection), PAGE_SIZE);
    while (fetcherIterator.hasNext()) {
      Serializable[] record = fetcherIterator.next();
      references.put(Integer.valueOf(record[0].toString()), record[1].toString());
    }
    return references;
  } catch (BrowseException ex) {
     throw new AnalysisException(ex);
  }
}
origin: pl.edu.icm.yadda/yaddaweb-lite-core

String aggregation = browseScheme.getAggregation();
Relation rel = browserFacade.relation(browseScheme.getRelationName(), requiredTags)
              .withPageSize(pageSize);
  for (Map.Entry<String, String> entry : filterBy.entrySet()) {
    if (!entry.getKey().equals("language")) {
      clauses.add(filteredCondition(entry.getKey(), entry.getValue(), rel.getInfo()));
    clauses.add(filteredCondition(key, browseScheme.getClauses().get(key), rel.getInfo()));
    f = rel.select(query.where(new ComplexClause(
        ComplexClause.Operator.AND, clauses)));
    f = rel.select(query);
  f = rel.aggregate(rel.getAggregatingView(aggregation).getUuid(),
           query.where(new ComplexClause(ComplexClause.Operator.AND, clauses)),
           false);
origin: pl.edu.icm.yadda/bwmeta-process

@Override
protected void finishProcess(final ProcessContext context) {
  try {
    browserFacade.relation(SubscriberView.VIEW_NAME).setAggregatingEnabled(true, true);
        browserFacade.relation(SubscriberView.VIEW_NAME).getInfo().getViews();
      if (views != null) {
        for (final AggregatingView view : views) {
          if (view.getMaterializationStrategy() != MaterializationStrategy.NONE) {
            browserFacade.relation(SubscriberView.VIEW_NAME).aggregate(view.getUuid(), Query.fields("*"), false);
origin: pl.edu.icm.yadda/yadda-analysis-impl

@Override
public void setReference(String sourceId, int position, String targetId) throws AnalysisException {
  log.debug("Relation manager: Setting a reference: " + sourceId + ", " + position+ ", " + targetId);
  Relation refsRelation = getRefsRelation();
  Relation dirtyRelation = getDirtyRelation();
  try {
    waitForSource(sourceId);
  } catch (InterruptedException ex) {
    throw new AnalysisException(ex);
  }
  try {
    refsRelation.addOrUpdate(getRefsSourcePosCondition(sourceId, position),
        new Serializable[]{sourceId, position, targetId});
    dirtyRelation.addOrUpdate(getDirtySourceCondition(sourceId), new Serializable[]{sourceId});
  } catch (NoSuchFieldInRelationException ex) {
    notifyForSource(sourceId);
    throw new AnalysisException(ex);
  } catch (NoSuchRelationException ex) {
    notifyForSource(sourceId);
    throw new AnalysisException(ex);
  }
  notifyForSource(sourceId);
}
origin: pl.edu.icm.yadda/bwmeta-process

browserFacade.relation(CategoryView.CATEGORY_VIEW_NAME).batch();
origin: pl.edu.icm.yadda/yadda-analysis-impl

@Override
public Map<String, Integer> getToReferences(String targetId) throws AnalysisException {
  try {
    Map<String, Integer> references = new HashMap<String, Integer>();
    Relation refsRelation = getRefsRelation().withPageSize(PAGE_SIZE);
    
    FetcherIterator fetcherIterator = new FetcherIterator(refsRelation.select(
        Query.fields(REFS_RELATION_SOURCE_FIELD, REFS_RELATION_POSITION_FIELD)
        .where(getRefsTargetCondition(targetId))), PAGE_SIZE);
    while (fetcherIterator.hasNext()) {
      Serializable[] record = fetcherIterator.next();
      references.put(record[0].toString(), Integer.valueOf(record[1].toString()));
    }
    return references;
  } catch (BrowseException ex) {
    throw new AnalysisException(ex);
  }
}
origin: pl.edu.icm.yadda/bwmeta-process

@Override
protected void finishProcess(final ProcessContext context) {
  try {
    browserFacade.relation(ElementView.ELEMENT_VIEW_NAME).setAggregatingEnabled(true, true);
        browserFacade.relation(ElementView.ELEMENT_VIEW_NAME).getInfo().getViews();
      if (views != null) {
        for (final AggregatingView view : views) {
          if (view.getMaterializationStrategy() != MaterializationStrategy.NONE) {
            browserFacade.relation(ElementView.ELEMENT_VIEW_NAME).aggregate(view.getUuid(), Query.fields("*"), false);
origin: pl.edu.icm.yadda/bwmeta-process

@Override
protected Chunk doProcessChunk(final Chunk data,
    final Map<String, Serializable> context,
    final IProcessListener processListener,
    final ProcessingStats stats)
    throws Exception {
  final Batch batch = browserFacade.relation(TypeView.TYPE_VIEW_NAME).batch();
  for (final CatalogElement ce : data.getItems()) {
    try {
      if (ce.isDeleted()) {
          batch.delete(Condition.eq(TypeView.FIELD_EXTID, ce.getId().getId()));
      } else if (ce.getElement() == null && ce.getNonElement() != null) {
        String extId = null;
        extId = ce.getNonElement().getExtId();
        final Serializable[] tuple = TypeView.asTuple(ce.getNonElement());
        batch.addOrUpdate(Condition.eq(TypeView.FIELD_EXTID, extId), tuple);
      } else if (ce.isDeleted()) {
        batch.delete(Condition.eq(TypeView.FIELD_EXTID, ce.getExtId()));
      }
    } catch (final Exception e) {
      log.error("Exception processing element " + ce.getExtId());
      if (processListener != null) {
        processListener.notifyEvent("typeViewGenerator.process", new String[]{ce.getExtId()}, EventResultCode.ERROR, StackTraceUtil.getStackTrace(e));
      }
      throw e;
    }
  }
  batch.run();
  return data;
}
pl.edu.icm.yadda.service2.browse.facadeRelation

Javadoc

Part of the browser facade providing access to a single relation.

Most used methods

  • select
    Retrieves from the relation data specified by a query.
  • withPageSize
    Sets the page size for the initial select request and returns this object.
  • getInfo
  • addOrUpdate
    Replaces data in tuples matching a condition with a new tuple, or if no atuple matches adds the data
  • aggregate
    Executes a predefined aggregation query.
  • batch
    Creates a batch descriptor for performing a set of operations in one go.
  • count
    Counts the tuples in the relation which match a condition.
  • delete
    Removes tuples matching a condition from the relation.
  • getAggregatingView
    Finds an aggregating view by a given name.
  • setAggregatingEnabled
    Suspends or resumes the usage of aggregations with incremental materialization strategy.
  • updateTags
    Updates tags of this relation.
  • updateTags

Popular in Java

  • Parsing JSON documents to java classes using gson
  • addToBackStack (FragmentTransaction)
  • runOnUiThread (Activity)
  • getApplicationContext (Context)
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate(i
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • ResourceBundle (java.util)
    Resource bundles contain locale-specific objects. When your program needs a locale-specific resource
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now