@Component(value="cuba_EntityImportViewBuilderAPI") public class EntityImportViewBuilder extends java.lang.Object implements EntityImportViewBuilderAPI
Modifier and Type | Field and Description |
---|---|
protected Metadata |
metadata |
protected MetadataTools |
metadataTools |
protected Security |
security |
NAME
Constructor and Description |
---|
EntityImportViewBuilder() |
Modifier and Type | Method and Description |
---|---|
EntityImportView |
buildFromJson(java.lang.String json,
MetaClass metaClass)
Builds an
EntityImportView that contains all fields that are presented in the JSON object. |
protected EntityImportView |
buildFromJsonArray(com.google.gson.JsonArray jsonArray,
MetaClass metaClass)
Builds a EntityImportView that contains properties from all collection members.
|
protected EntityImportView |
buildFromJsonObject(com.google.gson.JsonObject jsonObject,
MetaClass metaClass) |
protected EntityImportView |
mergeViews(EntityImportView view1,
EntityImportView view2)
Recursively merges two views.
|
@Inject protected MetadataTools metadataTools
@Inject protected Metadata metadata
@Inject protected Security security
public EntityImportView buildFromJson(java.lang.String json, MetaClass metaClass)
EntityImportViewBuilderAPI
EntityImportView
that contains all fields that are presented in the JSON object.
All references will be added to the view as a ReferenceImportBehaviour.ERROR_ON_MISSING
behavior. All references that have a @Composition annotation will be added to the view with a property that has a
EntityImportViewProperty
. 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 EntityImportViewBuilderAPI
json
- a string that represents a JSON objectmetaClass
- a MetaClass of the entityprotected EntityImportView buildFromJsonObject(com.google.gson.JsonObject jsonObject, MetaClass metaClass)
protected EntityImportView buildFromJsonArray(com.google.gson.JsonArray jsonArray, MetaClass metaClass)
jsonArray
- a JsonArraymetaClass
- a metaClass of entities that are in the jsonArrayprotected EntityImportView mergeViews(@Nullable EntityImportView view1, @Nullable EntityImportView view2)