forked from D-Net/dnet-hadoop
added hashCode to relation to avoid to produce multiple identical relations
This commit is contained in:
parent
b71d12cf26
commit
6a499c6b7a
|
@ -2,6 +2,7 @@
|
|||
package eu.dnetlib.dhp.schema.dump.oaf.graph;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
import eu.dnetlib.dhp.schema.dump.oaf.Provenance;
|
||||
|
||||
|
@ -42,4 +43,10 @@ public class Relation implements Serializable {
|
|||
public void setProvenance(Provenance provenance) {
|
||||
this.provenance = provenance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
||||
return Objects.hash(source.getId(), target.getId(), reltype.getType() + ":" + reltype.getName());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue