Tabnine Logo
BaseResourceIndex
Code IndexAdd Tabnine to your IDE (free)

How to use
BaseResourceIndex
in
ca.uhn.fhir.jpa.model.entity

Best Java code snippets using ca.uhn.fhir.jpa.model.entity.BaseResourceIndex (Showing top 3 results out of 315)

origin: jamesagnew/hapi-fhir

public void calculateHashes(Collection<? extends BaseResourceIndex> theStringParams) {
  for (BaseResourceIndex next : theStringParams) {
    next.calculateHashes();
  }
}
origin: jamesagnew/hapi-fhir

/**
 * The logic here is that often times when we update a resource we are dropping
 * one index row and adding another. This method tries to reuse rows that would otherwise
 * have been deleted by updating them with the contents of rows that would have
 * otherwise been added. In other words, we're trying to replace
 * "one delete + one insert" with "one update"
 *
 * @param theIndexesToRemove The rows that would be removed
 * @param theIndexesToAdd The rows that would be added
 */
private <T extends BaseResourceIndex> void tryToReuseIndexEntities(List<T> theIndexesToRemove, List<T> theIndexesToAdd) {
  for (int addIndex = 0; addIndex < theIndexesToAdd.size(); addIndex++) {
    // If there are no more rows to remove, there's nothing we can reuse
    if (theIndexesToRemove.isEmpty()) {
      break;
    }
    T targetEntity = theIndexesToAdd.get(addIndex);
    if (targetEntity.getId() != null) {
      continue;
    }
    // Take a row we were going to remove, and repurpose its ID
    T entityToReuse = theIndexesToRemove.remove(theIndexesToRemove.size() - 1);
    targetEntity.setId(entityToReuse.getId());
  }
}
origin: ca.uhn.hapi.fhir/hapi-fhir-jpaserver-base

/**
 * The logic here is that often times when we update a resource we are dropping
 * one index row and adding another. This method tries to reuse rows that would otherwise
 * have been deleted by updating them with the contents of rows that would have
 * otherwise been added. In other words, we're trying to replace
 * "one delete + one insert" with "one update"
 *
 * @param theIndexesToRemove The rows that would be removed
 * @param theIndexesToAdd The rows that would be added
 */
private <T extends BaseResourceIndex> void tryToReuseIndexEntities(List<T> theIndexesToRemove, List<T> theIndexesToAdd) {
  for (int addIndex = 0; addIndex < theIndexesToAdd.size(); addIndex++) {
    // If there are no more rows to remove, there's nothing we can reuse
    if (theIndexesToRemove.isEmpty()) {
      break;
    }
    T targetEntity = theIndexesToAdd.get(addIndex);
    if (targetEntity.getId() != null) {
      continue;
    }
    // Take a row we were going to remove, and repurpose its ID
    T entityToReuse = theIndexesToRemove.remove(theIndexesToRemove.size() - 1);
    targetEntity.setId(entityToReuse.getId());
  }
}
ca.uhn.fhir.jpa.model.entityBaseResourceIndex

Most used methods

  • calculateHashes
  • getId
  • setId

Popular in Java

  • Making http post requests using okhttp
  • getApplicationContext (Context)
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • JTextField (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now