Skip to content
Snippets Groups Projects
Commit 14d3ee98 authored by Yvan Peter's avatar Yvan Peter
Browse files

explication table association

parent c7b1acfa
Branches
No related tags found
No related merge requests found
...@@ -949,6 +949,8 @@ de données. Cela pourra être géré au niveau du DAO grâce à ...@@ -949,6 +949,8 @@ de données. Cela pourra être géré au niveau du DAO grâce à
[JDBI](https://jdbi.org/#_default_methods). Cet extrait de code montre [JDBI](https://jdbi.org/#_default_methods). Cet extrait de code montre
comment faire : comment faire :
import org.jdbi.v3.sqlobject.transaction.Transaction;
public interface PizzaDao { public interface PizzaDao {
@SqlUpdate("CREATE TABLE IF NOT EXISTS Pizzas ....") @SqlUpdate("CREATE TABLE IF NOT EXISTS Pizzas ....")
...@@ -957,6 +959,7 @@ comment faire : ...@@ -957,6 +959,7 @@ comment faire :
@SqlUpdate("CREATE TABLE IF NOT EXISTS PizzaIngredientsAssociation .....") @SqlUpdate("CREATE TABLE IF NOT EXISTS PizzaIngredientsAssociation .....")
void createAssociationTable(); void createAssociationTable();
@Transaction
default void createTableAndIngredientAssociation() { default void createTableAndIngredientAssociation() {
createAssociationTable(); createAssociationTable();
createPizzaTable(); createPizzaTable();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment