public class BasicMongoPersistentEntity<T> extends org.springframework.data.mapping.model.BasicPersistentEntity<T,MongoPersistentProperty> implements MongoPersistentEntity<T>, ApplicationContextAware
MongoPersistentEntity
implementation that adds Mongo specific meta-data such as the
collection name and the like.Constructor and Description |
---|
BasicMongoPersistentEntity(org.springframework.data.util.TypeInformation<T> typeInformation)
Creates a new
BasicMongoPersistentEntity with the given TypeInformation . |
Modifier and Type | Method and Description |
---|---|
void |
addPersistentProperty(MongoPersistentProperty property) |
String |
getCollection()
Returns the collection the entity shall be persisted to.
|
MongoPersistentProperty |
getVersionProperty()
Returns the
MongoPersistentProperty that represents the version attribute of an entity. |
boolean |
hasVersionProperty()
Returns whether the entity has a property representing the version of the entity.
|
void |
setApplicationContext(ApplicationContext applicationContext) |
addAssociation, doWithAssociations, doWithProperties, getIdProperty, getName, getPersistenceConstructor, getPersistentProperty, getType, getTypeAlias, getTypeInformation, isConstructorArgument, isIdProperty, verify
public BasicMongoPersistentEntity(org.springframework.data.util.TypeInformation<T> typeInformation)
BasicMongoPersistentEntity
with the given TypeInformation
. Will default the
collection name to the entities simple type name.typeInformation
- public void addPersistentProperty(MongoPersistentProperty property)
addPersistentProperty
in interface org.springframework.data.mapping.model.MutablePersistentEntity<T,MongoPersistentProperty>
addPersistentProperty
in class org.springframework.data.mapping.model.BasicPersistentEntity<T,MongoPersistentProperty>
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
setApplicationContext
in interface ApplicationContextAware
BeansException
public String getCollection()
MongoPersistentEntity
getCollection
in interface MongoPersistentEntity<T>
public MongoPersistentProperty getVersionProperty()
MongoPersistentEntity
MongoPersistentProperty
that represents the version attribute of an entity. Will not be
null if MongoPersistentEntity.hasVersionProperty()
.getVersionProperty
in interface MongoPersistentEntity<T>
public boolean hasVersionProperty()
MongoPersistentEntity
hasVersionProperty
in interface MongoPersistentEntity<T>
Copyright © 2012. All Rights Reserved.