Spring Data Document

org.springframework.data.document.mongodb.repository
Class MappingMongoEntityInformation<T,ID extends Serializable>

java.lang.Object
  extended by org.springframework.data.repository.support.AbstractEntityInformation<T,ID>
      extended by org.springframework.data.document.mongodb.repository.MappingMongoEntityInformation<T,ID>
All Implemented Interfaces:
MongoEntityInformation<T,ID>, org.springframework.data.repository.support.EntityInformation<T,ID>, org.springframework.data.repository.support.EntityMetadata<T>

public class MappingMongoEntityInformation<T,ID extends Serializable>
extends org.springframework.data.repository.support.AbstractEntityInformation<T,ID>
implements MongoEntityInformation<T,ID>

MongoEntityInformation implementation using a BasicMongoPersistentEntity instance to lookup the necessary information.

Author:
Oliver Gierke

Constructor Summary
MappingMongoEntityInformation(MongoPersistentEntity<T> entity)
          Creates a new MappingMongoEntityInformation for the given MongoPersistentEntity.
 
Method Summary
 String getCollectionName()
          Returns the name of the collection the entity shall be persisted to.
 ID getId(T entity)
           
 String getIdAttribute()
          Returns the attribute that the id will be persisted to.
 Class<ID> getIdType()
           
 
Methods inherited from class org.springframework.data.repository.support.AbstractEntityInformation
getJavaType, isNew
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.data.repository.support.EntityInformation
isNew
 
Methods inherited from interface org.springframework.data.repository.support.EntityMetadata
getJavaType
 

Constructor Detail

MappingMongoEntityInformation

public MappingMongoEntityInformation(MongoPersistentEntity<T> entity)
Creates a new MappingMongoEntityInformation for the given MongoPersistentEntity.

Parameters:
domainClass -
entity -
Method Detail

getId

public ID getId(T entity)
Specified by:
getId in interface org.springframework.data.repository.support.EntityInformation<T,ID extends Serializable>

getIdType

public Class<ID> getIdType()
Specified by:
getIdType in interface org.springframework.data.repository.support.EntityInformation<T,ID extends Serializable>

getCollectionName

public 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 Serializable>
Returns:

getIdAttribute

public 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 Serializable>
Returns:

Spring Data Document

Copyright © 2011. All Rights Reserved.