Tabnine Logo
EISOneToManyMapping
Code IndexAdd Tabnine to your IDE (free)

How to use
EISOneToManyMapping
in
org.eclipse.persistence.eis.mappings

Best Java code snippets using org.eclipse.persistence.eis.mappings.EISOneToManyMapping (Showing top 20 results out of 315)

origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * Convenience method.
 */
private Object buildAddedElementFromChangeSet(Object changeSet, MergeManager mergeManager, AbstractSession targetSession) {
  return this.getMapping().buildAddedElementFromChangeSet(changeSet, mergeManager, targetSession);
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * Convenience method.
 */
private Object buildChangeSet(Object element, ObjectChangeSet owner, AbstractSession session) {
  return this.getMapping().buildChangeSet(element, owner, session);
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * Convenience method.
 */
private Object buildElementFromElement(Object element, MergeManager mergeManager, AbstractSession targetSession) {
  return this.getMapping().buildElementFromElement(element, mergeManager, targetSession);
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * Update the reference objects.
 */
public void postUpdate(WriteObjectQuery query) throws DatabaseException, OptimisticLockException {
  if (isForeignKeyRelationship()) {
    return;
  }
  if (!this.shouldObjectModifyCascadeToParts(query)) {
    return;
  }
  // if the target objects are not instantiated, they could not have been changed....
  if (!this.isAttributeValueInstantiatedOrChanged(query.getObject())) {
    return;
  }
  // manage objects added and removed from the collection
  Object objectsInMemory = this.getRealCollectionAttributeValueFromObject(query.getObject(), query.getSession());
  Object objectsInDB = this.readPrivateOwnedForObject(query);
  this.compareObjectsAndWrite(objectsInDB, objectsInMemory, query);
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Update the privately owned parts.
 */
@Override
public void preUpdate(WriteObjectQuery query) throws DatabaseException, OptimisticLockException {
  if (!isForeignKeyRelationship()) {
    return;
  }
  if (!shouldObjectModifyCascadeToParts(query)) {
    return;
  }
  // if the target objects are not instantiated, they could not have been changed....
  if (!isAttributeValueInstantiatedOrChanged(query.getObject())) {
    return;
  }
  if (query.getObjectChangeSet() != null) {
    // UnitOfWork
    writeChanges(query.getObjectChangeSet(), query);
  } else {
    // OLD COMMIT
    compareObjectsAndWrite(query);
  }
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * If any of the references objects has changed, write out
 * all the keys.
 */
@Override
public void writeFromObjectIntoRowForUpdate(WriteObjectQuery writeQuery, AbstractRecord row) throws DescriptorException {
  if (!this.isAttributeValueInstantiatedOrChanged(writeQuery.getObject())) {
    return;
  }
  AbstractSession session = writeQuery.getSession();
  if (session.isUnitOfWork()) {
    // PRS2074 fix for "traditional" Indirection
    Object collection1 = this.getRealCollectionAttributeValueFromObject(writeQuery.getObject(), session);
    Object collection2 = this.getRealCollectionAttributeValueFromObject(writeQuery.getBackupClone(), session);
    if (this.compareObjectsWithoutPrivateOwned(collection1, collection2, session)) {
      return;// nothing has changed - don't put anything in the row
    }
  }
  this.writeFromObjectIntoRow(writeQuery.getObject(), row, session, WriteType.UPDATE);
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * Build and return a new element based on the change set.
 */
public Object buildAddedElementFromChangeSet(Object changeSet, MergeManager mergeManager) {
  ObjectChangeSet objectChangeSet = (ObjectChangeSet)changeSet;
  if (this.shouldMergeCascadeParts(mergeManager)) {
    Object targetElement = null;
    if (mergeManager.shouldMergeChangesIntoDistributedCache()) {
      targetElement = objectChangeSet.getTargetVersionOfSourceObject(mergeManager.getSession(), true);
    } else {
      targetElement = objectChangeSet.getUnitOfWorkClone();
    }
    mergeManager.mergeChanges(targetElement, objectChangeSet);
  }
  return this.buildElementFromChangeSet(changeSet, mergeManager);
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * Convenience method.
 */
private Object buildRemovedElementFromChangeSet(Object changeSet, MergeManager mergeManager, AbstractSession targetSession) {
  return this.getMapping().buildRemovedElementFromChangeSet(changeSet, mergeManager, targetSession);
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * Build and return a new element based on the change set.
 */
public Object buildRemovedElementFromChangeSet(Object changeSet, MergeManager mergeManager, AbstractSession targetSession) {
  ObjectChangeSet objectChangeSet = (ObjectChangeSet)changeSet;
  if (!mergeManager.shouldMergeChangesIntoDistributedCache()) {
    mergeManager.registerRemovedNewObjectIfRequired(objectChangeSet.getUnitOfWorkClone());
  }
  return this.buildElementFromChangeSet(changeSet, mergeManager, targetSession);
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * PUBLIC:
 * Define the source foreign key relationship in the one-to-many mapping.
 * This method is used for composite source foreign key relationships.
 * That is, the source object's table has multiple foreign key fields
 * that are references to
 * the target object's (typically primary) key fields.
 * Both the source foreign key field name and the corresponding
 * target primary key field name must be specified.
 */
public void addForeignKeyFieldName(String sourceForeignKeyFieldName, String targetKeyFieldName) {
  this.addForeignKeyField(new DatabaseField(sourceForeignKeyFieldName), new DatabaseField(targetKeyFieldName));
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * Convenience method.
 * Check for null values before delegating to the mapping.
 */
private boolean compareElements(Object element1, Object element2, AbstractSession session) {
  if ((element1 == null) && (element2 == null)) {
    return true;
  }
  if ((element1 == null) || (element2 == null)) {
    return false;
  }
  if (element2 == XXX) {// if element2 was marked as cleared out, it is not a match
    return false;
  }
  return this.getMapping().compareElements(element1, element2, session);
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * Convenience method.
 * Check for null values before delegating to the mapping.
 */
private boolean compareElementsForChange(Object element1, Object element2, AbstractSession session) {
  if ((element1 == null) && (element2 == null)) {
    return true;
  }
  if ((element1 == null) || (element2 == null)) {
    return false;
  }
  if (element2 == XXX) {// if element2 was marked as cleared out, it is not a match
    return false;
  }
  return this.getMapping().compareElementsForChange(element1, element2, session);
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Update the reference objects.
 */
@Override
public void postUpdate(WriteObjectQuery query) throws DatabaseException, OptimisticLockException {
  if (isForeignKeyRelationship()) {
    return;
  }
  if (!shouldObjectModifyCascadeToParts(query)) {
    return;
  }
  // if the target objects are not instantiated, they could not have been changed....
  if (!isAttributeValueInstantiatedOrChanged(query.getObject())) {
    return;
  }
  if (query.getObjectChangeSet() != null) {
    // UnitOfWork
    writeChanges(query.getObjectChangeSet(), query);
  } else {
    // OLD COMMIT
    compareObjectsAndWrite(query);
  }
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * Update the privately owned parts.
 */
public void preUpdate(WriteObjectQuery query) throws DatabaseException, OptimisticLockException {
  if (!this.isForeignKeyRelationship()) {
    return;
  }
  if (!this.shouldObjectModifyCascadeToParts(query)) {
    return;
  }
  // if the target objects are not instantiated, they could not have been changed....
  if (!this.isAttributeValueInstantiatedOrChanged(query.getObject())) {
    return;
  }
  // manage objects added and removed from the collection
  Object objectsInMemory = this.getRealCollectionAttributeValueFromObject(query.getObject(), query.getSession());
  Object objectsInDB = this.readPrivateOwnedForObject(query);
  this.compareObjectsAndWrite(objectsInDB, objectsInMemory, query);
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * If any of the references objects has changed, write out
 * all the keys.
 */
public void writeFromObjectIntoRowForUpdate(WriteObjectQuery writeQuery, AbstractRecord row) throws DescriptorException {
  if (!this.isAttributeValueInstantiatedOrChanged(writeQuery.getObject())) {
    return;
  }
  AbstractSession session = writeQuery.getSession();
  if (session.isUnitOfWork()) {
    // PRS2074 fix for "traditional" Indirection
    Object collection1 = this.getRealCollectionAttributeValueFromObject(writeQuery.getObject(), session);
    Object collection2 = this.getRealCollectionAttributeValueFromObject(writeQuery.getBackupClone(), session);
    if (this.compareObjectsWithoutPrivateOwned(collection1, collection2, session)) {
      return;// nothing has changed - don't put anything in the row
    }
  }
  this.writeFromObjectIntoRow(writeQuery.getObject(), row, session);
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Build and return a new element based on the change set.
 */
public Object buildAddedElementFromChangeSet(Object changeSet, MergeManager mergeManager, AbstractSession targetSession) {
  ObjectChangeSet objectChangeSet = (ObjectChangeSet)changeSet;
  if (this.shouldMergeCascadeParts(mergeManager)) {
    Object targetElement = null;
    if (mergeManager.shouldMergeChangesIntoDistributedCache()) {
      targetElement = objectChangeSet.getTargetVersionOfSourceObject(mergeManager, mergeManager.getSession(), true);
    } else {
      targetElement = objectChangeSet.getUnitOfWorkClone();
    }
    mergeManager.mergeChanges(targetElement, objectChangeSet, targetSession);
  }
  return this.buildElementFromChangeSet(changeSet, mergeManager, targetSession);
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * Convenience method.
 */
private Object buildRemovedElementFromChangeSet(Object changeSet, MergeManager mergeManager) {
  return this.getMapping().buildRemovedElementFromChangeSet(changeSet, mergeManager);
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Build and return a new element based on the change set.
 */
public Object buildRemovedElementFromChangeSet(Object changeSet, MergeManager mergeManager, AbstractSession targetSession) {
  ObjectChangeSet objectChangeSet = (ObjectChangeSet)changeSet;
  if (!mergeManager.shouldMergeChangesIntoDistributedCache()) {
    mergeManager.registerRemovedNewObjectIfRequired(objectChangeSet.getUnitOfWorkClone());
  }
  return this.buildElementFromChangeSet(changeSet, mergeManager, targetSession);
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * PUBLIC:
 * Define the source foreign key relationship in the one-to-many mapping.
 * This method is used for composite source foreign key relationships.
 * That is, the source object's table has multiple foreign key fields
 * that are references to
 * the target object's (typically primary) key fields.
 * Both the source foreign key field name and the corresponding
 * target primary key field name must be specified.
 */
public void addForeignKeyFieldName(String sourceForeignKeyFieldName, String targetKeyFieldName) {
  this.addForeignKeyField(new DatabaseField(sourceForeignKeyFieldName), new DatabaseField(targetKeyFieldName));
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * Convenience method.
 * Check for null values before delegating to the mapping.
 */
private boolean compareElements(Object element1, Object element2, AbstractSession session) {
  if ((element1 == null) && (element2 == null)) {
    return true;
  }
  if ((element1 == null) || (element2 == null)) {
    return false;
  }
  if (element2 == XXX) {// if element2 was marked as cleared out, it is not a match
    return false;
  }
  return this.getMapping().compareElements(element1, element2, session);
}
org.eclipse.persistence.eis.mappingsEISOneToManyMapping

Javadoc

An EIS one-to-many mapping is a reference mapping that represents the relationship between a single source object and a collection of mapped persistent Java objects. The source object usually contains a foreign key (pointer) to the target objects (key on source); alternatively, the target objects may contain a foreign key to the source object (key on target). Because both the source and target objects use interactions, they must all be configured as root object types.

Record Type Description
Indexed Ordered collection of record elements. The indexed record EIS format enables Java class attribute values to be retreived by position or index.
Mapped Key-value map based representation of record elements. The mapped record EIS format enables Java class attribute values to be retreived by an object key.
XML Record/Map representation of an XML DOM element.

Most used methods

  • addForeignKeyField
    PUBLIC: Define the source foreign key relationship in the one-to-many mapping. This method is used f
  • buildAddedElementFromChangeSet
    INTERNAL: Build and return a new element based on the change set.
  • buildChangeSet
    INTERNAL: Build and return a change set for the specified element.
  • buildElementFromChangeSet
    Build and return a new element based on the change set.
  • buildElementFromElement
    INTERNAL: Build and return a new element based on the specified element.
  • buildRemovedElementFromChangeSet
    INTERNAL: Build and return a new element based on the change set.
  • compareElements
    INTERNAL: Compare the non-null elements and return true if they are alike.
  • compareElementsForChange
    INTERNAL: Compare the non-null elements and return true if they are alike. Here we use object identi
  • compareObjectsAndWrite
  • compareObjectsWithoutPrivateOwned
  • deleteAll
    Delete all the reference objects.
  • deleteReferenceObjectsLeftOnDatabase
    This method will make sure that all the records privately owned by this mapping are actually removed
  • deleteAll,
  • deleteReferenceObjectsLeftOnDatabase,
  • extractKeyRowFromReferenceObject,
  • getAttributeName,
  • getAttributeValueFromObject,
  • getContainerPolicy,
  • getDeleteAllQuery,
  • getDescriptor,
  • getForeignKeyGroupingElement,
  • getForeignKeyRows

Popular in Java

  • Making http post requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • addToBackStack (FragmentTransaction)
  • getExternalFilesDir (Context)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Runner (org.openjdk.jmh.runner)
  • Best plugins for Eclipse
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