org.springframework.data.document.mongodb.repository
Class MappingMongoEntityInformation<T,ID extends java.io.Serializable>
java.lang.Object
org.springframework.data.document.mongodb.repository.MappingMongoEntityInformation<T,ID>
- All Implemented Interfaces:
- MongoEntityInformation<T,ID>
public class MappingMongoEntityInformation<T,ID extends java.io.Serializable>
- extends
- implements MongoEntityInformation<T,ID>
MongoEntityInformation
implementation using a MongoPersistentEntity
instance to lookup the necessary
information.
- Author:
- Oliver Gierke
Method Summary |
java.lang.String |
getCollectionName()
Returns the name of the collection the entity shall be persisted to. |
ID |
getId(T entity)
|
java.lang.String |
getIdAttribute()
Returns the attribute that the id will be persisted to. |
java.lang.Class<ID> |
getIdType()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
entityMetadata
private final MongoPersistentEntity<T> entityMetadata
MappingMongoEntityInformation
public MappingMongoEntityInformation(MongoPersistentEntity<T> entity)
- Creates a new
MappingMongoEntityInformation
for the given MongoPersistentEntity
.
- Parameters:
domainClass
- entity
-
getId
public ID getId(T entity)
getIdType
public java.lang.Class<ID> getIdType()
getCollectionName
public java.lang.String getCollectionName()
- Description copied from interface:
MongoEntityInformation
- Returns the name of the collection the entity shall be persisted to.
- Specified by:
getCollectionName
in interface MongoEntityInformation<T,ID extends java.io.Serializable>
- Returns:
getIdAttribute
public java.lang.String getIdAttribute()
- Description copied from interface:
MongoEntityInformation
- Returns the attribute that the id will be persisted to.
- Specified by:
getIdAttribute
in interface MongoEntityInformation<T,ID extends java.io.Serializable>
- Returns: