1 to N à deux entités (3/3)
17:20:50.373 [IJava-executor-0] INFO notebook -- Order(id=1, date=2026-10-14T17:20:50.212876) [Line(id=1, product=Pen, price=1.0), Line(id=3, product=Scissor, price=8.0), Line(id=2, product=Paper, price=5.0)]
```xbayay execute: false //| output: true //| echo: false //| label: fig-rel-onetomanya //| fig-cap: Les relations LINE et EORDER //| tags: [remove-input] //| vscode: {languageId: java} // PRINT SCHEMA String script=“%”;
IJava.getKernelInstance().getMagics().applyCellMagic(“rdbmsSchema”, List.of(“ex_one_to_many_a”),script); return null;
::: {#fig-rel-onetomanya-query .cell quarto-private-1='{"key":"vscode","value":{"languageId":"java"}}' execution_count=16}
::: {.cell-output .cell-output-stdout}
No JDBC connection available. Set system properties ‘jdbc.url’ (and optionally ‘jdbc.user’/‘jdbc.password’), or provide a Connection in the kernel environment.
:::
:::
## Many to Many (N-M)
::: {.content-visible when-profile="notes"}
L'annotation \@ManyToMany en Java Persistence API (JPA) est utilisée pour modéliser une relation many-to-many entre deux entités. La table d'association sera alors générée et utilisée implicitement.
:::
::: {.content-visible when-profile="slides"}
- \@ManyToMany en Java Persistence API (JPA) :
- Utilisée pour modéliser une relation many-to-many entre deux entités.
- La table d'association est générée et utilisée implicitement.
:::
::: {#cell-fig-uml-manytomany .cell quarto-private-1='{"key":"vscode","value":{"languageId":"java"}}' execution_count=17}
::: {.cell-output .cell-output-display}
{#fig-uml-manytomany}
:::
:::
```{java} execute: false
//| output: true
//| echo: false
//| label: fig-rel-manytomany
//| fig-cap: Les relation CUSTOMER, ADDRESS et la relation de d'association
//| tags: [remove-input]
//| vscode: {languageId: java}
// PRINT SCHEMA
String script="%";
IJava.getKernelInstance().getMagics().applyCellMagic("rdbmsSchema",
List.of("ex_many_to_many"),script);
return null;