Package dev.morphia
Class Morphia
- java.lang.Object
-
- dev.morphia.Morphia
-
public final class Morphia extends Object
Entry point for working with Morphia
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Datastore
createDatastore(com.mongodb.client.MongoClient mongoClient, String dbName)
It is best to use a Mongo singleton instance here.static Datastore
createDatastore(com.mongodb.client.MongoClient mongoClient, String dbName, MapperOptions options)
It is best to use a Mongo singleton instance here.static Datastore
createDatastore(String dbName)
Creates a Datastorestatic Datastore
createDatastore(String dbName, MapperOptions options)
Creates a Datastore
-
-
-
Method Detail
-
createDatastore
public static Datastore createDatastore(String dbName)
Creates a Datastore- Parameters:
dbName
- the name of the database- Returns:
- a Datastore that you can use to interact with MongoDB
-
createDatastore
public static Datastore createDatastore(String dbName, MapperOptions options)
Creates a Datastore- Parameters:
dbName
- the name of the databaseoptions
- the mapping options to use.- Returns:
- a Datastore that you can use to interact with MongoDB
-
createDatastore
public static Datastore createDatastore(com.mongodb.client.MongoClient mongoClient, String dbName, MapperOptions options)
It is best to use a Mongo singleton instance here.- Parameters:
mongoClient
- the client to usedbName
- the name of the databaseoptions
- the mapping options to use.- Returns:
- a Datastore that you can use to interact with MongoDB
-
createDatastore
public static Datastore createDatastore(com.mongodb.client.MongoClient mongoClient, String dbName)
It is best to use a Mongo singleton instance here.- Parameters:
mongoClient
- the client to usedbName
- the name of the database- Returns:
- a Datastore that you can use to interact with MongoDB
-
-