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

Multiple Constructor Mappers of same type #2445

Open
JoshDoug opened this issue Jul 19, 2023 · 1 comment
Open

Multiple Constructor Mappers of same type #2445

JoshDoug opened this issue Jul 19, 2023 · 1 comment
Labels

Comments

@JoshDoug
Copy link

JoshDoug commented Jul 19, 2023

It doesn't appear possible to have multiple ConstructorMappers registered with the same type, even if they have different prefixes.

@RegisterConstructorMapper(value = Example.class)
@RegisterConstructorMapper(value = ExampleSub.class, prefix = "first")
@RegisterConstructorMapper(value = ExampleSub.class, prefix = "second")
@SqlQuery("""
                ...
            """)
@UseRowReducer(ExampleReducer.class)
Example findById(@Bind("id") int id);

Within the Reducer the RowView only has the second constructor mapper of the ExampleSub class with the prefix "second" in the example.

Is this intended expected behaviour or a bug?

@stevenschlansker
Copy link
Member

I don't think this is intentionally not supported, but neither has it been tested to work. We'd love to add this feature.

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

No branches or pull requests

2 participants