|
|
@ -16,7 +16,7 @@ import javax.persistence.Table;
|
|
|
|
@Table(name = "REQUIREMENT")
|
|
|
|
@Table(name = "REQUIREMENT")
|
|
|
|
public class Requirement extends RequirementBase
|
|
|
|
public class Requirement extends RequirementBase
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@OneToMany(fetch = FetchType.EAGER, mappedBy = "requirement", cascade = CascadeType.ALL)
|
|
|
|
@OneToMany(fetch = FetchType.EAGER, mappedBy = "requirement", cascade = CascadeType.ALL, orphanRemoval = true)
|
|
|
|
private List<RequirementItem> items;
|
|
|
|
private List<RequirementItem> items;
|
|
|
|
|
|
|
|
|
|
|
|
@Column(name = "DELIVERYDATE")
|
|
|
|
@Column(name = "DELIVERYDATE")
|
|
|
@ -38,6 +38,12 @@ public class Requirement extends RequirementBase
|
|
|
|
return items;
|
|
|
|
return items;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void addItem(RequirementItem item)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
item.setRequirement(this); // nutné nastavit kvůli obousměrné vazbě. Na položce v DB se jinak nenastaví ID hlavního záznamu
|
|
|
|
|
|
|
|
items.add(item);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setItems(List<RequirementItem> items)
|
|
|
|
public void setItems(List<RequirementItem> items)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.items = items;
|
|
|
|
this.items = items;
|
|
|
|