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

How to use
DatasourcePlatform
in
org.eclipse.persistence.internal.databaseaccess

Best Java code snippets using org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform (Showing top 20 results out of 315)

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

/**
 * PUBLIC:
 * Return the datasource platform specific information.
 * This allows EclipseLink to configure certain advanced features for the datasource desired.
 */
@Override
public Platform getDatasourcePlatform() {
  if (this.platform == null) {
    this.platform = new DatasourcePlatform();
  }
  return platform;
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * Get default sequence
 */
@Override
public Sequence getDefaultSequence() {
  if (!hasDefaultSequence()) {
    setDefaultSequence(createPlatformDefaultSequence());
  }
  return defaultSequence;
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * Copy the state into the new platform.
 */
@Override
public void copyInto(Platform platform) {
  if (!(platform instanceof DatasourcePlatform)) {
    return;
  }
  DatasourcePlatform datasourcePlatform = (DatasourcePlatform)platform;
  datasourcePlatform.setTableQualifier(getTableQualifier());
  datasourcePlatform.setTimestampQuery(this.timestampQuery);
  datasourcePlatform.setConversionManager(getConversionManager());
  if (hasDefaultSequence()) {
    datasourcePlatform.setDefaultSequence(getDefaultSequence());
  }
  datasourcePlatform.setSequences(getSequences());
  datasourcePlatform.sequencesAfterCloneCleanup();
  datasourcePlatform.setDefaultNativeSequenceToTable(getDefaultNativeSequenceToTable());
  datasourcePlatform.setDefaultSeqenceAtNextValue(getDefaultSeqenceAtNextValue());
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Used only for writing into XML or Java.
 */
@Override
public Sequence getDefaultSequenceToWrite() {
  if (usesPlatformDefaultSequence()) {
    return null;
  } else {
    return getDefaultSequence();
  }
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * Returns this fields name with database delimiters if useDelimiters is true.
 * This method should be called any time the field name is requested for writing SQL.
 */
public String getNameDelimited(DatasourcePlatform platform) {
  if (this.useDelimiters){
    return platform.getStartDelimiter() + this.name + platform.getEndDelimiter();
  }
  return this.name;
}
 
origin: com.haulmont.thirdparty/eclipselink

/**
 * Copy the state into the new platform.
 */
public void copyInto(Platform platform) {
  if (!(platform instanceof DatasourcePlatform)) {
    return;
  }
  DatasourcePlatform datasourcePlatform = (DatasourcePlatform)platform;
  datasourcePlatform.setTableQualifier(getTableQualifier());
  datasourcePlatform.setTimestampQuery(this.timestampQuery);
  datasourcePlatform.setConversionManager(getConversionManager());
  if (hasDefaultSequence()) {
    datasourcePlatform.setDefaultSequence(getDefaultSequence());
  }
  datasourcePlatform.setSequences(getSequences());
  datasourcePlatform.sequencesAfterCloneCleanup();
  datasourcePlatform.defaultNativeSequenceToTable = this.defaultNativeSequenceToTable;
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * Adds descriptors plus sequencing info found on the project to the session.
 */
protected void addProjectToSession(ServerSession session, Project project) {
  DatasourcePlatform sessionPlatform = (DatasourcePlatform)session.getDatasourceLogin().getDatasourcePlatform();
  DatasourcePlatform projectPlatform = (DatasourcePlatform)project.getDatasourceLogin().getDatasourcePlatform();
  if (!sessionPlatform.hasDefaultSequence() && projectPlatform.hasDefaultSequence()) {
    sessionPlatform.setDefaultSequence(projectPlatform.getDefaultSequence());
  }
  if ((sessionPlatform.getSequences() == null) || sessionPlatform.getSequences().isEmpty()) {
    if ((projectPlatform.getSequences() != null) && !projectPlatform.getSequences().isEmpty()) {
      sessionPlatform.setSequences(projectPlatform.getSequences());
    }
  } else {
    if ((projectPlatform.getSequences() != null) && !projectPlatform.getSequences().isEmpty()) {
      Iterator itProjectSequences = projectPlatform.getSequences().values().iterator();
      while (itProjectSequences.hasNext()) {
        Sequence sequence = (Sequence)itProjectSequences.next();
        if (!sessionPlatform.getSequences().containsKey(sequence.getName())) {
          sessionPlatform.addSequence(sequence);
        }
      }
    }
  }
  session.addDescriptors(project);
}

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

/**
 * INTERNAL:
 * Indicates whether defaultSequence is the same as platform default sequence.
 */
public boolean usesPlatformDefaultSequence() {
  if (!hasDefaultSequence()) {
    return true;
  } else {
    return getDefaultSequence().equals(createPlatformDefaultSequence());
  }
}
 
origin: com.haulmont.thirdparty/eclipselink

/**
 * Get sequence corresponding to the name
 */
public Sequence getSequence(String seqName) {
  if (seqName == null) {
    return getDefaultSequence();
  } else {
    if (this.sequences != null) {
      return (Sequence)this.sequences.get(seqName);
    } else {
      return null;
    }
  }
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * PUBLIC:
 * Return the list of Classes that can be converted to from the passed in javaClass.
 * @param javaClass - the class that is converted from
 * @return - a vector of classes
 */
public Vector getDataTypesConvertedFrom(Class javaClass) {
  return getConversionManager().getDataTypesConvertedFrom(javaClass);
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * Get sequence corresponding to the name
 */
public Sequence getSequence(String seqName) {
  if (seqName == null) {
    return getDefaultSequence();
  } else {
    if (getSequences() != null) {
      return (Sequence)getSequences().get(seqName);
    } else {
      return null;
    }
  }
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * Set default sequence. In case the passed sequence is of type DefaultSequence - use platformDefaultSequence
 * with name and size of the passed sequence.
 */
public void setDefaultSequence(Sequence sequence) {
  if (sequence instanceof DefaultSequence) {
    Sequence platformDefaultSequence = createPlatformDefaultSequence();
    if (platformDefaultSequence != null) {
      platformDefaultSequence.setName(sequence.getName());
      if (((DefaultSequence)sequence).hasPreallocationSize()) {
        platformDefaultSequence.setPreallocationSize(sequence.getPreallocationSize());
      }
    }
    defaultSequence = platformDefaultSequence;
  } else {
    defaultSequence = sequence;
  }
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * This method determines if any special processing needs to occur prior to writing a field.
 * 
 * It does things such as determining if a field must be bound and flagging the parameter as one
 * that must be bound.
 */
public Object getCustomModifyValueForCall(Call call, Object value, DatabaseField field, boolean shouldBind) {
  
  if (typeConverters != null){
    StructConverter converter = typeConverters.get(field.getType());
    
    if (converter != null) {
      Object bindValue = value;
      if (bindValue == null) {
        bindValue = new ObjectRelationalDatabaseField(field);
        ((ObjectRelationalDatabaseField)bindValue).setSqlType(java.sql.Types.STRUCT);
        ((ObjectRelationalDatabaseField)bindValue).setSqlTypeName(converter.getStructName());
      }
      return new BindCallCustomParameter(bindValue);
    }
  }
  return super.getCustomModifyValueForCall(call, value, field, shouldBind);
}
 
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * Add the parameter.
 * Convert the parameter to a string and write it.
 * Convert rows to XML strings.
 */
public void appendParameter(Call call, Writer writer, Object parameter) {
  if (parameter instanceof Vector) {
    Vector records = (Vector)parameter;
    // May be a collection of record.
    for (int index = 0; index < records.size(); index++) {
      appendParameter(call, writer, (records).elementAt(index));
    }
  } else if (parameter instanceof org.eclipse.persistence.oxm.record.DOMRecord) {
    String xml = ((org.eclipse.persistence.oxm.record.DOMRecord)parameter).transformToXML();
    // For some reason the transform always prints the XML header, so trim it off.
    int start = xml.indexOf('>');
    xml = xml.substring(start + 1, xml.length());
    try {
      writer.write(xml);
    } catch (IOException exception) {
      throw ValidationException.fileError(exception);
    }
  } else {
    super.appendParameter(call, writer, parameter);
  }
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * Copy the state into the new platform.
 */
public void copyInto(Platform platform) {
  super.copyInto(platform);
  if (!(platform instanceof DatabasePlatform)) {
    return;
  }
  DatabasePlatform databasePlatform = (DatabasePlatform)platform;
  databasePlatform.setShouldTrimStrings(shouldTrimStrings());
  databasePlatform.setUsesNativeSQL(usesNativeSQL());
  databasePlatform.setUsesByteArrayBinding(usesByteArrayBinding());
  databasePlatform.setUsesStringBinding(usesStringBinding());
  databasePlatform.setShouldBindAllParameters(shouldBindAllParameters());
  databasePlatform.setShouldCacheAllStatements(shouldCacheAllStatements());
  databasePlatform.setStatementCacheSize(getStatementCacheSize());
  databasePlatform.setTransactionIsolation(getTransactionIsolation());
  databasePlatform.setMaxBatchWritingSize(getMaxBatchWritingSize());
  databasePlatform.setShouldForceFieldNamesToUpperCase(shouldForceFieldNamesToUpperCase());
  databasePlatform.setShouldOptimizeDataConversion(shouldOptimizeDataConversion());
  databasePlatform.setStringBindingSize(getStringBindingSize());
  databasePlatform.setUsesBatchWriting(usesBatchWriting());
  databasePlatform.setUsesJDBCBatchWriting(usesJDBCBatchWriting());
  databasePlatform.setUsesNativeBatchWriting(usesNativeBatchWriting());
  databasePlatform.setUsesStreamsForBinding(usesStreamsForBinding());
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

  newCustomizer = platform.createConnectionCustomizer(this, session);
} else {
  newCustomizer = ((DatasourcePlatform)session.getDatasourcePlatform()).createConnectionCustomizer(this, session);
  newCustomizer = platform.createConnectionCustomizer(this, session);
} else {
  newCustomizer = ((DatasourcePlatform)session.getDatasourcePlatform()).createConnectionCustomizer(this, session);
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

addOperator(ExpressionOperator.equalOuterJoin());
addOperator(ExpressionOperator.toUpperCase());
addOperator(ExpressionOperator.toLowerCase());
addOperator(ExpressionOperator.chr());
addOperator(ExpressionOperator.concat());
addOperator(ExpressionOperator.hexToRaw());
addOperator(ExpressionOperator.initcap());
addOperator(ExpressionOperator.instring());
addOperator(ExpressionOperator.soundex());
addOperator(ExpressionOperator.leftPad());
addOperator(ExpressionOperator.leftTrim());
addOperator(ExpressionOperator.leftTrim2());
addOperator(ExpressionOperator.replace());
addOperator(ExpressionOperator.rightPad());
addOperator(ExpressionOperator.rightTrim());
addOperator(ExpressionOperator.rightTrim2());
addOperator(ExpressionOperator.substring());
addOperator(ExpressionOperator.substringSingleArg());
addOperator(ExpressionOperator.toNumber());
addOperator(ExpressionOperator.toChar());
addOperator(ExpressionOperator.toCharWithFormat());
addOperator(ExpressionOperator.translate());
addOperator(ExpressionOperator.trim());
addOperator(ExpressionOperator.trim2());
addOperator(ExpressionOperator.ascii());
addOperator(ExpressionOperator.length());
addOperator(ExpressionOperator.locate());
addOperator(ExpressionOperator.locate2());
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * Copy the state into the new platform.
 */
public void copyInto(Platform platform) {
  if (!(platform instanceof DatasourcePlatform)) {
    return;
  }
  DatasourcePlatform datasourcePlatform = (DatasourcePlatform)platform;
  datasourcePlatform.setTableQualifier(getTableQualifier());
  datasourcePlatform.setTimestampQuery(this.timestampQuery);
  datasourcePlatform.setConversionManager(getConversionManager());
  if (hasDefaultSequence()) {
    datasourcePlatform.setDefaultSequence(getDefaultSequence());
  }
  datasourcePlatform.setSequences(getSequences());
  datasourcePlatform.sequencesAfterCloneCleanup();
}
origin: com.haulmont.thirdparty/eclipselink

/** 
 * Get method for table name.
 */
public String getNameDelimited(DatasourcePlatform platform) {
  if (useDelimiters){
    return platform.getStartDelimiter() + name + platform.getEndDelimiter();
  }
  return name;
}
origin: com.haulmont.thirdparty/eclipselink

protected void sequencesAfterCloneCleanup() {
  Sequence defaultSequenceClone = null;
  if (hasDefaultSequence()) {
    defaultSequenceClone = (Sequence)getDefaultSequence().clone();
    setDefaultSequence(defaultSequenceClone);
  }
  if (getSequences() != null) {
    HashMap sequencesCopy = new HashMap(getSequences());
    HashMap sequencesDeepClone = new HashMap(getSequences().size());
    Iterator it = sequencesCopy.values().iterator();
    while (it.hasNext()) {
      Sequence sequence = (Sequence)it.next();
      if ((defaultSequenceClone != null) && (sequence == getDefaultSequence())) {
        sequencesDeepClone.put(defaultSequenceClone.getName(), defaultSequenceClone);
      } else {
        Sequence sequenceClone = (Sequence)sequence.clone();
        if (sequenceClone instanceof DefaultSequence) {
          if (!((DefaultSequence)sequenceClone).hasPreallocationSize()) {
            continue;
          }
        }
        sequencesDeepClone.put(sequenceClone.getName(), sequenceClone);
      }
    }
    this.setSequences(sequencesDeepClone);
  }
}
org.eclipse.persistence.internal.databaseaccessDatasourcePlatform

Javadoc

DatasourcePlatform is private to TopLink. It encapsulates behavior specific to a datasource platform (eg. Oracle, Sybase, DB2, Attunity, MQSeries), and provides protocol for TopLink to access this behavior.

Most used methods

  • <init>
  • addOperator
  • appendParameter
    Add the parameter. Convert the parameter to a string and write it.
  • copyInto
    Copy the state into the new platform.
  • createConnectionCustomizer
    INTERNAL:
  • createPlatformDefaultSequence
    INTERNAL: Create platform-default Sequence
  • getConversionManager
    The platform hold its own instance of conversion manager to allow customization.
  • getCustomModifyValueForCall
    Allow for the platform to handle the representation of parameters specially.
  • getDefaultSequence
    Get default sequence
  • getEndDelimiter
    Delimiter to use for fields and tables using spaces or other special values. Some databases use diff
  • getPlatformOperators
    Return any platform-specific operators
  • getSequencePreallocationSize
  • getPlatformOperators,
  • getSequencePreallocationSize,
  • getSequences,
  • getStartDelimiter,
  • getTableQualifier,
  • getTimestampQuery,
  • hasDefaultSequence,
  • initializePlatformOperators,
  • sequencesAfterCloneCleanup,
  • setConversionManager

Popular in Java

  • Making http post requests using okhttp
  • setScale (BigDecimal)
  • onCreateOptionsMenu (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Top 12 Jupyter Notebook extensions
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