Class MongoPlatform
java.lang.Object
org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
org.eclipse.persistence.eis.EISPlatform
org.eclipse.persistence.nosql.adapters.mongo.MongoPlatform
- All Implemented Interfaces:
Serializable
,Cloneable
,CorePlatform<ConversionManager>
,Platform
Platform for Mongo database.
- Since:
- EclipseLink 2.4
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
protected boolean
Configure if like should be SQL or regex.static final String
static final String
Mongo interaction spec properties.static final String
static final String
static final String
static final String
Fields inherited from class org.eclipse.persistence.eis.EISPlatform
domMethod, isDOMRecordSupported, isIndexedRecordSupported, isMappedRecordSupported, recordConverter, requiresAutoCommit, shouldConvertDataToStrings, supportsLocalTransactions, xmlConversionManager
Fields inherited from class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
conversionManager, dataTypesConvertedFromAClass, dataTypesConvertedToAClass, defaultNativeSequenceToTable, defaultSeqenceAtNextValue, defaultSequence, endDelimiter, platformOperators, sequences, sequencesLock, startDelimiter, supportsReturnGeneratedKeys, tableQualifier, timestampQuery, uuidQuery
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
appendExpressionToQueryRow
(Expression expression, AbstractRecord row, DatabaseQuery query) Append the expression and recursively to the query row.protected void
appendExpressionToSortRow
(Expression expression, AbstractRecord row, DatabaseQuery query) Append the order by expression to the sort row.buildCallFromStatement
(SQLStatement statement, DatabaseQuery query, AbstractSession session) INTERNAL: Override this method to throw an exception by default.buildInteractionSpec
(EISInteraction interaction) Allow the platform to build the interaction spec based on properties defined in the interaction.createOutputRecord
(EISInteraction interaction, AbstractRecord translationRow, EISAccessor accessor) For updates a separate translation record is required.protected Sequence
INTERNAL: Create platform-default Sequenceprotected Object
extractValueFromExpression
(Expression expression, DatabaseQuery query) Extract the field or constant value from the comparison expression.void
initializeDefaultQueries
(DescriptorQueryManager queryManager, AbstractSession session) INTERNAL: Allow the platform to initialize the CRUD queries to defaults.boolean
Return if regex should be used for like.void
setIsLikeRegex
(boolean isLikeRegex) Set if regex should be used for like.void
setValueInRecord
(String key, Object value, MappedRecord record, EISAccessor accessor) Mongo does not support all Java types.boolean
shouldPrepare
(DatabaseQuery query) Do not prepare dynamic queries, as the translation row is required.Methods inherited from class org.eclipse.persistence.eis.EISPlatform
appendParameter, buildNativeCall, buildRow, buildRows, createDatabaseRowFromDOMRecord, createDOMRecord, createInputRecord, getConversionManager, getRecordConverter, getValueFromRecord, isDOMRecordSupported, isIndexedRecordSupported, isMappedRecordSupported, requiresAutoCommit, setDOMInRecord, setIsDOMRecordSupported, setIsIndexedRecordSupported, setIsMappedRecordSupported, setRecordConverter, setRequiresAutoCommit, setShouldConvertDataToStrings, setSupportsLocalTransactions, shouldConvertDataToStrings, supportsLocalTransactions
Methods inherited from class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
addOperator, addSequence, addSequence, buildSelectQueryForIdentity, buildSelectQueryForIdentity, buildSelectQueryForSequenceObject, buildSelectQueryForSequenceObject, clone, convertObject, copyInto, createConnectionCustomizer, createExpressionFor, getCustomModifyValueForCall, getDataTypesConvertedFrom, getDataTypesConvertedTo, getDefaultNativeSequenceToTable, getDefaultSeqenceAtNextValue, getDefaultSequence, getDefaultSequenceToWrite, getDriverVersion, getEndDelimiter, getINClauseLimit, getOperator, getPlatformOperators, getSelectSequenceQuery, getSequence, getSequencePreallocationSize, getSequences, getSequencesToWrite, getStartDelimiter, getTableQualifier, getTimestampFromServer, getTimestampQuery, getUpdateSequenceQuery, getUUIDQuery, hasDefaultSequence, initialize, initializePlatformOperators, initIdentitySequences, isAccess, isAttunity, isCloudscape, isDB2, isDB2Z, isDBase, isDerby, isFirebird, isH2, isHANA, isHSQL, isInformix, isMariaDB, isMaxDB, isMySQL, isODBC, isOracle, isOracle12, isOracle23, isOracle9, isPervasive, isPointBase, isPostgreSQL, isSQLAnywhere, isSQLServer, isSybase, isSymfoware, isTimesTen, isTimesTen7, removeAllSequences, removeIdentitySequences, removeSequence, sequencesAfterCloneCleanup, setConversionManager, setDefaultNativeSequenceToTable, setDefaultSeqenceAtNextValue, setDefaultSequence, setEndDelimiter, setSelectSequenceNumberQuery, setSequencePreallocationSize, setSequences, setStartDelimiter, setSupportsReturnGeneratedKeys, setTableQualifier, setTimestampQuery, setUpdateSequenceQuery, setUUIDQuery, shouldNativeSequenceUseTransaction, shouldSelectDistinctIncludeOrderBy, shouldSelectIncludeOrderBy, shouldUseCustomModifyForCall, supportsIdentity, supportsNativeSequenceNumbers, supportsReturnGeneratedKeys, supportsSequenceObjects, toString, usesPlatformDefaultSequence
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.persistence.internal.databaseaccess.Platform
connectionProperties
-
Field Details
-
OPERATION
Mongo interaction spec properties.- See Also:
-
COLLECTION
- See Also:
-
OPTIONS
- See Also:
-
READ_PREFERENCE
- See Also:
-
WRITE_CONCERN
- See Also:
-
SKIP
- See Also:
-
LIMIT
- See Also:
-
BATCH_SIZE
- See Also:
-
isLikeRegex
protected boolean isLikeRegexConfigure if like should be SQL or regex.
-
-
Constructor Details
-
MongoPlatform
public MongoPlatform()Default constructor.
-
-
Method Details
-
setValueInRecord
Mongo does not support all Java types. Convert unsupported types to string.- Overrides:
setValueInRecord
in classEISPlatform
-
isLikeRegex
public boolean isLikeRegex()Return if regex should be used for like. -
setIsLikeRegex
public void setIsLikeRegex(boolean isLikeRegex) Set if regex should be used for like. -
buildInteractionSpec
Allow the platform to build the interaction spec based on properties defined in the interaction.- Overrides:
buildInteractionSpec
in classEISPlatform
-
createOutputRecord
public Record createOutputRecord(EISInteraction interaction, AbstractRecord translationRow, EISAccessor accessor) For updates a separate translation record is required. The output row is used for this.- Overrides:
createOutputRecord
in classEISPlatform
-
initializeDefaultQueries
INTERNAL: Allow the platform to initialize the CRUD queries to defaults. Configure the CRUD operations using GET/PUT and DELETE.- Overrides:
initializeDefaultQueries
in classDatasourcePlatform
-
buildCallFromStatement
public DatasourceCall buildCallFromStatement(SQLStatement statement, DatabaseQuery query, AbstractSession session) INTERNAL: Override this method to throw an exception by default. Platforms that support dynamic querying can override this to generate an EISInteraction.- Overrides:
buildCallFromStatement
in classEISPlatform
-
appendExpressionToQueryRow
protected void appendExpressionToQueryRow(Expression expression, AbstractRecord row, DatabaseQuery query) Append the expression and recursively to the query row. -
appendExpressionToSortRow
protected void appendExpressionToSortRow(Expression expression, AbstractRecord row, DatabaseQuery query) Append the order by expression to the sort row. -
extractValueFromExpression
Extract the field or constant value from the comparison expression. -
shouldPrepare
Do not prepare dynamic queries, as the translation row is required.- Overrides:
shouldPrepare
in classDatasourcePlatform
-
createPlatformDefaultSequence
INTERNAL: Create platform-default Sequence- Overrides:
createPlatformDefaultSequence
in classDatasourcePlatform
-