congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
IndirectList.shouldAvoidInstantiation
Code IndexAdd Tabnine to your IDE (free)

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

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

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

/**
 * @see java.util.Vector#add(java.lang.Object)
 */
public boolean add(Object element) {
  if (!this.isRegistered) {
    return getDelegate().add(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, null);
  return added;
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * @see java.util.Vector#add(java.lang.Object)
 */
@Override
public boolean add(E element) {
  if (!this.isRegistered) {
    return getDelegate().add(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);
  }
  raiseAddChangeEvent(element, null);
  return added;
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * @see java.util.Vector#add(java.lang.Object)
 */
@Override
public boolean add(E element) {
  if (!this.isRegistered) {
    return getDelegate().add(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);
  }
  raiseAddChangeEvent(element, null);
  return added;
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * @see java.util.Vector#remove(java.lang.Object)
 */
public boolean remove(Object element) {
  if (!this.isRegistered) {
    return getDelegate().remove(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, null);
    return true;
  } else { 
    int index = this.getDelegate().indexOf(element);
    if(index > -1) {
      this.getDelegate().remove(index);
      this.raiseRemoveChangeEvent(element, index);
      return true;
    }
  }  
  return false;
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * @see java.util.Vector#remove(java.lang.Object)
 */
@Override
public boolean remove(Object element) {
  if (!this.isRegistered) {
    return getDelegate().remove(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, null);
    return true;
  } else {
    int index = this.getDelegate().indexOf(element);
    if(index > -1) {
      this.getDelegate().remove(index);
      this.raiseRemoveChangeEvent(element, index);
      return true;
    }
  }
  return false;
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * @see java.util.Vector#remove(java.lang.Object)
 */
@Override
public boolean remove(Object element) {
  if (!this.isRegistered) {
    return getDelegate().remove(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, null);
    return true;
  } else { 
    int index = this.getDelegate().indexOf(element);
    if(index > -1) {
      this.getDelegate().remove(index);
      this.raiseRemoveChangeEvent(element, index);
      return true;
    }
  }  
  return false;
}
org.eclipse.persistence.indirectionIndirectListshouldAvoidInstantiation

Javadoc

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

Popular methods of IndirectList

  • <init>
    PUBLIC: Construct an IndirectList containing the elements of the specified collection, in the order
  • _persistence_getPropertyChangeListener
    INTERNAL: Return the property change listener for change tracking.
  • add
  • buildDelegate
    INTERNAL: Return the freshly-built 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. This method used to be synchronized, which caused deadlock.
  • hasAddedElements
    INTERNAL: Return if any elements that have been added before instantiation.
  • hasBeenRegistered
    INTERNAL: return whether this IndirectList has been registered with the UnitOfWork
  • hasRemovedElements
    INTERNAL: Return if any elements that have been removed before instantiation.
  • hasBeenRegistered,
  • hasRemovedElements,
  • hasTrackedPropertyChangeListener,
  • isInstantiated,
  • isListOrderBrokenInDb,
  • iterator,
  • listIterator,
  • raiseAddChangeEvent,
  • raiseRemoveChangeEvent,
  • remove

Popular in Java

  • Reactive rest calls using spring rest template
  • putExtra (Intent)
  • startActivity (Activity)
  • setRequestProperty (URLConnection)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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