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:
- 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 MongoPlatform extends org.eclipse.persistence.eis.EISPlatformPlatform for Mongo database.- See Also:
- Serialized Form
- Author:
- James
- Since:
- EclipseLink 2.4
 
- 
- 
Field SummaryFields Modifier and Type Field Description static java.lang.StringBATCH_SIZEstatic java.lang.StringCOLLECTIONprotected booleanisLikeRegexConfigure if like should be SQL or regex.static java.lang.StringLIMITstatic java.lang.StringOPERATIONMongo interaction spec properties.static java.lang.StringOPTIONSstatic java.lang.StringREAD_PREFERENCEstatic java.lang.StringSKIPstatic java.lang.StringWRITE_CONCERN- 
Fields inherited from class org.eclipse.persistence.eis.EISPlatformdomMethod, isDOMRecordSupported, isIndexedRecordSupported, isMappedRecordSupported, recordConverter, requiresAutoCommit, shouldConvertDataToStrings, supportsLocalTransactions, xmlConversionManager
 - 
Fields inherited from class org.eclipse.persistence.internal.databaseaccess.DatasourcePlatformconversionManager, dataTypesConvertedFromAClass, dataTypesConvertedToAClass, defaultNativeSequenceToTable, defaultSeqenceAtNextValue, defaultSequence, endDelimiter, platformOperators, sequences, sequencesLock, startDelimiter, supportsReturnGeneratedKeys, tableQualifier, timestampQuery
 
- 
 - 
Constructor SummaryConstructors Constructor Description MongoPlatform()Default constructor.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappendExpressionToQueryRow(org.eclipse.persistence.expressions.Expression expression, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.queries.DatabaseQuery query)Append the expression and recursively to the query row.protected voidappendExpressionToSortRow(org.eclipse.persistence.expressions.Expression expression, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.queries.DatabaseQuery query)Append the order by expression to the sort row.org.eclipse.persistence.internal.databaseaccess.DatasourceCallbuildCallFromStatement(org.eclipse.persistence.internal.expressions.SQLStatement statement, org.eclipse.persistence.queries.DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Override this method to throw an exception by default.javax.resource.cci.InteractionSpecbuildInteractionSpec(org.eclipse.persistence.eis.interactions.EISInteraction interaction)Allow the platform to build the interaction spec based on properties defined in the interaction.javax.resource.cci.RecordcreateOutputRecord(org.eclipse.persistence.eis.interactions.EISInteraction interaction, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow, org.eclipse.persistence.eis.EISAccessor accessor)For updates a separate translation record is required.protected org.eclipse.persistence.sequencing.SequencecreatePlatformDefaultSequence()INTERNAL: Create platform-default Sequenceprotected java.lang.ObjectextractValueFromExpression(org.eclipse.persistence.expressions.Expression expression, org.eclipse.persistence.queries.DatabaseQuery query)Extract the field or constant value from the comparison expression.voidinitializeDefaultQueries(org.eclipse.persistence.descriptors.DescriptorQueryManager queryManager, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Allow the platform to initialize the CRUD queries to defaults.booleanisLikeRegex()Return if regex should be used for like.voidsetIsLikeRegex(boolean isLikeRegex)Set if regex should be used for like.voidsetValueInRecord(java.lang.String key, java.lang.Object value, javax.resource.cci.MappedRecord record, org.eclipse.persistence.eis.EISAccessor accessor)Mongo does not support all Java types.booleanshouldPrepare(org.eclipse.persistence.queries.DatabaseQuery query)Do not prepare dynamic queries, as the translation row is required.- 
Methods inherited from class org.eclipse.persistence.eis.EISPlatformappendParameter, 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.DatasourcePlatformaddOperator, addSequence, addSequence, buildSelectQueryForIdentity, buildSelectQueryForIdentity, buildSelectQueryForSequenceObject, buildSelectQueryForSequenceObject, clone, convertObject, convertObject, copyInto, createConnectionCustomizer, createExpressionFor, 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, 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, shouldSelectDistinctIncludeOrderBy, shouldSelectIncludeOrderBy, shouldUseCustomModifyForCall, supportsIdentity, supportsNativeSequenceNumbers, supportsReturnGeneratedKeys, supportsSequenceObjects, toString, usesPlatformDefaultSequence
 
- 
 
- 
- 
- 
Field Detail- 
OPERATIONpublic static final java.lang.String OPERATION Mongo interaction spec properties.- See Also:
- Constant Field Values
 
 - 
COLLECTIONpublic static final java.lang.String COLLECTION - See Also:
- Constant Field Values
 
 - 
OPTIONSpublic static final java.lang.String OPTIONS - See Also:
- Constant Field Values
 
 - 
READ_PREFERENCEpublic static final java.lang.String READ_PREFERENCE - See Also:
- Constant Field Values
 
 - 
WRITE_CONCERNpublic static final java.lang.String WRITE_CONCERN - See Also:
- Constant Field Values
 
 - 
SKIPpublic static final java.lang.String SKIP - See Also:
- Constant Field Values
 
 - 
LIMITpublic static final java.lang.String LIMIT - See Also:
- Constant Field Values
 
 - 
BATCH_SIZEpublic static final java.lang.String BATCH_SIZE - See Also:
- Constant Field Values
 
 - 
isLikeRegexprotected boolean isLikeRegex Configure if like should be SQL or regex.
 
- 
 - 
Method Detail- 
setValueInRecordpublic void setValueInRecord(java.lang.String key, java.lang.Object value, javax.resource.cci.MappedRecord record, org.eclipse.persistence.eis.EISAccessor accessor)Mongo does not support all Java types. Convert unsupported types to string.- Overrides:
- setValueInRecordin class- org.eclipse.persistence.eis.EISPlatform
 
 - 
isLikeRegexpublic boolean isLikeRegex() Return if regex should be used for like.
 - 
setIsLikeRegexpublic void setIsLikeRegex(boolean isLikeRegex) Set if regex should be used for like.
 - 
buildInteractionSpecpublic javax.resource.cci.InteractionSpec buildInteractionSpec(org.eclipse.persistence.eis.interactions.EISInteraction interaction) Allow the platform to build the interaction spec based on properties defined in the interaction.- Overrides:
- buildInteractionSpecin class- org.eclipse.persistence.eis.EISPlatform
 
 - 
createOutputRecordpublic javax.resource.cci.Record createOutputRecord(org.eclipse.persistence.eis.interactions.EISInteraction interaction, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow, org.eclipse.persistence.eis.EISAccessor accessor)For updates a separate translation record is required. The output row is used for this.- Overrides:
- createOutputRecordin class- org.eclipse.persistence.eis.EISPlatform
 
 - 
initializeDefaultQueriespublic void initializeDefaultQueries(org.eclipse.persistence.descriptors.DescriptorQueryManager queryManager, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Allow the platform to initialize the CRUD queries to defaults. Configure the CRUD operations using GET/PUT and DELETE.- Overrides:
- initializeDefaultQueriesin class- org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
 
 - 
buildCallFromStatementpublic org.eclipse.persistence.internal.databaseaccess.DatasourceCall buildCallFromStatement(org.eclipse.persistence.internal.expressions.SQLStatement statement, org.eclipse.persistence.queries.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.- Overrides:
- buildCallFromStatementin class- org.eclipse.persistence.eis.EISPlatform
 
 - 
appendExpressionToQueryRowprotected void appendExpressionToQueryRow(org.eclipse.persistence.expressions.Expression expression, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.queries.DatabaseQuery query)Append the expression and recursively to the query row.
 - 
appendExpressionToSortRowprotected void appendExpressionToSortRow(org.eclipse.persistence.expressions.Expression expression, org.eclipse.persistence.internal.sessions.AbstractRecord row, org.eclipse.persistence.queries.DatabaseQuery query)Append the order by expression to the sort row.
 - 
extractValueFromExpressionprotected java.lang.Object extractValueFromExpression(org.eclipse.persistence.expressions.Expression expression, org.eclipse.persistence.queries.DatabaseQuery query)Extract the field or constant value from the comparison expression.
 - 
shouldPreparepublic boolean shouldPrepare(org.eclipse.persistence.queries.DatabaseQuery query) Do not prepare dynamic queries, as the translation row is required.- Overrides:
- shouldPreparein class- org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
 
 - 
createPlatformDefaultSequenceprotected org.eclipse.persistence.sequencing.Sequence createPlatformDefaultSequence() INTERNAL: Create platform-default Sequence- Overrides:
- createPlatformDefaultSequencein class- org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
 
 
- 
 
-