Package ai.platon.gora.mongodb.store
Class MongoMapping
java.lang.Object
ai.platon.gora.mongodb.store.MongoMapping
- Author:
- Fabien Poulard fpoulard@dictanova.com
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAccepted types of data to be mapped in mongo based on BSON types -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.slf4j.LoggerHelper to write useful information into the logs -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddClassField(String classFieldName, String docFieldName, String fieldType) Register a new mapping between a field from the persisted class to a MongoDocument field.booleanGetter for the name of the collectiongetDocumentField(String field) Given a field from the persistence class, return the corresponding field in the document.protected MongoMapping.DocumentFieldTypegetDocumentFieldType(String field) Package private method to retrieve the type of a document field.inthashCode()voidrenameCollection(String oldName, String newName) Change the name of the collection.voidsetCollectionName(String collName) Setter for the name of the collection
-
Field Details
-
LOG
public static final org.slf4j.Logger LOGHelper to write useful information into the logs
-
-
Constructor Details
-
MongoMapping
public MongoMapping()
-
-
Method Details
-
renameCollection
Change the name of the collection.- Parameters:
oldName- previous namenewName- new name to be used
-
getCollectionName
Getter for the name of the collection -
setCollectionName
Setter for the name of the collection -
addClassField
Register a new mapping between a field from the persisted class to a MongoDocument field.- Parameters:
classFieldName- name of the field in the persisted classdocFieldName- name of the field in the mondo documentfieldType- type of the field
-
getDocumentField
Given a field from the persistence class, return the corresponding field in the document.- Parameters:
field-- Returns:
-
getDocumentFieldType
Package private method to retrieve the type of a document field. -
equals
-
hashCode
public int hashCode()
-