Skip to content

Allow (optional) update expression in @Property #94

@adrianshum

Description

@adrianshum

It is somehow related to the Lookup-on-update example.

In case I am using a DTO to get the summary from a model, and also want to use the same DTO to contribute (update) back to the model, current translation is not working:

public class Foo {
  private Bar bar;
}
public class Bar {
  private String code;
}

public FooDto {
  private String bar;
}

I would want to use expression bar.code in translating to FooDto, and do something like barDao.findByCode(this.bar) when updating Foo by FooDto. It is not possible in current Moo.

I believe in most case having only the translation expression and use it in update should be sufficient, e.g. in above case, I can simply treat the update action to be aFoo.bar.code = this.bar, while in case that the update and translation is not the same, we can have the optional update expression to deal with it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions