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

Non meta-property attributes of DTO entity are erased when the entity is opened in standard editor #131

Closed
gorbunkov opened this issue Apr 6, 2021 · 0 comments
Assignees
Milestone

Comments

@gorbunkov
Copy link
Contributor

Create a DTO entity with an attribute which is not a MetaProperty:

@JmixEntity(name = "me_MyDtoEntity", annotatedPropertiesOnly = true)
public class MyDtoEntity {
    @JmixGeneratedValue
    @JmixProperty(mandatory = true)
    @JmixId
    private UUID id;

    @InstanceName
    @JmixProperty
    private String name;

    private SomeClass someClass;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public UUID getId() {
        return id;
    }

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

    public SomeClass getSomeClass() {
        return someClass;
    }

    public void setSomeClass(SomeClass someClass) {
        this.someClass = someClass;
    }
}

We have a browser of these DTO entities. Each instance in the browser have the someClass attribute filled. When we open the entity instance editor, the someClass property is erased. This probably happens because DataContext.merge copies only attributes that are metaproperties.

The sample project: merge-erase-sample.zip

@andreysubbotin andreysubbotin added this to the 1.0.0 milestone May 11, 2021
@andreysubbotin andreysubbotin removed this from the 1.0.0 milestone Jun 1, 2021
@andreysubbotin andreysubbotin added this to the 1.1.0 milestone Jun 22, 2021
@knstvk knstvk assigned knstvk and unassigned gorbunkov Sep 13, 2021
knstvk added a commit that referenced this issue Sep 29, 2021
knstvk added a commit to jmix-projects/jmix-ui that referenced this issue Sep 29, 2021
knstvk added a commit to jmix-projects/jmix-reports that referenced this issue Sep 30, 2021
@knstvk knstvk closed this as completed Sep 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants