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

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

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

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

/**
 * Return all the fields mapped by the mapping.
 */
protected Vector collectFields() {
  if (isForeignKeyRelationship()) {
    if (this.getForeignKeyGroupingElement() != null) {
      Vector fields = new Vector(1);
      fields.addElement(this.getForeignKeyGroupingElement());
      return fields;
    } else {
      return NO_FIELDS;
    }
  } else {
    return NO_FIELDS;
  }
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * Return all the fields mapped by the mapping.
 */
@Override
protected Vector collectFields() {
  if (isForeignKeyRelationship()) {
    if (this.getForeignKeyGroupingElement() != null) {
      Vector fields = new Vector(1);
      fields.addElement(this.getForeignKeyGroupingElement());
      return fields;
    } else {
      return NO_FIELDS;
    }
  } else {
    return NO_FIELDS;
  }
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * Return all the fields mapped by the mapping.
 */
@Override
protected Vector collectFields() {
  if (isForeignKeyRelationship()) {
    if (this.getForeignKeyGroupingElement() != null) {
      Vector fields = new Vector(1);
      fields.addElement(this.getForeignKeyGroupingElement());
      return fields;
    } else {
      return NO_FIELDS;
    }
  } else {
    return NO_FIELDS;
  }
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Write fields needed for insert into the template for with null values.
 */
@Override
public void writeInsertFieldsIntoRow(AbstractRecord row, AbstractSession session) {
  if (isForeignKeyRelationship() && !isReadOnly()) {
    if (getForeignKeyGroupingElement() != null) {
      row.put(getForeignKeyGroupingElement(), null);
    } else if (this.getSourceForeignKeyFields().size() > 0) {
      row.put(getSourceForeignKeyFields().get(0), null);
    }
  } else {
    super.writeInsertFieldsIntoRow(row, session);
  }
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * Write fields needed for insert into the template for with null values.
 */
public void writeInsertFieldsIntoRow(AbstractRecord row, AbstractSession session) {
  if (isForeignKeyRelationship() && !isReadOnly()) {
    if (getForeignKeyGroupingElement() != null) {
      row.put(getForeignKeyGroupingElement(), null);
    } else if (this.getSourceForeignKeyFields().size() > 0) {
      row.put(getSourceForeignKeyFields().get(0), null);
    }
  } else {
    super.writeInsertFieldsIntoRow(row, session);
  }
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * This row is built for shallow insert which happens in case of bidirectional inserts.
 * The foreign keys must be set to null to avoid constraints.
 */
public void writeFromObjectIntoRowForShallowInsert(Object object, AbstractRecord row, AbstractSession session) {
  if (isForeignKeyRelationship() && !isReadOnly()) {
    if (getForeignKeyGroupingElement() != null) {
      row.put(getForeignKeyGroupingElement(), null);
    } else if (this.getSourceForeignKeyFields().size() > 0) {
      row.put(getSourceForeignKeyFields().get(0), null);
    }
  } else {
    super.writeFromObjectIntoRowForShallowInsert(object, row, session);
  }
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * This row is built for shallow insert which happens in case of bidirectional inserts.
 * The foreign keys must be set to null to avoid constraints.
 */
@Override
public void writeFromObjectIntoRowForShallowInsert(Object object, AbstractRecord row, AbstractSession session) {
  if (isForeignKeyRelationship() && !isReadOnly()) {
    if (getForeignKeyGroupingElement() != null) {
      row.put(getForeignKeyGroupingElement(), null);
    } else if (this.getSourceForeignKeyFields().size() > 0) {
      row.put(getSourceForeignKeyFields().get(0), null);
    }
  } else {
    super.writeFromObjectIntoRowForShallowInsert(object, row, session);
  }
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * Write fields needed for insert into the template for with null values.
 */
@Override
public void writeInsertFieldsIntoRow(AbstractRecord row, AbstractSession session) {
  if (isForeignKeyRelationship() && !isReadOnly()) {
    if (getForeignKeyGroupingElement() != null) {
      row.put(getForeignKeyGroupingElement(), null);
    } else if (this.getSourceForeignKeyFields().size() > 0) {
      row.put(getSourceForeignKeyFields().get(0), null);
    }
  } else {
    super.writeInsertFieldsIntoRow(row, session);
  }
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * This row is built for shallow insert which happens in case of bidirectional inserts.
 * The foreign keys must be set to null to avoid constraints.
 */
public void writeFromObjectIntoRowForShallowInsertWithChangeRecord(ChangeRecord changeRecord, AbstractRecord row, AbstractSession session) {
  if (isForeignKeyRelationship() && !isReadOnly()) {
    if (getForeignKeyGroupingElement() != null) {
      row.put(getForeignKeyGroupingElement(), null);
    } else if (this.getSourceForeignKeyFields().size() > 0) {
      row.put(getSourceForeignKeyFields().get(0), null);
    }
  } else {
    super.writeFromObjectIntoRowForShallowInsertWithChangeRecord(changeRecord, row, session);
  }
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * This row is built for shallow insert which happens in case of bidirectional inserts.
 * The foreign keys must be set to null to avoid constraints.
 */
@Override
public void writeFromObjectIntoRowForShallowInsertWithChangeRecord(ChangeRecord changeRecord, AbstractRecord row, AbstractSession session) {
  if (isForeignKeyRelationship() && !isReadOnly()) {
    if (getForeignKeyGroupingElement() != null) {
      row.put(getForeignKeyGroupingElement(), null);
    } else if (this.getSourceForeignKeyFields().size() > 0) {
      row.put(getSourceForeignKeyFields().get(0), null);
    }
  } else {
    super.writeFromObjectIntoRowForShallowInsertWithChangeRecord(changeRecord, row, session);
  }
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * This row is built for shallow insert which happens in case of bidirectional inserts.
 * The foreign keys must be set to null to avoid constraints.
 */
@Override
public void writeFromObjectIntoRowForShallowInsert(Object object, AbstractRecord row, AbstractSession session) {
  if (isForeignKeyRelationship() && !isReadOnly()) {
    if (getForeignKeyGroupingElement() != null) {
      row.put(getForeignKeyGroupingElement(), null);
    } else if (this.getSourceForeignKeyFields().size() > 0) {
      row.put(getSourceForeignKeyFields().get(0), null);
    }
  } else {
    super.writeFromObjectIntoRowForShallowInsert(object, row, session);
  }
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * This row is built for shallow insert which happens in case of bidirectional inserts.
 * The foreign keys must be set to null to avoid constraints.
 */
@Override
public void writeFromObjectIntoRowForShallowInsertWithChangeRecord(ChangeRecord changeRecord, AbstractRecord row, AbstractSession session) {
  if (isForeignKeyRelationship() && !isReadOnly()) {
    if (getForeignKeyGroupingElement() != null) {
      row.put(getForeignKeyGroupingElement(), null);
    } else if (this.getSourceForeignKeyFields().size() > 0) {
      row.put(getSourceForeignKeyFields().get(0), null);
    }
  } else {
    super.writeFromObjectIntoRowForShallowInsertWithChangeRecord(changeRecord, row, session);
  }
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 */
public Vector getForeignKeyRows(AbstractRecord row, AbstractSession session) {
  Vector subRows = new Vector();
  if (getForeignKeyGroupingElement() == null) {
    if (this.getSourceForeignKeyFields().size() > 0) {
      Object values = row.getValues(this.getSourceForeignKeyFields().get(0));
      if (values != null) {
        if (values instanceof Vector) {
          int valuesSize = ((Vector)values).size();
          for (int j = 0; j < valuesSize; j++) {
            AbstractRecord newRecord = this.descriptor.getObjectBuilder().createRecord(session);
            newRecord.put(this.getSourceForeignKeyFields().get(0), ((Vector)values).get(j));
            subRows.add(newRecord);
          }
        } else {
          AbstractRecord newRecord = this.descriptor.getObjectBuilder().createRecord(session);
          newRecord.put(getSourceForeignKeyFields().get(0), values);
          subRows.add(newRecord);
        }
      }
    }
  } else {
    subRows = (Vector)row.getValues(getForeignKeyGroupingElement());
  }
  return subRows;
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Initialize the mapping.
 */
@Override
public void initialize(AbstractSession session) throws DescriptorException {
  super.initialize(session);
  if ((this.getForeignKeyGroupingElement() == null) && (this.getSourceForeignKeysToTargetKeys().size() > 1)) {
    throw EISException.groupingElementRequired();
  }
  if (this.getForeignKeyGroupingElement() != null) {
    DatabaseField field = this.getDescriptor().buildField(this.getForeignKeyGroupingElement());
    setForeignKeyGroupingElement(field);
  }
  this.initializeSourceForeignKeysToTargetKeys();
  if (shouldInitializeSelectionCriteria()) {
    initializeSelectionCriteria(session);
  }
  this.initializeDeleteAllQuery();
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * Initialize the mapping.
 */
public void initialize(AbstractSession session) throws DescriptorException {
  super.initialize(session);
  if (!this.hasCustomSelectionQuery()) {
    throw DescriptorException.operationNotSupported("customSelectionQueryRequired");
  }
  if ((this.getForeignKeyGroupingElement() == null) && (this.getSourceForeignKeysToTargetKeys().size() > 1)) {
    throw EISException.groupingElementRequired();
  }
  if (this.getForeignKeyGroupingElement() != null) {
    DatabaseField field = this.getDescriptor().buildField(this.getForeignKeyGroupingElement());
    setForeignKeyGroupingElement((XMLField)field);
  }
  this.initializeSourceForeignKeysToTargetKeys();
  this.initializeDeleteAllQuery();
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * Initialize the mapping.
 */
@Override
public void initialize(AbstractSession session) throws DescriptorException {
  super.initialize(session);
  if ((this.getForeignKeyGroupingElement() == null) && (this.getSourceForeignKeysToTargetKeys().size() > 1)) {
    throw EISException.groupingElementRequired();
  }
  if (this.getForeignKeyGroupingElement() != null) {
    DatabaseField field = this.getDescriptor().buildField(this.getForeignKeyGroupingElement());
    setForeignKeyGroupingElement(field);
  }
  this.initializeSourceForeignKeysToTargetKeys();
  
  if (shouldInitializeSelectionCriteria()) {
    initializeSelectionCriteria(session);
  }
  this.initializeDeleteAllQuery();
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * This row is built for update after shallow insert which happens in case of bidirectional inserts.
 * It contains the foreign keys with non null values that were set to null for shallow insert.
 * If mapping overrides writeFromObjectIntoRowForShallowInsert method it must override this one, too.
 */
public void writeFromObjectIntoRowForUpdateAfterShallowInsert(Object object, AbstractRecord row, AbstractSession session, DatabaseTable table) {
  if (isReadOnly() || !isForeignKeyRelationship()) {
    return;
  }
  if (getForeignKeyGroupingElement() != null) {
    if (!getForeignKeyGroupingElement().getTable().equals(table)) {
      return;
    }
  } else if (this.getSourceForeignKeyFields().size() > 0) {
    if (!getSourceForeignKeyFields().get(0).getTable().equals(table)) {
      return;
    }
  }
  writeFromObjectIntoRow(object, row, session, WriteType.UPDATE);
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * This row is built for update after shallow insert which happens in case of bidirectional inserts.
 * It contains the foreign keys with non null values that were set to null for shallow insert.
 * If mapping overrides writeFromObjectIntoRowForShallowInsert method it must override this one, too.
 */
public void writeFromObjectIntoRowForUpdateAfterShallowInsert(Object object, AbstractRecord row, AbstractSession session, DatabaseTable table) {
  if (isReadOnly() || !isForeignKeyRelationship()) {
    return;
  }
  if (getForeignKeyGroupingElement() != null) {
    if (!getForeignKeyGroupingElement().getTable().equals(table)) {
      return;
    }
  } else if (this.getSourceForeignKeyFields().size() > 0) {
    if (!getSourceForeignKeyFields().get(0).getTable().equals(table)) {
      return;
    }
  }
  writeFromObjectIntoRow(object, row, session, WriteType.UPDATE);
}
 
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * Build and return a database row that contains a foreign key for the specified reference 
 * object.  This will be stored in the nested row(s).
 */
protected XMLRecord extractKeyRowFromReferenceObject(Object object, AbstractSession session, XMLRecord parentRecord) {
  Element newNode = XPathEngine.getInstance().createUnownedElement(parentRecord.getDOM(), getForeignKeyGroupingElement());
  XMLRecord result = new DOMRecord(newNode);
  result.setSession(session);
  for (int i = 0; i < this.getSourceForeignKeyFields().size(); i++) {
    DatabaseField fkField = (DatabaseField)getSourceForeignKeyFields().get(i);
    if (object == null) {
      result.add(fkField, null);
    } else {
      DatabaseField pkField = (DatabaseField)this.getSourceForeignKeysToTargetKeys().get(fkField);
      Object value = this.getReferenceDescriptor().getObjectBuilder().extractValueFromObjectForField(object, pkField, session);
      result.add(fkField, value);
    }
  }
  return result;
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * Build and return a database row that contains a foreign key for the specified reference
 * object.  This will be stored in the nested row(s).
 */
protected AbstractRecord extractKeyRowFromReferenceObject(Object object, AbstractSession session, AbstractRecord parentRecord) {
  int size = this.sourceForeignKeyFields.size();
  AbstractRecord result;
  if (((EISDescriptor) this.getDescriptor()).isXMLFormat()) {
    Element newNode = XPathEngine.getInstance().createUnownedElement(((XMLRecord)parentRecord).getDOM(), (XMLField)getForeignKeyGroupingElement());
    result = new DOMRecord(newNode);
    ((DOMRecord)result).setSession(session);
  } else {
    result = this.descriptor.getObjectBuilder().createRecord(size, session);
  }
  for (int index = 0; index < size; index++) {
    DatabaseField fkField = this.sourceForeignKeyFields.get(index);
    if (object == null) {
      result.add(fkField, null);
    } else {
      DatabaseField pkField = this.sourceForeignKeysToTargetKeys.get(fkField);
      Object value = this.referenceDescriptor.getObjectBuilder().extractValueFromObjectForField(object, pkField, session);
      result.add(fkField, value);
    }
  }
  return result;
}
org.eclipse.persistence.eis.mappingsEISOneToManyMappinggetForeignKeyGroupingElement

Javadoc

Get the grouping element field on the mapping. This is an optional setting.

Popular methods of EISOneToManyMapping

  • 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,
  • getForeignKeyRows

Popular in Java

  • Creating JSON documents from java classes using gson
  • setScale (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onRequestPermissionsResult (Fragment)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • JFrame (javax.swing)
  • Best IntelliJ 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