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

支持使用实体类中特定方法返回值作为key值 #93

Closed
Createsequence opened this issue Jun 28, 2023 · 0 comments
Closed

支持使用实体类中特定方法返回值作为key值 #93

Createsequence opened this issue Jun 28, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Createsequence
Copy link
Collaborator

Createsequence commented Jun 28, 2023

目前,虽然 BeanOeprationParser 支持从任何 AnnotatedElement 上的注解获得操作配置,但是实际上依然只支持基于 key 属性的操作。希望能够支持实体类中的任意方法的返回值作为 key ,就像 Jackson 那样,比如:

public class Foo {
    
    private String value;

    @Assemble(container = "foo", props = @Mapping("value"))
    public void getId() {
        // return key value    
    }
}

上述基于实例方法的配置也会和基于属性的配置一样有效,当执行时,会通过 getId 获取 key 值,然后换位数据源对象并进行属性映射。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant