public class MongoMapping extends Object
Modifier and Type | Class and Description |
---|---|
static class |
MongoMapping.DocumentFieldType
Accepted types of data to be mapped in mongo based on BSON types
|
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG
Helper to write useful information into the logs
|
Constructor and Description |
---|
MongoMapping() |
Modifier and Type | Method and Description |
---|---|
void |
addClassField(String docNameFromMapping,
String classFieldName,
String docFieldName,
String fieldType)
Register a new mapping between a field from the persisted class to a
MongoDocument field.
|
String |
getCollectionName()
Getter for the name of the collection
|
String |
getDocumentField(String field)
Given a field from the persistence class, return the corresponding field in
the document.
|
protected MongoMapping.DocumentFieldType |
getDocumentFieldType(String field)
Package private method to retrieve the type of a document field.
|
void |
renameCollection(String oldName,
String newName)
Change the name of the collection.
|
void |
setCollectionName(String collName)
Setter for the name of the collection
|
public static final org.slf4j.Logger LOG
public void renameCollection(String oldName, String newName)
oldName
- previous namenewName
- new name to be usedpublic String getCollectionName()
public void setCollectionName(String collName)
public void addClassField(String docNameFromMapping, String classFieldName, String docFieldName, String fieldType)
docNameFromMapping
- name of the document as defined in the mappingclassFieldName
- name of the field in the persisted classdocFieldName
- name of the field in the mondo documentfieldType
- type of the fieldpublic String getDocumentField(String field)
field
- protected MongoMapping.DocumentFieldType getDocumentFieldType(String field)
Copyright © 2010-2015 The Apache Software Foundation. All Rights Reserved.