Skip to content
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
Closed

LinkedHashMap error #102

xvipservice opened this issue Jul 18, 2016 · 1 comment
Labels
bug
Milestone

Comments

@xvipservice
Copy link

@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 LinkedHashMap LinkedHashMap error Jul 18, 2016
@slemesle
Copy link
Collaborator

@slemesle 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.

slemesle added a commit that referenced this issue Aug 4, 2016
@slemesle slemesle added the bug label Aug 4, 2016
@slemesle slemesle added this to the 1.0 Final milestone Aug 4, 2016
slemesle added a commit that referenced this issue Aug 5, 2016
@slemesle slemesle closed this Oct 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.