jOOQ / jOOQ

jOOQ is the best way to write SQL in Java
https://www.jooq.org
Other
6.15k stars 1.21k forks source link

Add support for nested embeddable types #13059

Open alf opened 2 years ago

alf commented 2 years ago

Use case:

Given:

create table registration (
  reg_id text primary key,
  from_dom int not null,
  from_woy int not null,
  to_dom int not null,
  to_woy int not null
);

I would like to define three embeddable types:

  1. Period start which embeds the from_{dom,woy} columns
  2. Period end which embeds the to_{dom,woy} columns
  3. Period which embeds the embedded columns above

The first two are easy. The third one is not currently possible as far as I can see.

lukaseder commented 2 years ago

Thanks a lot for your feature request. Indeed, embeddables currently cannot be nested, but there's no reason why they shouldn't be nestable. It should be possible to match other embeddables by <referenceName> with the <fields> configuration.