SUPER_ENTITY_TYPE - the super type for all saveable entitiespublic abstract class GQLAbstractSaveDataFetcher<SUPER_ENTITY_TYPE> extends GQLAbstractDataFetcher<SUPER_ENTITY_TYPE>
GQLSchemaBuilder for buildSchema method "save entity" data
fetcher argument| Constructor and Description |
|---|
GQLAbstractSaveDataFetcher() |
| Modifier and Type | Method and Description |
|---|---|
SUPER_ENTITY_TYPE |
get(graphql.schema.DataFetchingEnvironment environment) |
protected Map<String,IGQLDynamicAttributeSetter<Object,Object>> |
getDynamicAttributeSetters(String entityName)
Get
GQLDynamicAttributeSetter map for entity with given name |
protected abstract SUPER_ENTITY_TYPE |
getOrCreateAndSetProperties(String entityName,
Map<String,IGQLDynamicAttributeSetter<Object,Object>> dynamicAttributeSetters,
Map<String,Object> fieldValueMap)
Find or create entity and set its field values from given field map.
|
void |
registerDynamicAttributeSetters(List<IGQLDynamicAttributeSetter<?,?>> dynamicAttributeSetters)
Register dynamic attribute setters in this data fetcher.
|
protected SUPER_ENTITY_TYPE |
save(String entityName,
Map<String,IGQLDynamicAttributeSetter<Object,Object>> dynamicAttributeSetters,
Map<String,Object> fieldValueMap) |
protected abstract void |
save(SUPER_ENTITY_TYPE entity)
Save the entity in persistence layer.
|
convertObjectValue, getArgumentsForContext, getArgumentsForContextAsList, getArgumentValue, getEntityName, getRequestProvidedVariableNames, mapValue, mapValueprotected abstract void save(SUPER_ENTITY_TYPE entity)
entity - the entity to be savedprotected abstract SUPER_ENTITY_TYPE getOrCreateAndSetProperties(String entityName, Map<String,IGQLDynamicAttributeSetter<Object,Object>> dynamicAttributeSetters, Map<String,Object> fieldValueMap)
entityName - the entity class namedynamicAttributeSetters - a Map of IGQLDynamicAttributeSetter (keys are
property names)fieldValueMap - the Map of fields values to set in entityprotected SUPER_ENTITY_TYPE save(String entityName, Map<String,IGQLDynamicAttributeSetter<Object,Object>> dynamicAttributeSetters, Map<String,Object> fieldValueMap)
public SUPER_ENTITY_TYPE get(graphql.schema.DataFetchingEnvironment environment)
public void registerDynamicAttributeSetters(List<IGQLDynamicAttributeSetter<?,?>> dynamicAttributeSetters)
dynamicAttributeSetters - a List of IGQLDynamicAttributeSetterprotected Map<String,IGQLDynamicAttributeSetter<Object,Object>> getDynamicAttributeSetters(String entityName)
GQLDynamicAttributeSetter map for entity with given nameentityName - the entity nameMap
(key=fieldName,value=IGQLDynamicAttributeSetter)Copyright © 2019. All rights reserved.