Class MongoDatabaseConnection
java.lang.Object
org.eclipse.persistence.internal.nosql.adapters.mongo.MongoDatabaseConnection
- All Implemented Interfaces:
Connection
Connection to Mongo
This connection wraps a Mongo DB.
- Since:
- EclipseLink 2.7
-
Field Summary
Modifier and TypeFieldDescriptionprotected com.mongodb.client.MongoDatabase
protected boolean
protected MongoJCAConnectionSpec
protected MongoTransaction
-
Constructor Summary
ConstructorDescriptionMongoDatabaseConnection
(com.mongodb.MongoClient mongo, com.mongodb.client.MongoDatabase db, boolean isExternal, MongoJCAConnectionSpec spec) Create the connection on a native AQ session. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the AQ native session and the database connection.com.mongodb.client.MongoDatabase
getDB()
com.mongodb.MongoClient
getMongo()
Result sets are not supported.boolean
void
setExternal
(boolean isExternal)
-
Field Details
-
spec
-
transaction
-
db
protected com.mongodb.client.MongoDatabase db -
isExternal
protected boolean isExternal
-
-
Constructor Details
-
MongoDatabaseConnection
public MongoDatabaseConnection(com.mongodb.MongoClient mongo, com.mongodb.client.MongoDatabase db, boolean isExternal, MongoJCAConnectionSpec spec) Create the connection on a native AQ session. The session must be connected to a JDBC connection.
-
-
Method Details
-
getMongo
public com.mongodb.MongoClient getMongo() -
getDB
public com.mongodb.client.MongoDatabase getDB() -
close
Close the AQ native session and the database connection.- Specified by:
close
in interfaceConnection
- Throws:
ResourceException
-
createInteraction
- Specified by:
createInteraction
in interfaceConnection
-
getConnectionSpec
-
getLocalTransaction
- Specified by:
getLocalTransaction
in interfaceConnection
-
getMongoTransaction
-
getMetaData
- Specified by:
getMetaData
in interfaceConnection
-
getResultSetInfo
Result sets are not supported.- Specified by:
getResultSetInfo
in interfaceConnection
-
isExternal
public boolean isExternal() -
setExternal
public void setExternal(boolean isExternal)
-