congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
IndirectSet.hasAddedElements
Code IndexAdd Tabnine to your IDE (free)

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

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

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/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: 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#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: 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;
}
org.eclipse.persistence.indirectionIndirectSethasAddedElements

Javadoc

INTERNAL: Return if any elements that have been added 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.
  • 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

  • Updating database using SQL prepared statement
  • getApplicationContext (Context)
  • setContentView (Activity)
  • addToBackStack (FragmentTransaction)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Table (org.hibernate.mapping)
    A relational table
  • Top Sublime Text 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