@Component(value="core_EntityImportPlanJsonBuilder") public class EntityImportPlanJsonBuilderImpl extends java.lang.Object implements EntityImportPlanJsonBuilder
Modifier and Type | Field and Description |
---|---|
protected AccessManager |
accessManager |
protected EntityImportPlans |
entityImportPlans |
protected Metadata |
metadata |
protected MetadataTools |
metadataTools |
Constructor and Description |
---|
EntityImportPlanJsonBuilderImpl() |
Modifier and Type | Method and Description |
---|---|
EntityImportPlan |
buildFromJson(java.lang.String json,
MetaClass metaClass)
Builds an
EntityImportPlan that contains all fields that are presented in the JSON object. |
protected EntityImportPlan |
buildFromJsonArray(com.google.gson.JsonArray jsonArray,
MetaClass metaClass)
Builds an EntityImportPlan that contains properties from all collection members.
|
protected EntityImportPlan |
buildFromJsonObject(com.google.gson.JsonObject jsonObject,
MetaClass metaClass) |
protected EntityImportPlan |
mergeImportPlans(EntityImportPlan plan1,
EntityImportPlan plan2)
Recursively merges two import plans.
|
@Autowired protected MetadataTools metadataTools
@Autowired protected Metadata metadata
@Autowired protected AccessManager accessManager
@Autowired protected EntityImportPlans entityImportPlans
public EntityImportPlan buildFromJson(java.lang.String json, MetaClass metaClass)
EntityImportPlanJsonBuilder
EntityImportPlan
that contains all fields that are presented in the JSON object.
All references will be added to the plan as a ReferenceImportBehaviour.ERROR_ON_MISSING
behavior. All
references that have a @Composition annotation will be added to the plan with a property that has a EntityImportPlanProperty
. This means that compositions will be persisted during the import. Absent collection
items will be removed from the database.
For many-to-many association items corresponding entities will be searched in the database. If any of them is missing, an error will be thrown. Absent collection members will be excluded from the many-to-many association.
buildFromJson
in interface EntityImportPlanJsonBuilder
json
- a string that represents a JSON objectmetaClass
- a MetaClass of the entityprotected EntityImportPlan buildFromJsonObject(com.google.gson.JsonObject jsonObject, MetaClass metaClass)
protected EntityImportPlan buildFromJsonArray(com.google.gson.JsonArray jsonArray, MetaClass metaClass)
jsonArray
- a JsonArraymetaClass
- a metaClass of entities that are in the jsonArrayprotected EntityImportPlan mergeImportPlans(@Nullable EntityImportPlan plan1, @Nullable EntityImportPlan plan2)