@java.lang.SuppressWarnings({"rawtypes", "unchecked"}) public class MongoEntityPersister extends AbstractMongoObectEntityPersister
A EntityPersister implementation for the Mongo document store
Modifiers | Name | Description |
---|---|---|
static ValueRetrievalStrategy<org.bson.Document> |
VALUE_RETRIEVAL_STRATEGY |
Fields inherited from class | Fields |
---|---|
class AbstractMongoObectEntityPersister |
INSTANCE_PREFIX, MONGO_CLASS_FIELD, MONGO_ID_FIELD, NEXT_ID_SUFFIX, hasNumericalIdentifier, hasStringIdentifier, log |
class NativeEntryEntityPersister |
EMBEDDED_PREFIX, classMapping |
class ThirdPartyCacheEntityPersister |
cacheAdapterRepository |
class LockableEntityPersister |
DEFAULT_TIMEOUT |
class EntityPersister |
mappingContext, persistentEntity, proxyFactory, publisher, reflector, session |
Constructor and description |
---|
MongoEntityPersister
(MappingContext mappingContext, PersistentEntity entity, MongoSession mongoSession, org.springframework.context.ApplicationEventPublisher publisher) |
Type Params | Return Type | Name and description |
---|---|---|
|
private static java.lang.Object |
convertPrimitiveToNative(java.lang.Object item, MappingContext mappingContext) |
|
protected org.bson.Document |
createDBObjectWithKey(java.lang.Object key) |
|
protected org.bson.Document |
createNewEntry(java.lang.String family, java.lang.Object instance) |
|
protected org.bson.Document |
createNewEntry(java.lang.String family) |
|
public Query |
createQuery() |
|
protected void |
deleteEntries(java.lang.String family, java.util.List<java.lang.Object> keys) |
|
protected void |
deleteEntry(java.lang.String family, java.lang.Object key, java.lang.Object entry) |
|
protected java.lang.Object |
generateIdentifier(PersistentEntity persistentEntity, org.bson.Document nativeEntry) |
|
protected java.lang.String |
getCollectionName(PersistentEntity persistentEntity, org.bson.Document nativeEntry) |
|
public static java.lang.Object |
getSimpleNativePropertyValue(java.lang.Object value, MappingContext mappingContext) Convert a value into a type suitable for use in Mongo. |
|
public java.lang.Object |
getValue(org.bson.Document document, java.lang.String name) |
|
ValueRetrievalStrategy<org.bson.Document> |
getValueRetrievalStrategy() |
|
protected boolean |
isEmbeddedEntry(java.lang.Object entry) |
|
protected void |
loadEmbeddedCollection(EmbeddedCollection embeddedCollection, EntityAccess ea, java.lang.Object embeddedInstances, java.lang.String propertyKey) |
|
private org.bson.Document |
modifyNullsToUnsets(org.bson.Document nativeEntry) |
|
private org.bson.Document |
removeNullEntries(org.bson.Document nativeEntry) |
|
protected org.bson.Document |
retrieveEntry(PersistentEntity persistentEntity, java.lang.String family, java.io.Serializable key) |
|
public void |
run() |
|
public static void |
setDBObjectValue(org.bson.Document nativeEntry, java.lang.String key, java.lang.Object value, MappingContext mappingContext) |
|
protected void |
setEntryValue(org.bson.Document nativeEntry, java.lang.String key, java.lang.Object value) |
|
public void |
setValue(org.bson.Document document, java.lang.String name, java.lang.Object value) |
|
protected java.lang.Object |
storeEntry(PersistentEntity persistentEntity, EntityAccess entityAccess, java.lang.Object storeId, org.bson.Document nativeEntry) |
|
public void |
updateEntry(PersistentEntity persistentEntity, EntityAccess ea, java.lang.Object key, org.bson.Document entry) |
Convert a value into a type suitable for use in Mongo. Collections and maps are converted recursively. The mapping context is used for the conversion if possible, otherwise toString() is the eventual fallback.
value
- The value to convert (or null)mappingContext
- The mapping context.