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

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

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

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

/**
 * INTERNAL:
 * Clone the appropriate attributes.
 */
public Object clone() {
  EISOneToManyMapping clone = (EISOneToManyMapping)super.clone();
  clone.setSourceForeignKeysToTargetKeys((Map)((HashMap)getSourceForeignKeysToTargetKeys()).clone());
  return clone;
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Clone the appropriate attributes.
 */
@Override
public Object clone() {
  EISOneToManyMapping clone = (EISOneToManyMapping)super.clone();
  clone.setSourceForeignKeysToTargetKeys((Map)((HashMap)getSourceForeignKeysToTargetKeys()).clone());
  return clone;
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * Clone the appropriate attributes.
 */
@Override
public Object clone() {
  EISOneToManyMapping clone = (EISOneToManyMapping)super.clone();
  clone.setSourceForeignKeysToTargetKeys((Map)((HashMap)getSourceForeignKeysToTargetKeys()).clone());
  return clone;
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Selection criteria is created with source foreign keys and target keys.
 * This criteria is then used to read target records from the table.
 *
 * CR#3922 - This method is almost the same as buildSelectionCriteria() the difference
 * is that getSelectionCriteria() is called
 */
protected void initializeSelectionCriteria(AbstractSession session) {
  if (this.getSourceForeignKeysToTargetKeys().isEmpty()) {
    throw DescriptorException.noForeignKeysAreSpecified(this);
  }
  Expression criteria;
  Expression builder = new ExpressionBuilder();
  Iterator keyIterator = getSourceForeignKeysToTargetKeys().keySet().iterator();
  while (keyIterator.hasNext()) {
    DatabaseField foreignKey = (DatabaseField)keyIterator.next();
    DatabaseField targetKey = getSourceForeignKeysToTargetKeys().get(foreignKey);
    Expression expression = builder.getField(targetKey).equal(builder.getParameter(foreignKey));
    criteria = expression.and(getSelectionCriteria());
    setSelectionCriteria(criteria);
  }
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * Selection criteria is created with source foreign keys and target keys.
 * This criteria is then used to read target records from the table.
 *
 * CR#3922 - This method is almost the same as buildSelectionCriteria() the difference
 * is that getSelectionCriteria() is called
 */
protected void initializeSelectionCriteria(AbstractSession session) {
  if (this.getSourceForeignKeysToTargetKeys().isEmpty()) {
    throw DescriptorException.noForeignKeysAreSpecified(this);
  }
  Expression criteria;
  Expression builder = new ExpressionBuilder();
  Iterator keyIterator = getSourceForeignKeysToTargetKeys().keySet().iterator();
  while (keyIterator.hasNext()) {
    DatabaseField foreignKey = (DatabaseField)keyIterator.next();
    DatabaseField targetKey = getSourceForeignKeysToTargetKeys().get(foreignKey);
    Expression expression = builder.getField(targetKey).equal(builder.getParameter(foreignKey));
    criteria = expression.and(getSelectionCriteria());
    setSelectionCriteria(criteria);
  }
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

protected void initializeSourceForeignKeysToTargetKeys() throws DescriptorException {
  // Since we require a custom selection query, these keys are optional.
  if (getSourceForeignKeyFields().size() != getTargetForeignKeyFields().size()) {
    throw DescriptorException.sizeMismatchOfForeignKeys(this);
  }
  for (int i = 0; i < getTargetForeignKeyFields().size(); i++) {
    DatabaseField field = getReferenceDescriptor().buildField(getTargetForeignKeyFields().get(i));
    getTargetForeignKeyFields().set(i, field);
  }
  for (int i = 0; i < getSourceForeignKeyFields().size(); i++) {
    DatabaseField field = getDescriptor().buildField(getSourceForeignKeyFields().get(i));
    getSourceForeignKeyFields().set(i, field);
    getSourceForeignKeysToTargetKeys().put(field, getTargetForeignKeyFields().get(i));
  }
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

protected void initializeSourceForeignKeysToTargetKeys() throws DescriptorException {
  // Since we require a custom selection query, these keys are optional.
  if (getSourceForeignKeyFields().size() != getTargetForeignKeyFields().size()) {
    throw DescriptorException.sizeMismatchOfForeignKeys(this);
  }
  for (int i = 0; i < getTargetForeignKeyFields().size(); i++) {
    DatabaseField field = getReferenceDescriptor().buildField((DatabaseField)getTargetForeignKeyFields().get(i));
    getTargetForeignKeyFields().set(i, field);
  }
  for (int i = 0; i < getSourceForeignKeyFields().size(); i++) {
    DatabaseField field = getReferenceDescriptor().buildField((DatabaseField)getSourceForeignKeyFields().get(i));
    getSourceForeignKeyFields().set(i, field);
    getSourceForeignKeysToTargetKeys().put(field, getTargetForeignKeyFields().get(i));
  }
}
origin: com.haulmont.thirdparty/eclipselink

protected void initializeSourceForeignKeysToTargetKeys() throws DescriptorException {
  // Since we require a custom selection query, these keys are optional.
  if (getSourceForeignKeyFields().size() != getTargetForeignKeyFields().size()) {
    throw DescriptorException.sizeMismatchOfForeignKeys(this);
  }
  for (int i = 0; i < getTargetForeignKeyFields().size(); i++) {
    DatabaseField field = getReferenceDescriptor().buildField(getTargetForeignKeyFields().get(i));
    getTargetForeignKeyFields().set(i, field);
  }
  for (int i = 0; i < getSourceForeignKeyFields().size(); i++) {
    DatabaseField field = getDescriptor().buildField(getSourceForeignKeyFields().get(i));
    getSourceForeignKeyFields().set(i, field);
    getSourceForeignKeysToTargetKeys().put(field, getTargetForeignKeyFields().get(i));
  }
}
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: com.haulmont.thirdparty/eclipselink

if (((getSourceForeignKeysToTargetKeys()) == null) || (getSourceForeignKeysToTargetKeys().size() == 0)) {
  return;
} else {
  DatabaseField singleField = getSourceForeignKeyFields().get(0);
  DatabaseField pkField = getSourceForeignKeysToTargetKeys().get(singleField);
  List foreignKeys = new ArrayList(cp.sizeFor(attributeValue));
  for (Object iter = cp.iteratorFor(attributeValue); cp.hasNext(iter);) {
origin: org.eclipse.persistence/org.eclipse.persistence.core

if (((getSourceForeignKeysToTargetKeys()) == null) || (getSourceForeignKeysToTargetKeys().size() == 0)) {
  return;
} else {
  DatabaseField singleField = getSourceForeignKeyFields().get(0);
  DatabaseField pkField = getSourceForeignKeysToTargetKeys().get(singleField);
  List foreignKeys = new ArrayList(cp.sizeFor(attributeValue));
  for (Object iter = cp.iteratorFor(attributeValue); cp.hasNext(iter);) {
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

if (((getSourceForeignKeysToTargetKeys()) == null) || (getSourceForeignKeysToTargetKeys().size() == 0)) {
  return;
} else {
  DatabaseField singleField = (DatabaseField)getSourceForeignKeyFields().get(0);
  DatabaseField pkField = (DatabaseField)getSourceForeignKeysToTargetKeys().get(singleField);
  for (Object iter = cp.iteratorFor(attributeValue); cp.hasNext(iter);) {
    Object singleValue = getReferenceDescriptor().getObjectBuilder().extractValueFromObjectForField(cp.next(iter, session), pkField, session);
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: 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: 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();
}
org.eclipse.persistence.eis.mappingsEISOneToManyMappinggetSourceForeignKeysToTargetKeys

Javadoc

INTERNAL: Sets the target foreign key fields.

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

Popular in Java

  • Reactive rest calls using spring rest template
  • onRequestPermissionsResult (Fragment)
  • notifyDataSetChanged (ArrayAdapter)
  • findViewById (Activity)
  • Menu (java.awt)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top plugins for WebStorm
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