public interface EntityImportExport
Modifier and Type | Method and Description |
---|---|
java.lang.String |
exportEntitiesToJSON(java.util.Collection<java.lang.Object> entities)
Serializes a collection of entities to JSON using
EntitySerialization . |
java.lang.String |
exportEntitiesToJSON(java.util.Collection<java.lang.Object> entities,
FetchPlan fetchPlan)
Serializes a collection of entities to JSON using
EntitySerialization . |
byte[] |
exportEntitiesToZIP(java.util.Collection<java.lang.Object> entities)
Serializes a collection of entities to JSON using
EntitySerialization
and packs the JSON file into ZIP archive. |
byte[] |
exportEntitiesToZIP(java.util.Collection<java.lang.Object> entities,
FetchPlan fetchPlan)
Serializes a collection of entities to JSON using
EntitySerialization
and packs the JSON file into ZIP archive. |
java.util.Collection<java.lang.Object> |
importEntities(java.util.Collection<java.lang.Object> entities,
EntityImportPlan importPlan)
|
java.util.Collection<java.lang.Object> |
importEntities(java.util.Collection<java.lang.Object> entities,
EntityImportPlan importPlan,
boolean validate)
Persists entities according to the rules, described by the
importPlan parameter. |
java.util.Collection<java.lang.Object> |
importEntities(java.util.Collection<java.lang.Object> entities,
EntityImportPlan importPlan,
boolean validate,
boolean optimisticLocking)
Persists entities according to the rules, described by the
importPlan parameter. |
java.util.Collection<java.lang.Object> |
importEntities(java.util.Collection<java.lang.Object> entities,
EntityImportPlan importPlan,
boolean validate,
boolean optimisticLocking,
boolean additionComposition) |
java.util.Collection<java.lang.Object> |
importEntitiesFromJson(java.lang.String json,
EntityImportPlan importPlan)
Deserializes the JSON and persists deserialized entities according to the rules, described by the
importPlan parameter. |
java.util.Collection<java.lang.Object> |
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 the
importPlan parameter. |
void |
importEntityIntoSaveContext(SaveContext saveContext,
java.lang.Object srcEntity,
EntityImportPlan importPlan,
boolean validate) |
void |
importEntityIntoSaveContext(SaveContext saveContext,
java.lang.Object srcEntity,
EntityImportPlan importPlan,
boolean validate,
boolean optimisticLocking) |
void |
importEntityIntoSaveContext(SaveContext saveContext,
java.lang.Object srcEntity,
EntityImportPlan importPlan,
boolean validate,
boolean optimisticLocking,
boolean additionComposition) |
byte[] exportEntitiesToZIP(java.util.Collection<java.lang.Object> entities)
Serializes a collection of entities to JSON using EntitySerialization
and packs the JSON file into ZIP archive.
Serialization is described in the EntitySerialization.toJson(Collection)
method documentation
entities
- a collection of entities to exportbyte[] exportEntitiesToZIP(java.util.Collection<java.lang.Object> entities, FetchPlan fetchPlan)
Serializes a collection of entities to JSON using EntitySerialization
and 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
entities
- a collection of entities to exportfetchPlan
- before serialization to JSON entities will be reloaded with this fetch planjava.lang.String exportEntitiesToJSON(java.util.Collection<java.lang.Object> entities, FetchPlan fetchPlan)
Serializes 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
entities
- a collection of entities to exportfetchPlan
- before serialization to JSON entities will be reloaded with this fetch planjava.lang.String exportEntitiesToJSON(java.util.Collection<java.lang.Object> entities)
Serializes a collection of entities to JSON using EntitySerialization
.
Serialization is described in the EntitySerialization.toJson(Collection)
method documentation
entities
- a collection of entities to exportjava.util.Collection<java.lang.Object> importEntitiesFromJson(java.lang.String json, EntityImportPlan importPlan)
importPlan
parameter. If the entity is not present in the database, it will be saved. Otherwise the fields of
the existing entity that are in the importPlan
will be updated.json
- JSON file containing entitiesimportPlan
- EntityImportPlan
with the rules that describes how entities should be persisted.EntityImportPlan
java.util.Collection<java.lang.Object> importEntitiesFromZIP(byte[] zipBytes, EntityImportPlan importPlan)
importPlan
parameter. If the entity is not present in the database, it
will be saved. Otherwise the fields of the existing entity that are in the importPlan
will be updated.zipBytes
- byte array of ZIP archive with JSON fileimportPlan
- EntityImportPlan
with the rules that describes how entities should be persisted.EntityImportPlan
java.util.Collection<java.lang.Object> importEntities(java.util.Collection<java.lang.Object> entities, EntityImportPlan importPlan)
importEntities(Collection, EntityImportPlan, boolean)
. The current method doesn't perform bean
validationjava.util.Collection<java.lang.Object> importEntities(java.util.Collection<java.lang.Object> entities, EntityImportPlan importPlan, boolean validate)
importPlan
parameter. If the entity is not
present in the database, it will be saved. Otherwise the fields of the existing entity that are in the importPlan
will 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.
importPlan
- EntityImportPlan
with 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 persistedjava.util.Collection<java.lang.Object> importEntities(java.util.Collection<java.lang.Object> entities, EntityImportPlan importPlan, boolean validate, boolean optimisticLocking)
importPlan
parameter. If the entity is not
present in the database, it will be saved. Otherwise the fields of the existing entity that are in the importPlan
will 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.
importPlan
- EntityImportPlan
with 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 persistedoptimisticLocking
- whether the passed entities versions should be validated before entities are persistedjava.util.Collection<java.lang.Object> importEntities(java.util.Collection<java.lang.Object> entities, EntityImportPlan importPlan, boolean validate, boolean optimisticLocking, boolean additionComposition)
void importEntityIntoSaveContext(SaveContext saveContext, java.lang.Object srcEntity, EntityImportPlan importPlan, boolean validate)
void importEntityIntoSaveContext(SaveContext saveContext, java.lang.Object srcEntity, EntityImportPlan importPlan, boolean validate, boolean optimisticLocking)
void importEntityIntoSaveContext(SaveContext saveContext, java.lang.Object srcEntity, EntityImportPlan importPlan, boolean validate, boolean optimisticLocking, boolean additionComposition)