habuma / spring-in-action-6-samples

Sample code from Spring in Action 6
487 stars 343 forks source link

taco_order_tacos table has no entry #9

Open mrigankvallabh opened 2 years ago

mrigankvallabh commented 2 years ago

As it is the final code of the chapter 5, has one slight problem that it creates no entry in the taco_order_tacos table, and hence the link between the taco_order and taco is lost.

This is perhaps happening because the Modelattribute in DesignController always passes a New TacoOrder

@ModelAttribute(name = "order", value = "order")
  public TacoOrder order() {
    return new TacoOrder();
  }