@Test public void equalsTest() { Image image = new Image(); image.setHref("href"); image.setId(11); image.setOvfId("ovf-id"); image.setProviderImageId("provider-image-id"); image.setOvfHref("ovf-href"); image.setProviderId("provider-id"); image.setDemo(true); assertFalse(image.equals(null)); assertFalse(image.equals(new Image())); assertTrue(image.equals(image)); Image image1 = new Image(); image1.setHref("href"); image1.setId(11); image1.setOvfId("ovf-id"); image1.setProviderImageId("provider-image-id"); image1.setOvfHref("ovf-href"); image1.setProviderId("provider-id"); image1.setDemo(true); assertTrue(image.equals(image1)); Image image2 = new Image(); image2.setHref("href1"); image2.setId(11); image2.setOvfId("ovf-id"); image2.setProviderImageId("provider-image-id"); image2.setOvfHref("ovf-href"); image2.setProviderId("provider-id"); image2.setDemo(true); assertFalse(image.equals(image2)); Image image3 = new Image(); image3.setHref("href1"); image3.setId(111); image3.setOvfId("ovf-id"); image3.setProviderImageId("provider-image-id"); image3.setOvfHref("ovf-href"); image3.setProviderId("provider-id"); image3.setDemo(true); assertFalse(image.equals(image3)); Image image4 = new Image(); image4.setHref("href1"); image4.setId(11); image4.setOvfId("ovf-id1"); image4.setProviderImageId("provider-image-id"); image4.setOvfHref("ovf-href"); image4.setProviderId("provider-id"); image4.setDemo(true); assertFalse(image.equals(image4)); Image image5 = new Image(); image5.setHref("href1"); image5.setId(11); image5.setOvfId("ovf-id"); image5.setProviderImageId("provider-image-id1"); image5.setOvfHref("ovf-href"); image5.setProviderId("provider-id"); image5.setDemo(true); assertFalse(image.equals(image5)); Image image6 = new Image(); image6.setHref("href1"); image6.setId(11); image6.setOvfId("ovf-id"); image6.setProviderImageId("provider-image-id"); image6.setOvfHref("ovf-href1"); image6.setProviderId("provider-id"); image6.setDemo(true); assertFalse(image.equals(image6)); Image image7 = new Image(); image7.setHref("href1"); image7.setId(11); image7.setOvfId("ovf-id"); image7.setProviderImageId("provider-image-id"); image7.setOvfHref("ovf-href"); image7.setProviderId("provider-id1"); image7.setDemo(true); assertFalse(image.equals(image7)); Image image8 = new Image(); image8.setHref("href1"); image8.setId(11); image8.setOvfId("ovf-id"); image8.setProviderImageId("provider-image-id"); image8.setOvfHref("ovf-href"); image8.setProviderId("provider-id"); image8.setDemo(false); assertFalse(image.equals(image8)); }
@Override public boolean equals(Object obj) { if (!(obj instanceof Image)) return false; if (obj == this) return true; Image image = (Image) obj; if(this.ovfId == null) { if(image.getOvfId() != null) { return false; } } else if(!this.ovfId.equals(image.ovfId)) { return false; } if(this.href == null) { if(image.getHref() != null) { return false; } } else if(!this.href.equals(image.getHref())) { return false; } if(this.providerImageId == null) { if(image.getProviderImageId() != null ) { return false; } } else if(!this.providerImageId.equals(image.getProviderImageId())) { return false; } if(this.providerId == null) { if(image.getProviderId() != null) { return false; } } else if(!this.providerId.equals(image.getProviderId())) { return false; } if(this.ovfHref == null) { if(image.getOvfHref() != null) { return false; } } else if(!this.ovfHref.equals(image.getOvfHref())) { return false; } if(this.id == image.getId() && this.demo == image.isDemo()) { return true; } else { return false; } }
Image { @Override public boolean equals(Object obj) { if (!(obj instanceof Image)) return false; if (obj == this) return true; Image image = (Image) obj; if(this.ovfId == null) { if(image.getOvfId() != null) { return false; } } else if(!this.ovfId.equals(image.ovfId)) { return false; } if(this.href == null) { if(image.getHref() != null) { return false; } } else if(!this.href.equals(image.getHref())) { return false; } if(this.providerImageId == null) { if(image.getProviderImageId() != null ) { return false; } } else if(!this.providerImageId.equals(image.getProviderImageId())) { return false; } if(this.providerId == null) { if(image.getProviderId() != null) { return false; } } else if(!this.providerId.equals(image.getProviderId())) { return false; } if(this.ovfHref == null) { if(image.getOvfHref() != null) { return false; } } else if(!this.ovfHref.equals(image.getOvfHref())) { return false; } if(this.id == image.getId() && this.demo == image.isDemo()) { return true; } else { return false; } } }
Image { @Override public boolean equals(Object obj) { if (!(obj instanceof Image)) return false; if (obj == this) return true; Image image = (Image) obj; if(this.ovfId == null) { if(image.getOvfId() != null) { return false; } } else if(!this.ovfId.equals(image.ovfId)) { return false; } if(this.href == null) { if(image.getHref() != null) { return false; } } else if(!this.href.equals(image.getHref())) { return false; } if(this.providerImageId == null) { if(image.getProviderImageId() != null ) { return false; } } else if(!this.providerImageId.equals(image.getProviderImageId())) { return false; } if(this.providerId == null) { if(image.getProviderId() != null) { return false; } } else if(!this.providerId.equals(image.getProviderId())) { return false; } if(this.ovfHref == null) { if(image.getOvfHref() != null) { return false; } } else if(!this.ovfHref.equals(image.getOvfHref())) { return false; } if(this.id == image.getId() && this.demo == image.isDemo()) { return true; } else { return false; } }  }
Image { @Override public boolean equals(Object obj) { if (!(obj instanceof Image)) return false; if (obj == this) return true; Image image = (Image) obj; if(this.ovfId == null) { if(image.getOvfId() != null) { return false; } } else if(!this.ovfId.equals(image.ovfId)) { return false; } if(this.href == null) { if(image.getHref() != null) { return false; } } else if(!this.href.equals(image.getHref())) { return false; } if(this.providerImageId == null) { if(image.getProviderImageId() != null ) { return false; } } else if(!this.providerImageId.equals(image.getProviderImageId())) { return false; } if(this.providerId == null) { if(image.getProviderId() != null) { return false; } } else if(!this.providerId.equals(image.getProviderId())) { return false; } if(this.ovfHref == null) { if(image.getOvfHref() != null) { return false; } } else if(!this.ovfHref.equals(image.getOvfHref())) { return false; } if(this.id == image.getId() && this.demo == image.isDemo()) { return true; } else { return false; } }  @Transient String getHref(); void setHref(String href); @Id @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name = "image_id", unique = true, nullable = false) int getId(); void setId(int id); @Column(name = "ovf_id", nullable = true) String getOvfId(); void setOvfId(String ovfId); @Column(name = "provider_image_id", nullable = true) String getProviderImageId(); void setProviderImageId(String providerImageId); @Column(name = "ovf_href", nullable = true) String getOvfHref(); void setOvfHref(String ovfHref); @Column(name = "demo", nullable = false) boolean isDemo(); void setDemo(boolean demo); @Column(name = "provider_id", nullable = true) String getProviderId(); void setProviderId(String providerId); @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "application_id", nullable = true) Application getApplication(); void setApplication(Application application); @Override boolean equals(Object obj); }
Image { @Override public boolean equals(Object obj) { if (!(obj instanceof Image)) return false; if (obj == this) return true; Image image = (Image) obj; if(this.ovfId == null) { if(image.getOvfId() != null) { return false; } } else if(!this.ovfId.equals(image.ovfId)) { return false; } if(this.href == null) { if(image.getHref() != null) { return false; } } else if(!this.href.equals(image.getHref())) { return false; } if(this.providerImageId == null) { if(image.getProviderImageId() != null ) { return false; } } else if(!this.providerImageId.equals(image.getProviderImageId())) { return false; } if(this.providerId == null) { if(image.getProviderId() != null) { return false; } } else if(!this.providerId.equals(image.getProviderId())) { return false; } if(this.ovfHref == null) { if(image.getOvfHref() != null) { return false; } } else if(!this.ovfHref.equals(image.getOvfHref())) { return false; } if(this.id == image.getId() && this.demo == image.isDemo()) { return true; } else { return false; } }  @Transient String getHref(); void setHref(String href); @Id @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name = "image_id", unique = true, nullable = false) int getId(); void setId(int id); @Column(name = "ovf_id", nullable = true) String getOvfId(); void setOvfId(String ovfId); @Column(name = "provider_image_id", nullable = true) String getProviderImageId(); void setProviderImageId(String providerImageId); @Column(name = "ovf_href", nullable = true) String getOvfHref(); void setOvfHref(String ovfHref); @Column(name = "demo", nullable = false) boolean isDemo(); void setDemo(boolean demo); @Column(name = "provider_id", nullable = true) String getProviderId(); void setProviderId(String providerId); @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "application_id", nullable = true) Application getApplication(); void setApplication(Application application); @Override boolean equals(Object obj);  }