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

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

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

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

/**
 * INTERNAL:
 * Return if any elements that have been added or removed before instantiation.
 */
public boolean hasDeferredChanges() {
  return hasRemovedElements() || hasAddedElements();
}
 
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * Return if any elements that have been added or removed before instantiation.
 */
@Override
public boolean hasDeferredChanges() {
  return hasRemovedElements() || hasAddedElements();
}
 
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Return if any elements that have been added or removed before instantiation.
 */
@Override
public boolean hasDeferredChanges() {
  return hasRemovedElements() || hasAddedElements();
}
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: 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#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/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#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: 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.indirectionIndirectSethasRemovedElements

Javadoc

INTERNAL: Return if any 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
  • getRemovedElements
    INTERNAL: Return the elements that have been removed before instantiation.
  • 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
  • hasTrackedPropertyChangeListener
    INTERNAL: Return if the collection has a property change listener for change tracking.
  • hasBeenRegistered,
  • hasTrackedPropertyChangeListener,
  • isInstantiated,
  • iterator,
  • raiseAddChangeEvent,
  • raiseRemoveChangeEvent,
  • remove,
  • shouldAvoidInstantiation,
  • <init>

Popular in Java

  • Updating database using SQL prepared statement
  • runOnUiThread (Activity)
  • getSystemService (Context)
  • compareTo (BigDecimal)
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Path (java.nio.file)
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • JCheckBox (javax.swing)
  • Top plugins for Android Studio
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