Interface EntityImportExport
- All Known Implementing Classes:
- EntityImportExportImpl
- 
Method SummaryModifier and TypeMethodDescriptionexportEntitiesToJSON(Collection<Object> entities) Serializes a collection of entities to JSON usingEntitySerialization.exportEntitiesToJSON(Collection<Object> entities, FetchPlan fetchPlan) Serializes a collection of entities to JSON usingEntitySerialization.byte[]exportEntitiesToZIP(Collection<Object> entities) Serializes a collection of entities to JSON usingEntitySerializationand packs the JSON file into ZIP archive.byte[]exportEntitiesToZIP(Collection<Object> entities, FetchPlan fetchPlan) Serializes a collection of entities to JSON usingEntitySerializationand packs the JSON file into ZIP archive.importEntities(Collection<Object> entities, EntityImportPlan importPlan) importEntities(Collection<Object> entities, EntityImportPlan importPlan, boolean validate) Persists entities according to the rules, described by theimportPlanparameter.importEntities(Collection<Object> entities, EntityImportPlan importPlan, boolean validate, boolean optimisticLocking) Persists entities according to the rules, described by theimportPlanparameter.importEntities(Collection<Object> entities, EntityImportPlan importPlan, boolean validate, boolean optimisticLocking, boolean additionComposition) importEntitiesFromJson(String json, EntityImportPlan importPlan) Deserializes the JSON and persists deserialized entities according to the rules, described by theimportPlanparameter.importEntitiesFromZIP(byte[] zipBytes, EntityImportPlan importPlan) Reads a zip archive that contains a JSON file, deserializes the JSON and persists deserialized entities according to the rules, described by theimportPlanparameter.voidimportEntityIntoSaveContext(SaveContext saveContext, Object srcEntity, EntityImportPlan importPlan, boolean validate) voidimportEntityIntoSaveContext(SaveContext saveContext, Object srcEntity, EntityImportPlan importPlan, boolean validate, boolean optimisticLocking) voidimportEntityIntoSaveContext(SaveContext saveContext, Object srcEntity, EntityImportPlan importPlan, boolean validate, boolean optimisticLocking, boolean additionComposition) 
- 
Method Details- 
exportEntitiesToZIPSerializes a collection of entities to JSON using EntitySerializationand packs the JSON file into ZIP archive.Serialization is described in the EntitySerialization.toJson(Collection)method documentation- Parameters:
- entities- a collection of entities to export
- Returns:
- a byte array of zipped JSON file
 
- 
exportEntitiesToZIPSerializes a collection of entities to JSON using EntitySerializationand packs the JSON file into ZIP archive. Before the serialization entities will be reloaded with the fetch plan passed as method parameter.Serialization is described in the EntitySerialization.toJson(Collection)method documentation- Parameters:
- entities- a collection of entities to export
- fetchPlan- before serialization to JSON entities will be reloaded with this fetch plan
- Returns:
- a byte array of zipped JSON file
 
- 
exportEntitiesToJSONSerializes a collection of entities to JSON using EntitySerialization. Before the serialization entities will be reloaded with the fetch plan passed as method parameter.Serialization is described in the EntitySerialization.toJson(Collection)method documentation- Parameters:
- entities- a collection of entities to export
- fetchPlan- before serialization to JSON entities will be reloaded with this fetch plan
- Returns:
- a JSON string
 
- 
exportEntitiesToJSONSerializes a collection of entities to JSON using EntitySerialization.Serialization is described in the EntitySerialization.toJson(Collection)method documentation- Parameters:
- entities- a collection of entities to export
- Returns:
- a JSON string
 
- 
importEntitiesFromJsonDeserializes the JSON and persists deserialized entities according to the rules, described by theimportPlanparameter. If the entity is not present in the database, it will be saved. Otherwise the fields of the existing entity that are in theimportPlanwill be updated.- Parameters:
- json- JSON file containing entities
- importPlan-- EntityImportPlanwith the rules that describes how entities should be persisted.
- Returns:
- a collection of entities that have been imported
- See Also:
 
- 
importEntitiesFromZIPReads a zip archive that contains a JSON file, deserializes the JSON and persists deserialized entities according to the rules, described by theimportPlanparameter. If the entity is not present in the database, it will be saved. Otherwise the fields of the existing entity that are in theimportPlanwill be updated.- Parameters:
- zipBytes- byte array of ZIP archive with JSON file
- importPlan-- EntityImportPlanwith the rules that describes how entities should be persisted.
- Returns:
- a collection of entities that have been imported
- See Also:
 
- 
importEntitiesSeeimportEntities(Collection, EntityImportPlan, boolean). The current method doesn't perform bean validation
- 
importEntitiesCollection<Object> importEntities(Collection<Object> entities, EntityImportPlan importPlan, boolean validate) Persists entities according to the rules, described by theimportPlanparameter. If the entity is not present in the database, it will be saved. Otherwise the fields of the existing entity that are in theimportPlanwill be updated.If the import plan contains a property for composition attribute then all composition collection members that are absent in the passed entity will be removed. - Parameters:
- importPlan-- EntityImportPlanwith the rules that describes how entities should be persisted.
- validate- whether the passed entities should be validated by the bean validation mechanism before entities are persisted
- Returns:
- a collection of entities that have been imported
 
- 
importEntitiesCollection<Object> importEntities(Collection<Object> entities, EntityImportPlan importPlan, boolean validate, boolean optimisticLocking) Persists entities according to the rules, described by theimportPlanparameter. If the entity is not present in the database, it will be saved. Otherwise the fields of the existing entity that are in theimportPlanwill be updated.If the import plan contains a property for composition attribute then all composition collection members that are absent in the passed entity will be removed. - Parameters:
- importPlan-- EntityImportPlanwith the rules that describes how entities should be persisted.
- validate- whether the passed entities should be validated by the bean validation mechanism before entities are persisted
- optimisticLocking- whether the passed entities versions should be validated before entities are persisted
- Returns:
- a collection of entities that have been imported
 
- 
importEntitiesCollection<Object> importEntities(Collection<Object> entities, EntityImportPlan importPlan, boolean validate, boolean optimisticLocking, boolean additionComposition) 
- 
importEntityIntoSaveContextvoid importEntityIntoSaveContext(SaveContext saveContext, Object srcEntity, EntityImportPlan importPlan, boolean validate) 
- 
importEntityIntoSaveContextvoid importEntityIntoSaveContext(SaveContext saveContext, Object srcEntity, EntityImportPlan importPlan, boolean validate, boolean optimisticLocking) 
- 
importEntityIntoSaveContextvoid importEntityIntoSaveContext(SaveContext saveContext, Object srcEntity, EntityImportPlan importPlan, boolean validate, boolean optimisticLocking, boolean additionComposition) 
 
-