[BAEL-4056] Guide to MultipleBagFetchException (#10304)
* Removes DummyEntity * Uses Artist Entity instead of DummyEntity
This commit is contained in:
-43
@@ -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() {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user