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

Generate a record constructor taking a generated POJO #11183

Closed
lukaseder opened this issue Jan 4, 2021 · 3 comments
Closed

Generate a record constructor taking a generated POJO #11183

lukaseder opened this issue Jan 4, 2021 · 3 comments

Comments

@lukaseder
Copy link
Member

lukaseder commented Jan 4, 2021

When POJOs are generated, it would make sense to generate a record constructor taking the POJO as an argument.

This is similar to the discussion here, but for constructors:

This would greatly simplify generated code in DAOs when implementing #11182, where new EmbeddableRecord(embeddablePojo) would be very useful.

The difficulty is with nested records/pojos. Seeing that this might produce unforeseen compilation errors, it needs to be guarded by a new flag.

@lukaseder lukaseder added this to the Version 3.15.0 milestone Jan 4, 2021
@lukaseder lukaseder added this to To do in 3.14 Embeddable Types via automation Jan 4, 2021
lukaseder added a commit that referenced this issue Jan 4, 2021
This includes:

- [#11183] Generate record constructor taking a generated POJO
- [#11187] Add DAO.fetch(Field<Z>, Collection<? extends Z>)
3.14 Embeddable Types automation moved this from To do to Done Jan 4, 2021
@lukaseder lukaseder reopened this Jan 14, 2021
3.14 Embeddable Types automation moved this from Done to In progress Jan 14, 2021
@lukaseder
Copy link
Member Author

lukaseder commented Jan 14, 2021

There are some compilation errors in our integration tests when using UDTs. Let's investigate

@lukaseder
Copy link
Member Author

There are also StackOverflowError at runtime, because our default ConverterProvider will now pick the wrong constructor in some mapping scenario and recurse infinitely, trying to look up the correct converter.

@lukaseder
Copy link
Member Author

An edge case code generation compilation error: #13315

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

No branches or pull requests

1 participant