Commit 19207f5a by Antti Tönkyrä

foodwave created

1 parent 21870786
...@@ -7,6 +7,7 @@ package fi.insomnia.bortal.model; ...@@ -7,6 +7,7 @@ package fi.insomnia.bortal.model;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.JoinColumn; import javax.persistence.JoinColumn;
...@@ -42,7 +43,7 @@ public class FoodWaveTemplate extends GenericEntity { ...@@ -42,7 +43,7 @@ public class FoodWaveTemplate extends GenericEntity {
@Column(name = "template_description") @Column(name = "template_description")
private String description; private String description;
@ManyToMany(mappedBy = "foodWaveTemplates") @ManyToMany(mappedBy = "foodWaveTemplates", cascade=CascadeType.ALL)
private List<Product> products; private List<Product> products;
@OneToMany(mappedBy = "template") @OneToMany(mappedBy = "template")
......
...@@ -82,6 +82,7 @@ public class FoodWaveView extends GenericCDIView { ...@@ -82,6 +82,7 @@ public class FoodWaveView extends GenericCDIView {
currentProduct = new Product(); currentProduct = new Product();
currentProduct.setProductFlags(ts); currentProduct.setProductFlags(ts);
currentProduct.setEvent(eventbean.getCurrentEvent());
} }
public void addProductToTemplate() { public void addProductToTemplate() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!