Spring Data Document

org.springframework.data.document.mongodb.mapping
Class MongoPersistentEntity<T>

java.lang.Object
  extended by org.springframework.data.mapping.BasicPersistentEntity<T>
      extended by org.springframework.data.document.mongodb.mapping.MongoPersistentEntity<T>
All Implemented Interfaces:
InitializingBean, org.springframework.data.mapping.model.PersistentEntity<T>

public class MongoPersistentEntity<T>
extends org.springframework.data.mapping.BasicPersistentEntity<T>

Mongo specific PersistentEntity implementation that adds Mongo specific meta-data such as the collection name and the like.

Author:
Jon Brisbin , Oliver Gierke

Field Summary
protected  String collection
           
 
Fields inherited from class org.springframework.data.mapping.BasicPersistentEntity
associations, idProperty, information, mappingContext, persistentProperties, preferredConstructor, type
 
Constructor Summary
MongoPersistentEntity(org.springframework.data.mapping.model.MappingContext mappingContext, org.springframework.data.util.TypeInformation typeInformation)
          Creates a new MongoPersistentEntity with the given MappingContext and TypeInformation.
 
Method Summary
 String getCollection()
          Returns the collection the entity should be stored in.
 void setCollection(String collection)
           
 
Methods inherited from class org.springframework.data.mapping.BasicPersistentEntity
addAssociation, addPersistentProperty, afterPropertiesSet, doWithAssociations, doWithProperties, getAssociations, getIdProperty, getMappingContext, getName, getPersistentProperties, getPersistentProperty, getPersistentPropertyNames, getPreferredConstructor, getPropertyInformation, getType, setIdProperty, setPreferredConstructor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

collection

protected String collection
Constructor Detail

MongoPersistentEntity

public MongoPersistentEntity(org.springframework.data.mapping.model.MappingContext mappingContext,
                             org.springframework.data.util.TypeInformation typeInformation)
Creates a new MongoPersistentEntity with the given MappingContext and TypeInformation. Will default the collection name to the entities simple type name.

Parameters:
mappingContext -
typeInformation -
Method Detail

getCollection

public String getCollection()
Returns the collection the entity should be stored in.

Returns:

setCollection

public void setCollection(String collection)

Spring Data Document

Copyright © 2011. All Rights Reserved.