|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mongodb.morphia.Morphia
public class Morphia
Constructor Summary | |
---|---|
Morphia()
|
|
Morphia(Mapper mapper)
|
|
Morphia(Mapper mapper,
Set<Class> classesToMap)
|
|
Morphia(Set<Class> classesToMap)
|
Method Summary | ||
---|---|---|
Datastore |
createDatastore(MongoClient mongoClient,
Mapper mapper,
String dbName)
Creates a new Datastore for interacting with MongoDB using POJOs |
|
Datastore |
createDatastore(MongoClient mongoClient,
String dbName)
It is best to use a Mongo singleton instance here. |
|
|
fromDBObject(Class<T> entityClass,
DBObject dbObject)
|
|
|
fromDBObject(Class<T> entityClass,
DBObject dbObject,
EntityCache cache)
|
|
Mapper |
getMapper()
|
|
boolean |
getUseBulkWriteOperations()
|
|
boolean |
isMapped(Class entityClass)
Check whether a specific class is mapped by this instance. |
|
boolean |
isUseBulkWriteOperations()
|
|
Morphia |
map(Class... entityClasses)
|
|
Morphia |
map(Set<Class> entityClasses)
|
|
Morphia |
mapPackage(String packageName)
Tries to map all classes in the package specified. |
|
Morphia |
mapPackage(String packageName,
boolean ignoreInvalidClasses)
Tries to map all classes in the package specified. |
|
Morphia |
mapPackageFromClass(Class clazz)
|
|
void |
setUseBulkWriteOperations(boolean useBulkWriteOperations)
|
|
DBObject |
toDBObject(Object entity)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Morphia()
public Morphia(Mapper mapper)
public Morphia(Set<Class> classesToMap)
public Morphia(Mapper mapper, Set<Class> classesToMap)
Method Detail |
---|
public Morphia map(Class... entityClasses)
public Morphia map(Set<Class> entityClasses)
public Morphia mapPackageFromClass(Class clazz)
public Morphia mapPackage(String packageName)
packageName
- the name of the package to process
public Morphia mapPackage(String packageName, boolean ignoreInvalidClasses)
packageName
- the name of the package to processignoreInvalidClasses
- specifies whether to ignore classes in the package that cannot be mapped
public boolean isMapped(Class entityClass)
entityClass
- the class we want to check
public <T> T fromDBObject(Class<T> entityClass, DBObject dbObject)
public <T> T fromDBObject(Class<T> entityClass, DBObject dbObject, EntityCache cache)
public DBObject toDBObject(Object entity)
public Mapper getMapper()
public Datastore createDatastore(MongoClient mongoClient, String dbName)
mongoClient
- the representations of the connection to a MongoDB instancedbName
- the name of the database
public Datastore createDatastore(MongoClient mongoClient, Mapper mapper, String dbName)
mongoClient
- the representations of the connection to a MongoDB instancemapper
- a pre-configured Mapper for your POJOsdbName
- the name of the database
public boolean getUseBulkWriteOperations()
public boolean isUseBulkWriteOperations()
public void setUseBulkWriteOperations(boolean useBulkWriteOperations)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |