public class MappingMongoEntityInformation<T,ID> extends PersistentEntityInformation<T,ID> implements MongoEntityInformation<T,ID>
MongoEntityInformation implementation using a MongoPersistentEntity instance to lookup the necessary
information. Can be configured with a custom collection to be returned which will trump the one returned by the
MongoPersistentEntity if given.| Constructor and Description |
|---|
MappingMongoEntityInformation(MongoPersistentEntity<T> entity)
Creates a new
MappingMongoEntityInformation for the given MongoPersistentEntity. |
MappingMongoEntityInformation(MongoPersistentEntity<T> entity,
Class<ID> fallbackIdType)
Creates a new
MappingMongoEntityInformation for the given MongoPersistentEntity and fallback
identifier type. |
MappingMongoEntityInformation(MongoPersistentEntity<T> entity,
String customCollectionName)
Creates a new
MappingMongoEntityInformation for the given MongoPersistentEntity and custom
collection name. |
| Modifier and Type | Method and Description |
|---|---|
Collation |
getCollation()
Return the collation for the entity or null if
not defined. |
String |
getCollectionName()
Returns the name of the collection the entity shall be persisted to.
|
String |
getIdAttribute()
Returns the attribute that the id will be persisted to.
|
Class<ID> |
getIdType() |
Object |
getVersion(T entity)
Returns the version value for the entity or null if the entity is not
versioned. |
boolean |
isVersioned()
Returns whether the entity uses optimistic locking.
|
getId, getJavaType, isNewclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithasCollationgetId, getRequiredId, isNewgetJavaTypepublic MappingMongoEntityInformation(MongoPersistentEntity<T> entity)
MappingMongoEntityInformation for the given MongoPersistentEntity.entity - must not be null.public MappingMongoEntityInformation(MongoPersistentEntity<T> entity, @Nullable Class<ID> fallbackIdType)
MappingMongoEntityInformation for the given MongoPersistentEntity and fallback
identifier type.entity - must not be null.fallbackIdType - can be null.public MappingMongoEntityInformation(MongoPersistentEntity<T> entity, String customCollectionName)
MappingMongoEntityInformation for the given MongoPersistentEntity and custom
collection name.entity - must not be null.customCollectionName - can be null.public String getCollectionName()
MongoEntityInformationgetCollectionName in interface MongoEntityInformation<T,ID>public String getIdAttribute()
MongoEntityInformationgetIdAttribute in interface MongoEntityInformation<T,ID>public Class<ID> getIdType()
getIdType in interface EntityInformation<T,ID>getIdType in class PersistentEntityInformation<T,ID>public boolean isVersioned()
MongoEntityInformationisVersioned in interface MongoEntityInformation<T,ID>Version property.public Object getVersion(T entity)
MongoEntityInformationversioned.getVersion in interface MongoEntityInformation<T,ID>entity - must not be null@Nullable public Collation getCollation()
MongoEntityInformationnot defined.getCollation in interface MongoEntityInformation<T,ID>Copyright © 2011–2020 Pivotal Software, Inc.. All rights reserved.