New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LinkedHashMap error #102

Closed
xvipservice opened this Issue Jul 18, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@xvipservice

xvipservice commented Jul 18, 2016

我有一个 LinkedHashMap 如下:

    private UUID designId;
    private LinkedHashMap data;
    public UUID getDesignId() {
        return designId;
    }
    public void setDesignId(UUID designId) {
        this.designId = designId;
    }
    public LinkedHashMap getData(){
        return data;
    }
    public void setData(LinkedHashMap data) {
        this.data = data;
    }

DTO 如下

@ApiModel(value = "表单数据对象", description = "表单填写后的数据对象")
public class FormDataDto {

    @ApiModelProperty(value = "表单数据ID")
    private UUID id;

    @ApiModelProperty(value = "表单数据内容")
    private LinkedHashMap data;

    public UUID getId() {
        return id;
    }

    public void setId(UUID id) {
        this.id = id;
    }

    public LinkedHashMap getData() {
        return data;
    }

    public void setData(LinkedHashMap data) {
        this.data = data;
    }

}

生成的代码

@Override
  public final gaea.workflow.dto.FormDataDto asFormDataDto(gaea.workflow.domain.core.FormDataDomain in) {
    gaea.workflow.dto.FormDataDto out = null;
    if (in != null) {
      out = new gaea.workflow.dto.FormDataDto();
      if (in.getData() != null) {
        java.util.LinkedHashMap adataTmpMap = new java.util.LinkedHashMap();
        out.setData(adataTmpMap);
        for (java.util.Map.Entry<K,V> adataEntry : in.getData().entrySet()) {
          K adataTmpKey = null;
        }
      }
      else {
        out.setData(null);
      }
      out.setId(in.getId());
    }
    return out;
  }

@xvipservice xvipservice changed the title from LinkedHashMap to LinkedHashMap error Jul 18, 2016

@slemesle

This comment has been minimized.

Show comment
Hide comment
@slemesle

slemesle Jul 22, 2016

Hi,

you should specify the key and value types of the linked hash map to make it work smoothly.
Selma can not map untyped object.

slemesle commented Jul 22, 2016

Hi,

you should specify the key and value types of the linked hash map to make it work smoothly.
Selma can not map untyped object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment