Embedded Entity always returns a zero length array with EntityImportExportService service

Hi, i’m trying to import a JSON from an “Embedded Entity” with the EntityImportExportService service but always returns a zero length array.

Its exported with this code (its ok):


Saved JSON:

[  {    "_entityName": "caerp$EventoVinculo",    "id": "1",    "requerido": false,    "nombre": "Bien",    "disponible": true  },  {    "_entityName": "caerp$EventoVinculo",    "id": "2",    "requerido": false,    "nombre": "Cliente",    "disponible": true  },  {    "_entityName": "caerp$EventoVinculo",    "id": "3",    "requerido": false,    "nombre": "Comprobante",    "disponible": false  },  {    "_entityName": "caerp$EventoVinculo",    "id": "4",    "requerido": false,    "nombre": "Contacto",    "disponible": false  },  {    "_entityName": "caerp$EventoVinculo",    "id": "5",    "requerido": false,    "nombre": "Evento",    "disponible": false  },  {    "_entityName": "caerp$EventoVinculo",    "id": "6",    "requerido": false,    "nombre": "Proeveedor",    "disponible": false  }]

And this is the code for import (error):

EntityImportView viewVinculos = new EntityImportView(EventoVinculo.class);
Collection<Entity> vinculos = entityImportExportService.importEntitiesFromJSON(item.getVinculos(), viewVinculos);

If i set the view to NULL, i get a null pointer exception.

Now, this is my Entity:


package com.company.caerp.entity;

import com.haulmont.chile.core.annotations.MetaClass;
import com.haulmont.chile.core.annotations.MetaProperty;
import javax.validation.constraints.NotNull;
import com.haulmont.cuba.core.entity.BaseIntegerIdEntity;
import com.haulmont.chile.core.annotations.NamePattern;

@MetaClass(name = "caerp$EventoVinculo")
public class EventoVinculo extends BaseIntegerIdEntity {
    private static final long serialVersionUID = 6804086645020152334L;

    @MetaProperty(mandatory = true)
    protected String nombre;

    @MetaProperty(mandatory = true)
    protected Boolean disponible = false;

    protected Boolean requerido;

    public void setNombre(String nombre) {
        this.nombre = nombre;

    public String getNombre() {
        return nombre;

    public void setDisponible(Boolean disponible) {
        this.disponible = disponible;

    public Boolean getDisponible() {
        return disponible;

    public void setRequerido(Boolean requerido) {
        this.requerido = requerido;

    public Boolean getRequerido() {
        return requerido;



Hi Mark,
I think you use a wrong service. EntityImportExportService.importXXX methods deserialize and save entities to the database, but your entity is not persistent. If you need just to serialize/deserialize entities then you probably should use the EntitySerializationAPI.

1 Like

ok, i’ll try it. regards!!.