[BAEL-4056] Guide to MultipleBagFetchException (#10304)

* Removes DummyEntity
* Uses Artist Entity instead of DummyEntity
This commit is contained in:
Emmanuel Yasa
2020-12-05 10:44:40 +08:00
committed by GitHub
parent 2700958ec0
commit bc281bde2f
3 changed files with 3 additions and 47 deletions
@@ -1,43 +0,0 @@
package com.baeldung.jpa.multiplebagfetchexception;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.util.List;
import java.util.Objects;
@Entity
class DummyEntity {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@ElementCollection
private List<String> collection1;
@ElementCollection
private List<String> collection2;
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
DummyEntity that = (DummyEntity) o;
return Objects.equals(id, that.id);
}
@Override
public int hashCode() {
return id != null ? id.hashCode() : 0;
}
protected DummyEntity() {
}
}