Package org.eclipse.persistence.eis
Class EISPlatform
- java.lang.Object
-
- org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
- org.eclipse.persistence.eis.EISPlatform
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,org.eclipse.persistence.internal.core.databaseaccess.CorePlatform<org.eclipse.persistence.internal.helper.ConversionManager>,org.eclipse.persistence.internal.databaseaccess.Platform
public class EISPlatform extends org.eclipse.persistence.internal.databaseaccess.DatasourcePlatformAn
EISPlatformdefines any EIS adapter specific behavior. This may include:- Instantiation of the adapter InteractionSpec
- Conversion from an adapter custom Record
- Perform platform specific record access
- Provide XML DOM record conversion
- Provide sequence support
EISPlatformalso supports behavior for specifying the record types supported and automatic data-conversion to strings.Although use of the generic
EISPlatformmay be sufficient, some adapters may require that a specific platform be defined.- See Also:
- Serialized Form
- Author:
- James
- Since:
- OracleAS TopLink 10g (10.0.3)
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.reflect.MethoddomMethodUsed to reflectively provide XML record support as DOMRecord is not part of the JCA-CCI spec.protected booleanisDOMRecordSupportedprotected booleanisIndexedRecordSupportedprotected booleanisMappedRecordSupportedprotected RecordConverterrecordConverterCan be used to convert from an adapter specific record.protected booleanrequiresAutoCommitCan be used if a commit is required after every interaction outside of a local transaction.protected booleanshouldConvertDataToStringsCan be used for adapters that only support String data/XML.protected booleansupportsLocalTransactionsAllows for usage of transaction to be disabled if not supported.protected org.eclipse.persistence.internal.oxm.XMLConversionManagerxmlConversionManagerFor XML usage, an XMLConversionManager instance is required-
Fields inherited from class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
conversionManager, dataTypesConvertedFromAClass, dataTypesConvertedToAClass, defaultNativeSequenceToTable, defaultSeqenceAtNextValue, defaultSequence, endDelimiter, platformOperators, sequences, sequencesLock, startDelimiter, supportsReturnGeneratedKeys, tableQualifier, timestampQuery
-
-
Constructor Summary
Constructors Constructor Description EISPlatform()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendParameter(Call call, java.io.Writer writer, java.lang.Object parameter)Add the parameter.org.eclipse.persistence.internal.databaseaccess.DatasourceCallbuildCallFromStatement(org.eclipse.persistence.internal.expressions.SQLStatement statement, DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Override this method to throw an exception by default.javax.resource.cci.InteractionSpecbuildInteractionSpec(EISInteraction interaction)Allow the platform to build the interaction spec based on properties defined in the interaction.org.eclipse.persistence.internal.databaseaccess.DatasourceCallbuildNativeCall(java.lang.String queryString)INTERNAL: Return the correct call type for the native query string.org.eclipse.persistence.internal.sessions.AbstractRecordbuildRow(javax.resource.cci.Record record, EISInteraction interaction, EISAccessor accessor)INTERNAL: Allow the platform to handle record to row conversion.java.util.VectorbuildRows(javax.resource.cci.Record record, EISInteraction interaction, EISAccessor accessor)Allow the platform to handle record to row conversion.org.eclipse.persistence.internal.sessions.AbstractRecordcreateDatabaseRowFromDOMRecord(javax.resource.cci.Record record, EISInteraction call, EISAccessor accessor)INTERNAL: Allow the platform to handle the creation of the Record for the DOM record.javax.resource.cci.RecordcreateDOMRecord(java.lang.String recordName, EISAccessor accessor)Allow the platform to handle the creation of the DOM record.javax.resource.cci.RecordcreateInputRecord(EISInteraction interaction, EISAccessor accessor)Allow the platform to create the appropriate type of record for the interaction.javax.resource.cci.RecordcreateOutputRecord(EISInteraction interaction, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow, EISAccessor accessor)Allow the platform to create the appropriate type of record for the interaction.org.eclipse.persistence.internal.helper.ConversionManagergetConversionManager()The platform holds its own instance of conversion manager to allow customization.RecordConvertergetRecordConverter()Return the record converter.java.lang.ObjectgetValueFromRecord(java.lang.String key, javax.resource.cci.MappedRecord record, EISAccessor accessor)Retrieves the field value from the record.booleanisDOMRecordSupported()Return if this platform supports XML/DOM Records.booleanisIndexedRecordSupported()Return if this platform supports JCA IndexedRecord.booleanisMappedRecordSupported()Return if this platform supports JCA MappedRecord.booleanrequiresAutoCommit()Return if this platform requires auto commit of the local transaction for interactions outside of an interaction.voidsetDOMInRecord(org.w3c.dom.Element dom, javax.resource.cci.Record record, EISInteraction call, EISAccessor accessor)Stores the XML DOM value into the record.voidsetIsDOMRecordSupported(boolean isDOMRecordSupported)Set if this platform supports XML/DOM Records.voidsetIsIndexedRecordSupported(boolean isIndexedRecordSupported)Set if this platform supports JCA IndexedRecord.voidsetIsMappedRecordSupported(boolean isMappedRecordSupported)Set if this platform supports JCA MappedRecord.voidsetRecordConverter(RecordConverter recordConverter)Set the record converter.voidsetRequiresAutoCommit(boolean requiresAutoCommit)Set if this platform requires auto commit of the local transaction for interactions outside of an interaction.voidsetShouldConvertDataToStrings(boolean shouldConvertDataToStrings)Set if all data set into the adapter should be first converted to strings.voidsetSupportsLocalTransactions(boolean supportsLocalTransactions)Set if this platform supports local transactions.voidsetValueInRecord(java.lang.String key, java.lang.Object value, javax.resource.cci.MappedRecord record, EISAccessor accessor)Stores the field value into the record.booleanshouldConvertDataToStrings()Return if all data set into the adapter should be first converted to strings.booleansupportsLocalTransactions()Return if this platform supports local transactions.-
Methods inherited from class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
addOperator, addSequence, addSequence, buildSelectQueryForIdentity, buildSelectQueryForIdentity, buildSelectQueryForSequenceObject, buildSelectQueryForSequenceObject, clone, convertObject, convertObject, copyInto, createConnectionCustomizer, createExpressionFor, createPlatformDefaultSequence, getCustomModifyValueForCall, getDataTypesConvertedFrom, getDataTypesConvertedTo, getDefaultNativeSequenceToTable, getDefaultSeqenceAtNextValue, getDefaultSequence, getDefaultSequenceToWrite, getDriverVersion, getEndDelimiter, getIdentifierQuoteCharacter, getINClauseLimit, getOperator, getPlatformOperators, getSelectSequenceQuery, getSequence, getSequencePreallocationSize, getSequences, getSequencesToWrite, getStartDelimiter, getTableQualifier, getTimestampFromServer, getTimestampQuery, getUpdateSequenceQuery, hasDefaultSequence, initialize, initializeDefaultQueries, initializePlatformOperators, isAccess, isAttunity, isCloudscape, isDB2, isDB2Z, isDBase, isDerby, isFirebird, isH2, isHANA, isHSQL, isInformix, isMaxDB, isMySQL, isODBC, isOracle, isOracle23, isOracle9, isPervasive, isPointBase, isPostgreSQL, isSQLAnywhere, isSQLServer, isSybase, isSymfoware, isTimesTen, isTimesTen7, removeAllSequences, removeSequence, sequencesAfterCloneCleanup, setConversionManager, setDefaultNativeSequenceToTable, setDefaultSeqenceAtNextValue, setDefaultSequence, setEndDelimiter, setSelectSequenceNumberQuery, setSequencePreallocationSize, setSequences, setStartDelimiter, setSupportsReturnGeneratedKeys, setTableQualifier, setTimestampQuery, setUpdateSequenceQuery, shouldNativeSequenceUseTransaction, shouldPrepare, shouldSelectDistinctIncludeOrderBy, shouldSelectIncludeOrderBy, shouldUseCustomModifyForCall, supportsIdentity, supportsNativeSequenceNumbers, supportsReturnGeneratedKeys, supportsSequenceObjects, toString, usesPlatformDefaultSequence
-
-
-
-
Field Detail
-
isIndexedRecordSupported
protected boolean isIndexedRecordSupported
-
isMappedRecordSupported
protected boolean isMappedRecordSupported
-
isDOMRecordSupported
protected boolean isDOMRecordSupported
-
shouldConvertDataToStrings
protected boolean shouldConvertDataToStrings
Can be used for adapters that only support String data/XML.
-
supportsLocalTransactions
protected boolean supportsLocalTransactions
Allows for usage of transaction to be disabled if not supported.
-
requiresAutoCommit
protected boolean requiresAutoCommit
Can be used if a commit is required after every interaction outside of a local transaction.
-
recordConverter
protected RecordConverter recordConverter
Can be used to convert from an adapter specific record.
-
domMethod
protected java.lang.reflect.Method domMethod
Used to reflectively provide XML record support as DOMRecord is not part of the JCA-CCI spec.
-
xmlConversionManager
protected org.eclipse.persistence.internal.oxm.XMLConversionManager xmlConversionManager
For XML usage, an XMLConversionManager instance is required
-
-
Method Detail
-
getRecordConverter
public RecordConverter getRecordConverter()
Return the record converter.
-
setRecordConverter
public void setRecordConverter(RecordConverter recordConverter)
Set the record converter. Can be used to convert from an adapter specific record.
-
requiresAutoCommit
public boolean requiresAutoCommit()
Return if this platform requires auto commit of the local transaction for interactions outside of an interaction.
-
setRequiresAutoCommit
public void setRequiresAutoCommit(boolean requiresAutoCommit)
Set if this platform requires auto commit of the local transaction for interactions outside of an interaction.
-
supportsLocalTransactions
public boolean supportsLocalTransactions()
Return if this platform supports local transactions.
-
setSupportsLocalTransactions
public void setSupportsLocalTransactions(boolean supportsLocalTransactions)
Set if this platform supports local transactions.
-
isIndexedRecordSupported
public boolean isIndexedRecordSupported()
Return if this platform supports JCA IndexedRecord.
-
setIsIndexedRecordSupported
public void setIsIndexedRecordSupported(boolean isIndexedRecordSupported)
Set if this platform supports JCA IndexedRecord.
-
isMappedRecordSupported
public boolean isMappedRecordSupported()
Return if this platform supports JCA MappedRecord.
-
setIsMappedRecordSupported
public void setIsMappedRecordSupported(boolean isMappedRecordSupported)
Set if this platform supports JCA MappedRecord.
-
isDOMRecordSupported
public boolean isDOMRecordSupported()
Return if this platform supports XML/DOM Records.
-
setIsDOMRecordSupported
public void setIsDOMRecordSupported(boolean isDOMRecordSupported)
Set if this platform supports XML/DOM Records.
-
shouldConvertDataToStrings
public boolean shouldConvertDataToStrings()
Return if all data set into the adapter should be first converted to strings.
-
setShouldConvertDataToStrings
public void setShouldConvertDataToStrings(boolean shouldConvertDataToStrings)
Set if all data set into the adapter should be first converted to strings.
-
buildInteractionSpec
public javax.resource.cci.InteractionSpec buildInteractionSpec(EISInteraction interaction)
Allow the platform to build the interaction spec based on properties defined in the interaction.
-
createInputRecord
public javax.resource.cci.Record createInputRecord(EISInteraction interaction, EISAccessor accessor)
Allow the platform to create the appropriate type of record for the interaction.
-
createOutputRecord
public javax.resource.cci.Record createOutputRecord(EISInteraction interaction, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow, EISAccessor accessor)
Allow the platform to create the appropriate type of record for the interaction. If an output record is not required then null is returned.
-
buildRow
public org.eclipse.persistence.internal.sessions.AbstractRecord buildRow(javax.resource.cci.Record record, EISInteraction interaction, EISAccessor accessor)INTERNAL: Allow the platform to handle record to row conversion.
-
buildRows
public java.util.Vector buildRows(javax.resource.cci.Record record, EISInteraction interaction, EISAccessor accessor)Allow the platform to handle record to row conversion.
-
createDOMRecord
public javax.resource.cci.Record createDOMRecord(java.lang.String recordName, EISAccessor accessor)Allow the platform to handle the creation of the DOM record. By default create a mapped record an assume it implements DOM as well.
-
createDatabaseRowFromDOMRecord
public org.eclipse.persistence.internal.sessions.AbstractRecord createDatabaseRowFromDOMRecord(javax.resource.cci.Record record, EISInteraction call, EISAccessor accessor)INTERNAL: Allow the platform to handle the creation of the Record for the DOM record. By default instantiate an EISDOMRecord which introspects the record for a getDOM method.
-
getValueFromRecord
public java.lang.Object getValueFromRecord(java.lang.String key, javax.resource.cci.MappedRecord record, EISAccessor accessor)Retrieves the field value from the record. This allows for the platform to perform any platform specific translation or conversion.
-
setDOMInRecord
public void setDOMInRecord(org.w3c.dom.Element dom, javax.resource.cci.Record record, EISInteraction call, EISAccessor accessor)Stores the XML DOM value into the record. This must be implemented by the platform if it support XML/DOM records.
-
setValueInRecord
public void setValueInRecord(java.lang.String key, java.lang.Object value, javax.resource.cci.MappedRecord record, EISAccessor accessor)Stores the field value into the record. This allows for the platform to perform any platform specific translation or conversion.
-
appendParameter
public void appendParameter(Call call, java.io.Writer writer, java.lang.Object parameter)
Add the parameter. Convert the parameter to a string and write it. Convert rows to XML strings.- Specified by:
appendParameterin interfaceorg.eclipse.persistence.internal.databaseaccess.Platform- Overrides:
appendParameterin classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
getConversionManager
public org.eclipse.persistence.internal.helper.ConversionManager getConversionManager()
The platform holds its own instance of conversion manager to allow customization.- Specified by:
getConversionManagerin interfaceorg.eclipse.persistence.internal.core.databaseaccess.CorePlatform<org.eclipse.persistence.internal.helper.ConversionManager>- Specified by:
getConversionManagerin interfaceorg.eclipse.persistence.internal.databaseaccess.Platform- Overrides:
getConversionManagerin classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
buildCallFromStatement
public org.eclipse.persistence.internal.databaseaccess.DatasourceCall buildCallFromStatement(org.eclipse.persistence.internal.expressions.SQLStatement statement, DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Override this method to throw an exception by default. Platforms that support dynamic querying can override this to generate an EISInteraction.
-
buildNativeCall
public org.eclipse.persistence.internal.databaseaccess.DatasourceCall buildNativeCall(java.lang.String queryString)
INTERNAL: Return the correct call type for the native query string. This allows EIS platforms to use different types of native calls.- Overrides:
buildNativeCallin classorg.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
-