Tabnine Logo
IndirectSet.getRemovedElements
Code IndexAdd Tabnine to your IDE (free)

How to use
getRemovedElements
method
in
org.eclipse.persistence.indirection.IndirectSet

Best Java code snippets using org.eclipse.persistence.indirection.IndirectSet.getRemovedElements (Showing top 12 results out of 315)

origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * @see java.util.Set#contains(java.lang.Object)
 */
public boolean contains(Object element) {
  // PERF: Avoid instantiation if not required.
  if (hasAddedElements()) {
    if (getAddedElements().contains(element)) {
      return true;
    }
  }
  if (hasRemovedElements()) {
    if (getRemovedElements().contains(element)) {
      return false;
    }
  }
  return this.getDelegate().contains(element);
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * @see java.util.Set#remove(java.lang.Object)
 */
public boolean remove(Object element) {
  // PERF: If not instantiated just record the removal to avoid the instantiation.
  if (shouldAvoidInstantiation()) {
    if (hasAddedElements() && getAddedElements().contains(element)) {
      getAddedElements().remove(element);
    } else if (getRemovedElements().contains(element)) {
      // Must avoid recursion for relationship maintenance.
      return false;
    } else {
      getRemovedElements().add(element);
    }
    this.raiseRemoveChangeEvent(element);
    return true;
  } else if (this.getDelegate().remove(element)) {
    this.raiseRemoveChangeEvent(element);
    return true;
  }
  return false;
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * @see java.util.Set#contains(java.lang.Object)
 */
@Override
public boolean contains(Object element) {
  // PERF: Avoid instantiation if not required.
  if (hasAddedElements()) {
    if (getAddedElements().contains(element)) {
      return true;
    }
  }
  if (hasRemovedElements()) {
    if (getRemovedElements().contains(element)) {
      return false;
    }
  }
  return this.getDelegate().contains(element);
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * @see java.util.Set#add(java.lang.Object)
 */
@Override
public boolean add(E element) {
  boolean added = true;
  // PERF: If not instantiated just record the add to avoid the instantiation.
  if (shouldAvoidInstantiation()) {
    if (hasRemovedElements() && getRemovedElements().contains(element)) {
      getRemovedElements().remove(element);
    } else if (isRelationshipMaintenanceRequired() && getAddedElements().contains(element)) {
      // Must avoid recursion for relationship maintenance.
      return false;
    } else {
      getAddedElements().add(element);
    }
  } else {
    added = getDelegate().add(element);
  }
  if (added) {
    raiseAddChangeEvent(element);
  }
  return added;
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * @see java.util.Set#add(java.lang.Object)
 */
public boolean add(Object element) {
  boolean added = true;
  // PERF: If not instantiated just record the add to avoid the instantiation.
  if (shouldAvoidInstantiation()) {
    if (hasRemovedElements() && getRemovedElements().contains(element)) {
      getRemovedElements().remove(element);
    } else if (getAddedElements().contains(element)) {
      // Must avoid recursion for relationship maintenance.                
      return false;
    } else {
      getAddedElements().add(element);
    }
  } else {
    added = getDelegate().add(element);
  }
  raiseAddChangeEvent(element);
  return added;
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * @see java.util.Set#contains(java.lang.Object)
 */
@Override
public boolean contains(Object element) {
  // PERF: Avoid instantiation if not required.
  if (hasAddedElements()) {
    if (getAddedElements().contains(element)) {
      return true;
    }
  }
  if (hasRemovedElements()) {
    if (getRemovedElements().contains(element)) {
      return false;
    }
  }
  return this.getDelegate().contains(element);
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Return the freshly-built delegate.
 */
protected Set<E> buildDelegate() {
  Set<E> newDelegate = (Set<E>)getValueHolder().getValue();
  if (newDelegate == null) {
    newDelegate = new HashSet<>(this.initialCapacity, this.loadFactor);
  }
  // This can either be another indirect set or a HashSet.
  // It can be another indirect list because the mapping's query uses the same container policy.
  // Unwrap any redundant indirection layers, which can cause issues and impact performance.
  while (newDelegate instanceof IndirectSet) {
    newDelegate = ((IndirectSet) newDelegate).getDelegate();
  }
  // First add/remove any cached changes.
  if (hasAddedElements()) {
    for (Iterator<E> iterator = getAddedElements().iterator(); iterator.hasNext(); ) {
      newDelegate.add(iterator.next());
    }
    this.addedElements = null;
  }
  if (hasRemovedElements()) {
    for (Iterator<E> iterator = getRemovedElements().iterator(); iterator.hasNext(); ) {
      newDelegate.remove(iterator.next());
    }
    this.removedElements = null;
  }
  return newDelegate;
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * Return the freshly-built delegate.
 */
protected Set buildDelegate() {
  Set delegate = (Set)getValueHolder().getValue();
  // This can either be another indirect set or a HashSet.
  // It can be another indirect list because the mapping's query uses the same container policy.
  // Unwrap any redundent indirection layers, which can cause issues and impact performance.
  while (delegate instanceof IndirectSet) {
    delegate = ((IndirectSet) delegate).getDelegate();
  }
  // First add/remove any cached changes.
  if (hasAddedElements()) {
    for (Iterator iterator = getAddedElements().iterator(); iterator.hasNext(); ) {
      delegate.add(iterator.next());
    }
    this.addedElements = null;
  }
  if (hasRemovedElements()) {
    for (Iterator iterator = getRemovedElements().iterator(); iterator.hasNext(); ) {
      delegate.remove(iterator.next());
    }
    this.removedElements = null;
  }
  return delegate;
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * Return the freshly-built delegate.
 */
protected Set<E> buildDelegate() {
  Set delegate = (Set)getValueHolder().getValue();
  if (delegate == null) {
    delegate = new HashSet<>(this.initialCapacity, this.loadFactor);
  }
  // This can either be another indirect set or a HashSet.
  // It can be another indirect list because the mapping's query uses the same container policy.
  // Unwrap any redundent indirection layers, which can cause issues and impact performance.
  while (delegate instanceof IndirectSet) {
    delegate = ((IndirectSet) delegate).getDelegate();
  }
  // First add/remove any cached changes.
  if (hasAddedElements()) {
    for (Iterator iterator = getAddedElements().iterator(); iterator.hasNext(); ) {
      delegate.add(iterator.next());
    }
    this.addedElements = null;
  }
  if (hasRemovedElements()) {
    for (Iterator iterator = getRemovedElements().iterator(); iterator.hasNext(); ) {
      delegate.remove(iterator.next());
    }
    this.removedElements = null;
  }
  return delegate;
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * @see java.util.Set#remove(java.lang.Object)
 */
@Override
public boolean remove(Object element) {
  // PERF: If not instantiated just record the removal to avoid the instantiation.
  if (shouldAvoidInstantiation()) {
    if (hasAddedElements() && getAddedElements().contains(element)) {
      getAddedElements().remove(element);
    } else if (getRemovedElements().contains(element)) {
      // Must avoid recursion for relationship maintenance.
      return false;
    } else {
      getRemovedElements().add((E) element);
    }
    this.raiseRemoveChangeEvent(element);
    return true;
  } else if (this.getDelegate().remove(element)) {
    this.raiseRemoveChangeEvent(element);
    return true;
  }
  return false;
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * @see java.util.Set#remove(java.lang.Object)
 */
@Override
public boolean remove(Object element) {
  // PERF: If not instantiated just record the removal to avoid the instantiation.
  if (shouldAvoidInstantiation()) {
    if (hasAddedElements() && getAddedElements().contains(element)) {
      getAddedElements().remove(element);
    } else if (getRemovedElements().contains(element)) {
      // Must avoid recursion for relationship maintenance.
      return false;
    } else {
      getRemovedElements().add(element);
    }
    this.raiseRemoveChangeEvent(element);
    return true;
  } else if (this.getDelegate().remove(element)) {
    this.raiseRemoveChangeEvent(element);
    return true;
  }
  return false;
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * @see java.util.Set#add(java.lang.Object)
 */
@Override
public boolean add(E element) {
  boolean added = true;
  // PERF: If not instantiated just record the add to avoid the instantiation.
  if (shouldAvoidInstantiation()) {
    if (hasRemovedElements() && getRemovedElements().contains(element)) {
      getRemovedElements().remove(element);
    } else if (isRelationshipMaintenanceRequired() && getAddedElements().contains(element)) {
      // Must avoid recursion for relationship maintenance.                
      return false;
    } else {
      getAddedElements().add(element);
    }
  } else {
    added = getDelegate().add(element);
  }
  if (added) {
    raiseAddChangeEvent(element);
  }
  return added;
}
org.eclipse.persistence.indirectionIndirectSetgetRemovedElements

Javadoc

INTERNAL: Return the elements that have been removed before instantiation.

Popular methods of IndirectSet

  • _persistence_getPropertyChangeListener
    INTERNAL: Return the property change listener for change tracking.
  • add
  • buildDelegate
    INTERNAL: Return the freshly-built delegate.
  • cloneDelegate
    INTERNAL: Clone the delegate.
  • getAddedElements
    INTERNAL: Return the elements that have been added before instantiation.
  • getDelegate
    INTERNAL: Check whether the contents have been read from the database. If they have not, read them a
  • getTrackedAttributeName
    INTERNAL: Return the mapping attribute name, used to raise change events.
  • getValueHolder
    INTERNAL: Return the valueHolder.
  • hasAddedElements
    INTERNAL: Return if any elements that have been added before instantiation.
  • hasBeenRegistered
    INTERNAL: Return whether this IndirectSet has been registered in a UnitOfWork
  • hasRemovedElements
    INTERNAL: Return if any elements that have been removed before instantiation.
  • hasTrackedPropertyChangeListener
    INTERNAL: Return if the collection has a property change listener for change tracking.
  • hasRemovedElements,
  • hasTrackedPropertyChangeListener,
  • isInstantiated,
  • iterator,
  • raiseAddChangeEvent,
  • raiseRemoveChangeEvent,
  • remove,
  • shouldAvoidInstantiation,
  • <init>

Popular in Java

  • Parsing JSON documents to java classes using gson
  • requestLocationUpdates (LocationManager)
  • startActivity (Activity)
  • setRequestProperty (URLConnection)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • CodeWhisperer alternatives
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