Tabnine Logo
EISOneToOneMapping.getReferenceDescriptor
Code IndexAdd Tabnine to your IDE (free)

How to use
getReferenceDescriptor
method
in
org.eclipse.persistence.eis.mappings.EISOneToOneMapping

Best Java code snippets using org.eclipse.persistence.eis.mappings.EISOneToOneMapping.getReferenceDescriptor (Showing top 13 results out of 315)

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

/**
 * INTERNAL:
 * Extract the key value from the reference object.
 */
protected Vector extractKeyFromReferenceObject(Object object, AbstractSession session) {
  Vector key = new Vector();
  Iterator sourceKeyIterator = getSourceToTargetKeyFields().keySet().iterator();
  while (sourceKeyIterator.hasNext()) {
    DatabaseField field = (DatabaseField)sourceKeyIterator.next();
    if (object == null) {
      key.addElement(null);
    } else {
      key.addElement(getReferenceDescriptor().getObjectBuilder().extractValueFromObjectForField(object, field, session));
    }
  }
  return key;
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * Return the primary key for the reference object (i.e. the object
 * object referenced by domainObject and specified by mapping).
 * This key will be used by a RemoteValueHolder.
 */
public Vector extractPrimaryKeysForReferenceObjectFromRow(AbstractRecord row) {
  List primaryKeyFields = getReferenceDescriptor().getPrimaryKeyFields();
  Vector result = new Vector(primaryKeyFields.size());
  for (int index = 0; index < primaryKeyFields.size(); index++) {
    DatabaseField targetKeyField = (DatabaseField)primaryKeyFields.get(index);
    DatabaseField sourceKeyField = (DatabaseField)getTargetToSourceKeyFields().get(targetKeyField);
    if (sourceKeyField == null) {
      return new Vector(1);
    }
    result.addElement(row.get(sourceKeyField));
  }
  return result;
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * The foreign keys primary keys are stored as database fields in the hashtable.
 */
protected void initializeForeignKeys(AbstractSession session) {
  HashMap newSourceToTargetKeyFields = new HashMap(getSourceToTargetKeyFields().size());
  HashMap newTargetToSourceKeyFields = new HashMap(getTargetToSourceKeyFields().size());
  Iterator iterator = getSourceToTargetKeyFields().entrySet().iterator();
  while (iterator.hasNext()) {
    Map.Entry entry = (Map.Entry)iterator.next();
    DatabaseField sourceField = (DatabaseField)entry.getKey();
    DatabaseField targetField = (DatabaseField)entry.getValue();
    sourceField = getDescriptor().buildField(sourceField);
    targetField = getReferenceDescriptor().buildField(targetField);
    newSourceToTargetKeyFields.put(sourceField, targetField);
    newTargetToSourceKeyFields.put(targetField, sourceField);
  }
  setSourceToTargetKeyFields(newSourceToTargetKeyFields);
  setTargetToSourceKeyFields(newTargetToSourceKeyFields);
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * The foreign keys primary keys are stored as database fields in the hashtable.
 */
protected void initializeForeignKeys(AbstractSession session) {
  HashMap newSourceToTargetKeyFields = new HashMap(getSourceToTargetKeyFields().size());
  HashMap newTargetToSourceKeyFields = new HashMap(getTargetToSourceKeyFields().size());
  Iterator iterator = getSourceToTargetKeyFields().entrySet().iterator();
  while (iterator.hasNext()) {
    Map.Entry entry = (Map.Entry)iterator.next();
    DatabaseField sourceField = (DatabaseField)entry.getKey();
    DatabaseField targetField = (DatabaseField)entry.getValue();
    sourceField = getDescriptor().buildField(sourceField);
    targetField = getReferenceDescriptor().buildField(targetField);
    newSourceToTargetKeyFields.put(sourceField, targetField);
    newTargetToSourceKeyFields.put(targetField, sourceField);
  }
  setSourceToTargetKeyFields(newSourceToTargetKeyFields);
  setTargetToSourceKeyFields(newTargetToSourceKeyFields);
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * The foreign keys primary keys are stored as database fields in the hashtable.
 */
protected void initializeForeignKeys(AbstractSession session) {
  HashMap newSourceToTargetKeyFields = new HashMap(getSourceToTargetKeyFields().size());
  HashMap newTargetToSourceKeyFields = new HashMap(getTargetToSourceKeyFields().size());
  Iterator iterator = getSourceToTargetKeyFields().entrySet().iterator();
  while (iterator.hasNext()) {
    Map.Entry entry = (Map.Entry)iterator.next();
    DatabaseField sourceField = (DatabaseField)entry.getKey();
    DatabaseField targetField = (DatabaseField)entry.getValue();
    sourceField = getDescriptor().buildField(sourceField);
    targetField = getReferenceDescriptor().buildField(targetField);
    newSourceToTargetKeyFields.put(sourceField, targetField);
    newTargetToSourceKeyFields.put(targetField, sourceField);
  }
  setSourceToTargetKeyFields(newSourceToTargetKeyFields);
  setTargetToSourceKeyFields(newTargetToSourceKeyFields);
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Return the primary key for the reference object (i.e. the object
 * object referenced by domainObject and specified by mapping).
 * This key will be used by a RemoteValueHolder.
 */
@Override
public Object extractPrimaryKeysForReferenceObjectFromRow(AbstractRecord row) {
  List primaryKeyFields = getReferenceDescriptor().getPrimaryKeyFields();
  Object[] result = new  Object[primaryKeyFields.size()];
  for (int index = 0; index < primaryKeyFields.size(); index++) {
    DatabaseField targetKeyField = (DatabaseField)primaryKeyFields.get(index);
    DatabaseField sourceKeyField = getTargetToSourceKeyFields().get(targetKeyField);
    if (sourceKeyField == null) {
      return null;
    }
    result[index] = row.get(sourceKeyField);
    if (getReferenceDescriptor().getCachePolicy().getCacheKeyType() == CacheKeyType.ID_VALUE) {
      return result[index];
    }
  }
  return new CacheId(result);
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * Return the primary key for the reference object (i.e. the object
 * object referenced by domainObject and specified by mapping).
 * This key will be used by a RemoteValueHolder.
 */
@Override
public Object extractPrimaryKeysForReferenceObjectFromRow(AbstractRecord row) {
  List primaryKeyFields = getReferenceDescriptor().getPrimaryKeyFields();
  Object[] result = new  Object[primaryKeyFields.size()];
  for (int index = 0; index < primaryKeyFields.size(); index++) {
    DatabaseField targetKeyField = (DatabaseField)primaryKeyFields.get(index);
    DatabaseField sourceKeyField = getTargetToSourceKeyFields().get(targetKeyField);
    if (sourceKeyField == null) {
      return null;
    }
    result[index] = row.get(sourceKeyField);
    if (getReferenceDescriptor().getCachePolicy().getCacheKeyType() == CacheKeyType.ID_VALUE) {
      return result[index];
    }
  }
  return new CacheId(result);
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * Return the classifiction for the field contained in the mapping.
 * This is used to convert the row value to a consistent java value.
 */
public Class getFieldClassification(DatabaseField fieldToClassify) throws DescriptorException {
  DatabaseField fieldInTarget = (DatabaseField)getSourceToTargetKeyFields().get(fieldToClassify);
  if (fieldInTarget == null) {
    return null;// Can be registered as multiple table secondary field mapping
  }
  DatabaseMapping mapping = getReferenceDescriptor().getObjectBuilder().getMappingForField(fieldInTarget);
  if (mapping == null) {
    return null;// Means that the mapping is read-only
  }
  return mapping.getFieldClassification(fieldInTarget);
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Return the classifiction for the field contained in the mapping.
 * This is used to convert the row value to a consistent java value.
 */
@Override
public Class getFieldClassification(DatabaseField fieldToClassify) throws DescriptorException {
  DatabaseField fieldInTarget = getSourceToTargetKeyFields().get(fieldToClassify);
  if (fieldInTarget == null) {
    return null;// Can be registered as multiple table secondary field mapping
  }
  DatabaseMapping mapping = getReferenceDescriptor().getObjectBuilder().getMappingForField(fieldInTarget);
  if (mapping == null) {
    return null;// Means that the mapping is read-only
  }
  return mapping.getFieldClassification(fieldInTarget);
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * Return the classifiction for the field contained in the mapping.
 * This is used to convert the row value to a consistent java value.
 */
@Override
public Class getFieldClassification(DatabaseField fieldToClassify) throws DescriptorException {
  DatabaseField fieldInTarget = getSourceToTargetKeyFields().get(fieldToClassify);
  if (fieldInTarget == null) {
    return null;// Can be registered as multiple table secondary field mapping
  }
  DatabaseMapping mapping = getReferenceDescriptor().getObjectBuilder().getMappingForField(fieldInTarget);
  if (mapping == null) {
    return null;// Means that the mapping is read-only
  }
  return mapping.getFieldClassification(fieldInTarget);
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * Get a value from the object and set that in the respective field of the row.
 */
public void writeFromObjectIntoRow(Object object, AbstractRecord Record, AbstractSession session) {
  if (isReadOnly() || (!isForeignKeyRelationship())) {
    return;
  }
  AbstractRecord referenceRow = getIndirectionPolicy().extractReferenceRow(getAttributeValueFromObject(object));
  if (referenceRow == null) {
    // Extract from object.
    Object referenceObject = getRealAttributeValueFromObject(object, session);
    for (int i = 0; i < getForeignKeyFields().size(); i++) {
      DatabaseField sourceKey = getForeignKeyFields().get(i);
      DatabaseField targetKey = (DatabaseField)getSourceToTargetKeyFields().get(sourceKey);
      Object referenceValue = null;
      // If privately owned part is null then method cannot be invoked.
      if (referenceObject != null) {
        referenceValue = getReferenceDescriptor().getObjectBuilder().extractValueFromObjectForField(referenceObject, targetKey, session);
      }
      Record.add(sourceKey, referenceValue);
    }
  } else {
    for (int i = 0; i < getForeignKeyFields().size(); i++) {
      DatabaseField sourceKey = getForeignKeyFields().get(i);
      Record.add(sourceKey, referenceRow.get(sourceKey));
    }
  }
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Get a value from the object and set that in the respective field of the row.
 */
@Override
public void writeFromObjectIntoRow(Object object, AbstractRecord Record, AbstractSession session, WriteType writeType) {
  if (isReadOnly() || (!isForeignKeyRelationship())) {
    return;
  }
  AbstractRecord referenceRow = getIndirectionPolicy().extractReferenceRow(getAttributeValueFromObject(object));
  if (referenceRow == null) {
    // Extract from object.
    Object referenceObject = getRealAttributeValueFromObject(object, session);
    for (int i = 0; i < getForeignKeyFields().size(); i++) {
      DatabaseField sourceKey = getForeignKeyFields().get(i);
      DatabaseField targetKey = getSourceToTargetKeyFields().get(sourceKey);
      Object referenceValue = null;
      // If privately owned part is null then method cannot be invoked.
      if (referenceObject != null) {
        referenceValue = getReferenceDescriptor().getObjectBuilder().extractValueFromObjectForField(referenceObject, targetKey, session);
      }
      Record.add(sourceKey, referenceValue);
    }
  } else {
    for (int i = 0; i < getForeignKeyFields().size(); i++) {
      DatabaseField sourceKey = getForeignKeyFields().get(i);
      Record.add(sourceKey, referenceRow.get(sourceKey));
    }
  }
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * Get a value from the object and set that in the respective field of the row.
 */
@Override
public void writeFromObjectIntoRow(Object object, AbstractRecord Record, AbstractSession session, WriteType writeType) {
  if (isReadOnly() || (!isForeignKeyRelationship())) {
    return;
  }
  AbstractRecord referenceRow = getIndirectionPolicy().extractReferenceRow(getAttributeValueFromObject(object));
  if (referenceRow == null) {
    // Extract from object.
    Object referenceObject = getRealAttributeValueFromObject(object, session);
    for (int i = 0; i < getForeignKeyFields().size(); i++) {
      DatabaseField sourceKey = getForeignKeyFields().get(i);
      DatabaseField targetKey = getSourceToTargetKeyFields().get(sourceKey);
      Object referenceValue = null;
      // If privately owned part is null then method cannot be invoked.
      if (referenceObject != null) {
        referenceValue = getReferenceDescriptor().getObjectBuilder().extractValueFromObjectForField(referenceObject, targetKey, session);
      }
      Record.add(sourceKey, referenceValue);
    }
  } else {
    for (int i = 0; i < getForeignKeyFields().size(); i++) {
      DatabaseField sourceKey = getForeignKeyFields().get(i);
      Record.add(sourceKey, referenceRow.get(sourceKey));
    }
  }
}
org.eclipse.persistence.eis.mappingsEISOneToOneMappinggetReferenceDescriptor

Popular methods of EISOneToOneMapping

  • addForeignKeyField
    PUBLIC: Define the source foreign key relationship in the one-to-one mapping. This method is used to
  • collectFields
  • getAttributeName
  • getAttributeValueFromObject
  • getDescriptor
  • getFields
  • getForeignKeyFields
  • getIndirectionPolicy
  • getPrivateOwnedCriteria
    INTERNAL: The private owned criteria is only used outside of the unit of work to compare the previou
  • getRealAttributeValueFromObject
  • getSelectionCriteria
  • getSelectionQuery
  • getSelectionCriteria,
  • getSelectionQuery,
  • getSourceToTargetKeyFields,
  • getTargetToSourceKeyFields,
  • initializeForeignKeys,
  • initializePrivateOwnedCriteria,
  • initializeSelectionCriteria,
  • isForeignKeyRelationship,
  • isPrivateOwned

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSharedPreferences (Context)
  • getExternalFilesDir (Context)
  • runOnUiThread (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top PhpStorm 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