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

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

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

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/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: 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.indirectionIndirectSetshouldAvoidInstantiation

Javadoc

INTERNAL: Return if add/remove should trigger instantiation or avoid. Current instantiation is avoided is using change tracking.

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
  • hasRemovedElements
    INTERNAL: Return if any elements that have been removed before instantiation.
  • hasBeenRegistered,
  • hasRemovedElements,
  • hasTrackedPropertyChangeListener,
  • isInstantiated,
  • iterator,
  • raiseAddChangeEvent,
  • raiseRemoveChangeEvent,
  • remove,
  • <init>

Popular in Java

  • Updating database using SQL prepared statement
  • setScale (BigDecimal)
  • getSystemService (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • ImageIO (javax.imageio)
  • BoxLayout (javax.swing)
  • 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