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

How to use
getDescriptor
method
in
org.eclipse.persistence.descriptors.ReturningPolicy

Best Java code snippets using org.eclipse.persistence.descriptors.ReturningPolicy.getDescriptor (Showing top 18 results out of 315)

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

protected void initializeIsUsedToSetPrimaryKey() {
  this.isUsedToSetPrimaryKey = false;
  if ((main[INSERT][MAPPED] == null) || main[INSERT][MAPPED].isEmpty()) {
    return;
  }
  List primaryKeys = getDescriptor().getPrimaryKeyFields();
  for (int index = 0; (index < primaryKeys.size()) && !isUsedToSetPrimaryKey; index++) {
    this.isUsedToSetPrimaryKey = main[INSERT][MAPPED].contains(primaryKeys.get(index));
  }
}
origin: com.haulmont.thirdparty/eclipselink

protected void initializeIsUsedToSetPrimaryKey() {
  this.isUsedToSetPrimaryKey = false;
  if ((main[INSERT][MAPPED] == null) || main[INSERT][MAPPED].isEmpty()) {
    return;
  }
  List primaryKeys = getDescriptor().getPrimaryKeyFields();
  for (int index = 0; (index < primaryKeys.size()) && !isUsedToSetPrimaryKey; index++) {
    this.isUsedToSetPrimaryKey = main[INSERT][MAPPED].contains(primaryKeys.get(index));
  }
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

protected void initializeIsUsedToSetPrimaryKey() {
  isUsedToSetPrimaryKey = false;
  if ((main[INSERT][MAPPED] == null) || main[INSERT][MAPPED].isEmpty()) {
    return;
  }
  List primaryKeys = getDescriptor().getPrimaryKeyFields();
  for (int index = 0; (index < primaryKeys.size()) && !isUsedToSetPrimaryKey; index++) {
    isUsedToSetPrimaryKey = main[INSERT][MAPPED].contains(primaryKeys.get(index));
  }
}
origin: com.haulmont.thirdparty/eclipselink

protected boolean verifyFieldAndMapping(AbstractSession session, DatabaseField field) {
  boolean ok = true;
  verifyField(session, field, getDescriptor());
  DatabaseMapping mapping;
  List readOnlyMappings = getDescriptor().getObjectBuilder().getReadOnlyMappingsForField(field);
  if (readOnlyMappings != null) {
    for (int j = 0; j < readOnlyMappings.size(); j++) {
      mapping = (DatabaseMapping)readOnlyMappings.get(j);
      ok &= verifyFieldAndMapping(session, field, getDescriptor(), mapping);
    }
  }
  mapping = getDescriptor().getObjectBuilder().getMappingForField(field);
  if (mapping != null) {
    ok &= verifyFieldAndMapping(session, field, getDescriptor(), mapping);
  }
  return ok;
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

protected boolean verifyFieldAndMapping(AbstractSession session, DatabaseField field) {
  boolean ok = true;
  verifyField(session, field, getDescriptor());
  DatabaseMapping mapping;
  List readOnlyMappings = getDescriptor().getObjectBuilder().getReadOnlyMappingsForField(field);
  if (readOnlyMappings != null) {
    for (int j = 0; j < readOnlyMappings.size(); j++) {
      mapping = (DatabaseMapping)readOnlyMappings.get(j);
      ok &= verifyFieldAndMapping(session, field, getDescriptor(), mapping);
    }
  }
  mapping = getDescriptor().getObjectBuilder().getMappingForField(field);
  if (mapping != null) {
    ok &= verifyFieldAndMapping(session, field, getDescriptor(), mapping);
  }
  return ok;
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

protected boolean verifyFieldAndMapping(AbstractSession session, DatabaseField field) {
  boolean ok = true;
  verifyField(session, field, getDescriptor());
  DatabaseMapping mapping;
  List readOnlyMappings = getDescriptor().getObjectBuilder().getReadOnlyMappingsForField(field);
  if (readOnlyMappings != null) {
    for (int j = 0; j < readOnlyMappings.size(); j++) {
      mapping = (DatabaseMapping)readOnlyMappings.get(j);
      ok &= verifyFieldAndMapping(session, field, getDescriptor(), mapping);
    }
  }
  mapping = getDescriptor().getObjectBuilder().getMappingForField(field);
  if (mapping != null) {
    ok &= verifyFieldAndMapping(session, field, getDescriptor(), mapping);
  }
  return ok;
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 */
protected void fieldIsNotFromDescriptor(DatabaseField field) {
  if (field.getTable().equals(getDescriptor().getDefaultTable())) {
    if (this.fieldsNotFromDescriptor_DefaultTable == null) {
      this.fieldsNotFromDescriptor_DefaultTable = new HashMap();
    }
    this.fieldsNotFromDescriptor_DefaultTable.put(field, field);
  } else {
    if (this.fieldsNotFromDescriptor_OtherTables == null) {
      this.fieldsNotFromDescriptor_OtherTables = new HashMap();
    }
    this.fieldsNotFromDescriptor_OtherTables.put(field, field);
  }
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 */
protected void fieldIsNotFromDescriptor(DatabaseField field) {
  if (field.getTable().equals(getDescriptor().getDefaultTable())) {
    if (fieldsNotFromDescriptor_DefaultTable == null) {
      fieldsNotFromDescriptor_DefaultTable = new HashMap();
    }
    fieldsNotFromDescriptor_DefaultTable.put(field, field);
  } else {
    if (fieldsNotFromDescriptor_OtherTables == null) {
      fieldsNotFromDescriptor_OtherTables = new HashMap();
    }
    fieldsNotFromDescriptor_OtherTables.put(field, field);
  }
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 */
protected void fieldIsNotFromDescriptor(DatabaseField field) {
  if (field.getTable().equals(getDescriptor().getDefaultTable())) {
    if (this.fieldsNotFromDescriptor_DefaultTable == null) {
      this.fieldsNotFromDescriptor_DefaultTable = new HashMap();
    }
    this.fieldsNotFromDescriptor_DefaultTable.put(field, field);
  } else {
    if (this.fieldsNotFromDescriptor_OtherTables == null) {
      this.fieldsNotFromDescriptor_OtherTables = new HashMap();
    }
    this.fieldsNotFromDescriptor_OtherTables.put(field, field);
  }
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

  for (Enumeration fields = getDescriptor().getFields().elements();
       fields.hasMoreElements();) {
    DatabaseField fieldInDescriptor = (DatabaseField)fields.nextElement();
    if (fieldInMain != null) {
      if (fieldInMain.getType() == null) {
        if (getDescriptor().isReturnTypeRequiredForReturningPolicy()) {
          session.getIntegrityChecker().handleError(DescriptorException.returningPolicyMappedFieldTypeNotSet(fieldInMain.getName(), getDescriptor()));
        session.getIntegrityChecker().handleError(DescriptorException.returningPolicyAndDescriptorFieldTypeConflict(fieldInMain.getName(), fieldInMain.getType().getName(), fieldInDescriptor.getType().getName(), getDescriptor()));
WriteObjectQuery[] query = { getDescriptor().getQueryManager().getInsertQuery(), getDescriptor().getQueryManager().getUpdateQuery() };
String[] queryTypeName = { "InsertObjectQuery", "UpdateObjectQuery" };
for (int operation = INSERT; operation <= UPDATE; operation++) {
        session.getIntegrityChecker().handleError(DescriptorException.noCustomQueryForReturningPolicy(queryTypeName[operation], Helper.getShortClassName(session.getPlatform()), getDescriptor()));
        while (it.hasNext()) {
          DatabaseField field = (DatabaseField)it.next();
          session.getIntegrityChecker().handleError(DescriptorException.customQueryAndReturningPolicyFieldConflict(field.getName(), queryTypeName[operation], getDescriptor()));
origin: com.haulmont.thirdparty/eclipselink

if (getDescriptor().isChildDescriptor()) {
  ClassDescriptor parentDescriptor = getDescriptor().getInheritancePolicy().getParentDescriptor();
  if (parentDescriptor.hasReturningPolicy()) {
    copyMainFrom(parentDescriptor.getReturningPolicy());
  Hashtable infoHashtable = removeDuplicateAndValidateInfos(session);
  Hashtable infoHashtableUnmapped = (Hashtable)infoHashtable.clone();
  for (Enumeration fields = getDescriptor().getFields().elements();
       fields.hasMoreElements();) {
    DatabaseField field = (DatabaseField)fields.nextElement();
      DatabaseField field = (DatabaseField)fields.nextElement();
      Info info = (Info)infoHashtableUnmapped.get(field);
      if (verifyField(session, field, getDescriptor())) {
        if (field.getType() != null) {
          addUnmappedFieldToMain(field, info);
          fieldIsNotFromDescriptor(field);
          session.log(SessionLog.FINEST, SessionLog.QUERY, "added_unmapped_field_to_returning_policy", info.toString(), getDescriptor().getJavaClassName());
        } else {
          if (getDescriptor().isReturnTypeRequiredForReturningPolicy()) {
            session.getIntegrityChecker().handleError(DescriptorException.returningPolicyUnmappedFieldTypeNotSet(field.getName(), getDescriptor()));
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

if (getDescriptor().isChildDescriptor()) {
  ClassDescriptor parentDescriptor = getDescriptor().getInheritancePolicy().getParentDescriptor();
  if (parentDescriptor.hasReturningPolicy()) {
    copyMainFrom(parentDescriptor.getReturningPolicy());
  Hashtable infoHashtable = removeDuplicateAndValidateInfos(session);
  Hashtable infoHashtableUnmapped = (Hashtable)infoHashtable.clone();
  for (Enumeration fields = getDescriptor().getFields().elements();
       fields.hasMoreElements();) {
    DatabaseField field = (DatabaseField)fields.nextElement();
      DatabaseField field = (DatabaseField)fields.nextElement();
      Info info = (Info)infoHashtableUnmapped.get(field);
      if (verifyField(session, field, getDescriptor())) {
        if (field.getType() != null) {
          addUnmappedFieldToMain(field, info);
          fieldIsNotFromDescriptor(field);
          session.log(SessionLog.FINEST, SessionLog.QUERY, "added_unmapped_field_to_returning_policy", info.toString(), getDescriptor().getJavaClassName());
        } else {
          if (getDescriptor().isReturnTypeRequiredForReturningPolicy()) {
            session.getIntegrityChecker().handleError(DescriptorException.returningPolicyUnmappedFieldTypeNotSet(field.getName(), getDescriptor()));
origin: com.haulmont.thirdparty/eclipselink

protected Hashtable removeDuplicateAndValidateInfos(AbstractSession session) {
  Hashtable infoHashtable = new Hashtable();
  for (int i = 0; i < infos.size(); i++) {
    Info info1 = infos.get(i);
    info1 = (Info)info1.clone();
    DatabaseField descField = getDescriptor().buildField(info1.getField()); 
    if(info1.getField().getType() == null) {
      info1.setField(descField);
    } else {
      // keep the original type if specified
      info1.getField().setName(descField.getName()); 
      info1.getField().setTableName(getDescriptor().getDefaultTable().getQualifiedNameDelimited(session.getPlatform()));
    }
    Info info2 = (Info)infoHashtable.get(info1.getField());
    if (info2 == null) {
      infoHashtable.put(info1.getField(), info1);
    } else {
      Info infoMerged = mergeInfos(info1, info2, session, getDescriptor());
      if (infoMerged != null) {
        // substitute info2 with infoMerged
        infoHashtable.put(infoMerged.getField(), infoMerged);
      } else {
        // couldn't merge info1 and info2 due to a conflict.
        // substitute info2 with info1
        infoHashtable.put(info1.getField(), info1);
      }
    }
  }
  return infoHashtable;
}
origin: com.haulmont.thirdparty/eclipselink

  for (Enumeration fields = getDescriptor().getFields().elements();
       fields.hasMoreElements();) {
    DatabaseField fieldInDescriptor = (DatabaseField)fields.nextElement();
    if (fieldInMain != null) {
      if (fieldInMain.getType() == null) {
        if (getDescriptor().isReturnTypeRequiredForReturningPolicy()) {
          session.getIntegrityChecker().handleError(DescriptorException.returningPolicyMappedFieldTypeNotSet(fieldInMain.getName(), getDescriptor()));
        session.getIntegrityChecker().handleError(DescriptorException.returningPolicyAndDescriptorFieldTypeConflict(fieldInMain.getName(), fieldInMain.getType().getName(), fieldInDescriptor.getType().getName(), getDescriptor()));
WriteObjectQuery[] query = { getDescriptor().getQueryManager().getInsertQuery(), getDescriptor().getQueryManager().getUpdateQuery() };
String[] queryTypeName = { "InsertObjectQuery", "UpdateObjectQuery" };
for (int operation = INSERT; operation <= UPDATE; operation++) {
        session.getIntegrityChecker().handleError(DescriptorException.noCustomQueryForReturningPolicy(queryTypeName[operation], Helper.getShortClassName(session.getPlatform()), getDescriptor()));
        while (it.hasNext()) {
          DatabaseField field = (DatabaseField)it.next();
          session.getIntegrityChecker().handleError(DescriptorException.customQueryAndReturningPolicyFieldConflict(field.getName(), queryTypeName[operation], getDescriptor()));
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

  for (Enumeration fields = getDescriptor().getFields().elements();
       fields.hasMoreElements();) {
    DatabaseField fieldInDescriptor = (DatabaseField)fields.nextElement();
    if (fieldInMain != null) {
      if (fieldInMain.getType() == null) {
        if (getDescriptor().isReturnTypeRequiredForReturningPolicy()) {
          session.getIntegrityChecker().handleError(DescriptorException.returningPolicyMappedFieldTypeNotSet(fieldInMain.getName(), getDescriptor()));
        session.getIntegrityChecker().handleError(DescriptorException.returningPolicyAndDescriptorFieldTypeConflict(fieldInMain.getName(), fieldInMain.getType().getName(), fieldInDescriptor.getType().getName(), getDescriptor()));
WriteObjectQuery[] query = { getDescriptor().getQueryManager().getInsertQuery(), getDescriptor().getQueryManager().getUpdateQuery() };
String[] queryTypeName = { "InsertObjectQuery", "UpdateObjectQuery" };
for (int operation = INSERT; operation <= UPDATE; operation++) {
        session.getIntegrityChecker().handleError(DescriptorException.noCustomQueryForReturningPolicy(queryTypeName[operation], Helper.getShortClassName(session.getPlatform()), getDescriptor()));
        while (it.hasNext()) {
          DatabaseField field = (DatabaseField)it.next();
          session.getIntegrityChecker().handleError(DescriptorException.customQueryAndReturningPolicyFieldConflict(field.getName(), queryTypeName[operation], getDescriptor()));
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

protected Hashtable removeDuplicateAndValidateInfos(AbstractSession session) {
  Hashtable infoHashtable = new Hashtable();
  for (int i = 0; i < infos.size(); i++) {
    Info info1 = (Info)infos.elementAt(i);
    info1 = (Info)info1.clone();
    DatabaseField descField = getDescriptor().buildField(info1.getField()); 
    if(info1.getField().getType() == null) {
      info1.setField(descField);
    } else {
      // keep the original type if specified
      info1.getField().setName(descField.getName()); 
      info1.getField().setTableName(getDescriptor().getDefaultTable().getQualifiedNameDelimited(session.getPlatform()));
    }
    Info info2 = (Info)infoHashtable.get(info1.getField());
    if (info2 == null) {
      infoHashtable.put(info1.getField(), info1);
    } else {
      Info infoMerged = mergeInfos(info1, info2, session, getDescriptor());
      if (infoMerged != null) {
        // substitute info2 with infoMerged
        infoHashtable.put(infoMerged.getField(), infoMerged);
      } else {
        // couldn't merge info1 and info2 due to a conflict.
        // substitute info2 with info1
        infoHashtable.put(info1.getField(), info1);
      }
    }
  }
  return infoHashtable;
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

if (getDescriptor().isChildDescriptor()) {
  ClassDescriptor parentDescriptor = getDescriptor().getInheritancePolicy().getParentDescriptor();
  if (parentDescriptor.hasReturningPolicy()) {
    copyMainFrom(parentDescriptor.getReturningPolicy());
  Hashtable infoHashtable = removeDuplicateAndValidateInfos(session);
  Hashtable infoHashtableUnmapped = (Hashtable)infoHashtable.clone();
  for (Enumeration fields = getDescriptor().getFields().elements();
       fields.hasMoreElements();) {
    DatabaseField field = (DatabaseField)fields.nextElement();
      DatabaseField field = (DatabaseField)fields.nextElement();
      Info info = (Info)infoHashtableUnmapped.get(field);
      if (verifyField(session, field, getDescriptor())) {
        if (field.getType() != null) {
          addUnmappedFieldToMain(field, info);
          fieldIsNotFromDescriptor(field);
          session.log(SessionLog.FINEST, SessionLog.QUERY, "added_unmapped_field_to_returning_policy", info.toString(), getDescriptor().getJavaClassName());
        } else {
          if (getDescriptor().isReturnTypeRequiredForReturningPolicy()) {
            session.getIntegrityChecker().handleError(DescriptorException.returningPolicyUnmappedFieldTypeNotSet(field.getName(), getDescriptor()));
origin: org.eclipse.persistence/org.eclipse.persistence.core

protected Hashtable removeDuplicateAndValidateInfos(AbstractSession session) {
  Hashtable infoHashtable = new Hashtable();
  for (int i = 0; i < infos.size(); i++) {
    Info info1 = infos.get(i);
    info1 = (Info)info1.clone();
    DatabaseField descField = getDescriptor().buildField(info1.getField());
    if(info1.getField().getType() == null) {
      info1.setField(descField);
    } else {
      // keep the original type if specified
      info1.getField().setName(descField.getName());
      info1.getField().setTableName(getDescriptor().getDefaultTable().getQualifiedNameDelimited(session.getPlatform()));
    }
    Info info2 = (Info)infoHashtable.get(info1.getField());
    if (info2 == null) {
      infoHashtable.put(info1.getField(), info1);
    } else {
      Info infoMerged = mergeInfos(info1, info2, session, getDescriptor());
      if (infoMerged != null) {
        // substitute info2 with infoMerged
        infoHashtable.put(infoMerged.getField(), infoMerged);
      } else {
        // couldn't merge info1 and info2 due to a conflict.
        // substitute info2 with info1
        infoHashtable.put(info1.getField(), info1);
      }
    }
  }
  return infoHashtable;
}
org.eclipse.persistence.descriptorsReturningPolicygetDescriptor

Javadoc

PUBLIC: Return the owner of the policy.

Popular methods of ReturningPolicy

  • <init>
  • addCollectionToMain
  • addField
    INTERNAL:
  • addFieldForInsert
    PUBLIC:
  • addFieldForInsertReturnOnly
    PUBLIC:
  • addFieldForUpdate
    PUBLIC:
  • addFieldToMain
  • addMappedFieldToMain
  • addUnmappedFieldToMain
  • areCollectionsEqualAsSets
    INTERNAL: Compares two Collections as sets (ignoring the order of the elements). Note that the passe
  • clearInitialization
  • clone
    INTERNAL: Normally cloned when not yet initialized. If initialized ReturningPolicy cloned then the c
  • clearInitialization,
  • clone,
  • copyMainFrom,
  • createCollection,
  • createField,
  • fieldIsNotFromDescriptor,
  • getField,
  • getFieldInfos,
  • getFieldsToGenerateInsert

Popular in Java

  • Making http post requests using okhttp
  • getContentResolver (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • onCreateOptionsMenu (Activity)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Top 25 Plugins for Webstorm
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