@Test public void addDeploymentTest() { Application application = new Application(); assertEquals(null, application.getDeployments()); Deployment deployment = new Deployment(); application.addDeployment(deployment); assertEquals(deployment, application.getDeployments().get(0)); }
public void addDeployment(Deployment deployment) { if(deployments==null) deployments = new ArrayList<Deployment>(); deployments.add(deployment); }
Application { public void addDeployment(Deployment deployment) { if(deployments==null) deployments = new ArrayList<Deployment>(); deployments.add(deployment); } }
Application { public void addDeployment(Deployment deployment) { if(deployments==null) deployments = new ArrayList<Deployment>(); deployments.add(deployment); }  }
Application { public void addDeployment(Deployment deployment) { if(deployments==null) deployments = new ArrayList<Deployment>(); deployments.add(deployment); }  @Id @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name = "application_id", unique = true, nullable = false) int getId(); void setId(int id); @Column(name = "name", nullable = false) String getName(); void setName(String name); @Transient List<Link> getLinks(); void setLinks(List<Link> links); void addLink(Link link); @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) @JoinColumn(name = "application_id", referencedColumnName="application_id", nullable = true) List<Image> getImages(); void setImages(List<Image> images); void addImage(Image image); @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) @JoinColumn(name = "application_id", referencedColumnName="application_id", nullable = true) List<Deployment> getDeployments(); void setDeployments(List<Deployment> deployments); void addDeployment(Deployment deployment); @Transient String getHref(); void setHref(String href); }
Application { public void addDeployment(Deployment deployment) { if(deployments==null) deployments = new ArrayList<Deployment>(); deployments.add(deployment); }  @Id @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name = "application_id", unique = true, nullable = false) int getId(); void setId(int id); @Column(name = "name", nullable = false) String getName(); void setName(String name); @Transient List<Link> getLinks(); void setLinks(List<Link> links); void addLink(Link link); @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) @JoinColumn(name = "application_id", referencedColumnName="application_id", nullable = true) List<Image> getImages(); void setImages(List<Image> images); void addImage(Image image); @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) @JoinColumn(name = "application_id", referencedColumnName="application_id", nullable = true) List<Deployment> getDeployments(); void setDeployments(List<Deployment> deployments); void addDeployment(Deployment deployment); @Transient String getHref(); void setHref(String href);  }