public class DatastoreMappingContext extends org.springframework.data.mapping.context.AbstractMappingContext<DatastorePersistentEntity<?>,DatastorePersistentProperty> implements org.springframework.context.ApplicationContextAware
Constructor and Description |
---|
DatastoreMappingContext() |
Modifier and Type | Method and Description |
---|---|
static void |
addDiscriminationClassConnection(Class parentClass,
Class subClass)
Registers in the DatastoreMappingContext that two classes are discriminated from the same
Datastore Kind.
|
protected <T> DatastorePersistentEntityImpl<T> |
constructPersistentEntity(org.springframework.data.util.TypeInformation<T> typeInformation) |
protected <T> DatastorePersistentEntity<?> |
createPersistentEntity(org.springframework.data.util.TypeInformation<T> typeInformation) |
protected DatastorePersistentProperty |
createPersistentProperty(org.springframework.data.mapping.model.Property property,
DatastorePersistentEntity<?> owner,
org.springframework.data.mapping.model.SimpleTypeHolder simpleTypeHolder) |
DatastorePersistentEntity<?> |
getDatastorePersistentEntity(Class<?> entityClass)
A non-null version of the
MappingContext.getPersistentEntity(Class) . |
static Set<Class> |
getDiscriminationFamily(Class clazz)
Get the set of other classes that share the same underlying Datastore Kind and that are
subclasses of the given class.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
addPersistentEntity, addPersistentEntity, afterPropertiesSet, doFindPersistentPropertyPaths, findPersistentPropertyPaths, getManagedTypes, getPersistentEntities, getPersistentEntity, getPersistentEntity, getPersistentEntity, getPersistentPropertyPath, getPersistentPropertyPath, hasPersistentEntityFor, initialize, setApplicationEventPublisher, setInitialEntitySet, setSimpleTypeHolder, setStrict, shouldCreatePersistentEntityFor
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
setApplicationContext
in class org.springframework.data.mapping.context.AbstractMappingContext<DatastorePersistentEntity<?>,DatastorePersistentProperty>
public static void addDiscriminationClassConnection(Class parentClass, Class subClass)
parentClass
- the superclass.subClass
- the subclass.public static Set<Class> getDiscriminationFamily(Class clazz)
clazz
- the class to look up.Set
of other classes that share the same Kind that are subclasses. Will be
null
if this class is not discriminated from a set of other classes.protected <T> DatastorePersistentEntityImpl<T> constructPersistentEntity(org.springframework.data.util.TypeInformation<T> typeInformation)
protected <T> DatastorePersistentEntity<?> createPersistentEntity(org.springframework.data.util.TypeInformation<T> typeInformation)
createPersistentEntity
in class org.springframework.data.mapping.context.AbstractMappingContext<DatastorePersistentEntity<?>,DatastorePersistentProperty>
protected DatastorePersistentProperty createPersistentProperty(org.springframework.data.mapping.model.Property property, DatastorePersistentEntity<?> owner, org.springframework.data.mapping.model.SimpleTypeHolder simpleTypeHolder)
createPersistentProperty
in class org.springframework.data.mapping.context.AbstractMappingContext<DatastorePersistentEntity<?>,DatastorePersistentProperty>
@NonNull public DatastorePersistentEntity<?> getDatastorePersistentEntity(Class<?> entityClass)
MappingContext.getPersistentEntity(Class)
.entityClass
- the entity type.DatastorePersistentEntity
for the provided type.DatastoreDataException
- if unable to retrieve a DatastorePersistentEntity for the
provided type.Copyright © 2022. All rights reserved.