Class MongoMapping

java.lang.Object
ai.platon.gora.mongodb.store.MongoMapping

public class MongoMapping extends Object
Author:
Fabien Poulard fpoulard@dictanova.com
  • Field Details

    • LOG

      public static final org.slf4j.Logger LOG
      Helper to write useful information into the logs
  • Constructor Details

    • MongoMapping

      public MongoMapping()
  • Method Details

    • renameCollection

      public void renameCollection(String oldName, String newName)
      Change the name of the collection.
      Parameters:
      oldName - previous name
      newName - new name to be used
    • getCollectionName

      public String getCollectionName()
      Getter for the name of the collection
    • setCollectionName

      public void setCollectionName(String collName)
      Setter for the name of the collection
    • addClassField

      public void addClassField(String classFieldName, String docFieldName, String fieldType)
      Register a new mapping between a field from the persisted class to a MongoDocument field.
      Parameters:
      classFieldName - name of the field in the persisted class
      docFieldName - name of the field in the mondo document
      fieldType - type of the field
    • getDocumentField

      public String getDocumentField(String field)
      Given a field from the persistence class, return the corresponding field in the document.
      Parameters:
      field -
      Returns:
    • getDocumentFieldType

      protected MongoMapping.DocumentFieldType getDocumentFieldType(String field)
      Package private method to retrieve the type of a document field.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object